Commit 752a685b authored by Sven Neumann's avatar Sven Neumann

Use finite() instead of isnan() and isinf(). Use _finite() on WIN32.

According to Garry, finite() is probably available more widely than
isinf().


--Sven
parent 5a40e72b
2000-04-11 Sven Neumann <sven@gimp.org>
* libgimp/gimpmath.h: defined FINITE() macro that defaults to
finite(). Hopefully this is more portable than isnan() and isinf().
* app/gimage_cmds.c
* tools/pdbgen/pdb/gimage.pdb: use FINITE() here
2000-04-11 Tor Lillqvist <tml@iki.fi>
* README: Warn about the ads in the messages from the
......
......@@ -34,9 +34,9 @@
#include "layer.h"
#include "layer_pvt.h"
#include "libgimp/gimpmath.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimplimits.h"
#include "libgimp/gimpmath.h"
static ProcRecord image_list_proc;
static ProcRecord image_new_proc;
......@@ -3455,10 +3455,10 @@ image_set_resolution_invoker (Argument *args)
if (success)
{
if (ISNAN (xresolution) || xresolution < GIMP_MIN_RESOLUTION ||
ISINF (xresolution) || xresolution > GIMP_MAX_RESOLUTION ||
ISNAN (yresolution) || yresolution < GIMP_MIN_RESOLUTION ||
ISINF (yresolution) || yresolution > GIMP_MAX_RESOLUTION)
if (!FINITE (xresolution) ||
xresolution < GIMP_MIN_RESOLUTION || xresolution > GIMP_MAX_RESOLUTION ||
!FINITE (yresolution) ||
yresolution < GIMP_MIN_RESOLUTION || yresolution > GIMP_MAX_RESOLUTION)
{
g_message (_("Image resolution is out of bounds,\n"
"using the default resolution instead."));
......
......@@ -81,11 +81,9 @@ extern "C" {
#define gimp_rad_to_deg(angle) ((angle) * 360.0 / (2.0 * G_PI))
#ifdef G_OS_WIN32
#define ISNAN(x) _isnan(x)
#define ISINF(x) (_fpclass(x) & (_FPCLASS_NINF | _FPCLASS_PINF))
#define FINITE(x) _finite(x)
#else
#define ISNAN(x) isnan(x)
#define ISINF(x) isinf(x)
#define FINITE(x) finite(x)
#endif
#ifdef __cplusplus
......
......@@ -1212,10 +1212,10 @@ HELP
$invoke{code} = <<'CODE';
{
if (ISNAN (xresolution) || xresolution < GIMP_MIN_RESOLUTION ||
ISINF (xresolution) || xresolution > GIMP_MAX_RESOLUTION ||
ISNAN (yresolution) || yresolution < GIMP_MIN_RESOLUTION ||
ISINF (yresolution) || yresolution > GIMP_MAX_RESOLUTION)
if (!FINITE (xresolution) ||
xresolution < GIMP_MIN_RESOLUTION || xresolution > GIMP_MAX_RESOLUTION ||
!FINITE (yresolution) ||
yresolution < GIMP_MIN_RESOLUTION || yresolution > GIMP_MAX_RESOLUTION)
{
g_message (_("Image resolution is out of bounds,\n"
"using the default resolution instead."));
......
......@@ -1212,10 +1212,10 @@ HELP
$invoke{code} = <<'CODE';
{
if (ISNAN (xresolution) || xresolution < GIMP_MIN_RESOLUTION ||
ISINF (xresolution) || xresolution > GIMP_MAX_RESOLUTION ||
ISNAN (yresolution) || yresolution < GIMP_MIN_RESOLUTION ||
ISINF (yresolution) || yresolution > GIMP_MAX_RESOLUTION)
if (!FINITE (xresolution) ||
xresolution < GIMP_MIN_RESOLUTION || xresolution > GIMP_MAX_RESOLUTION ||
!FINITE (yresolution) ||
yresolution < GIMP_MIN_RESOLUTION || yresolution > GIMP_MAX_RESOLUTION)
{
g_message (_("Image resolution is out of bounds,\n"
"using the default resolution instead."));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment