[gegl] Revert "operations: Increase exp-combine.c portability"



commit 6e1e5e1f7dba75c4f5dcd7eefdfa313e40c2d24e
Author: Martin Nordholts <martinn src gnome org>
Date:   Sat Oct 2 22:20:00 2010 +0200

    Revert "operations: Increase exp-combine.c portability"
    
    This reverts commit 033f9d5d567edd703239a226b7afcf53704aa19d.
    Older GNU GCC works if you pass --std=gnu99. And keeping usage of some
    C99 can help detect C99 issues on other platforms...

 operations/common/exp-combine.c |   20 ++++++++------------
 1 files changed, 8 insertions(+), 12 deletions(-)
---
diff --git a/operations/common/exp-combine.c b/operations/common/exp-combine.c
index 3f44bc5..0db4367 100644
--- a/operations/common/exp-combine.c
+++ b/operations/common/exp-combine.c
@@ -36,8 +36,6 @@ gegl_chant_double (sigma, _("Weight Sigma"),
 /*#define DEBUG_LINEARIZE*/
 /*#define DEBUG_SAVE_CURVES*/
 
-static float GEGL_NAN;
-
 #include <gegl-plugin.h>
 struct _GeglChant
 {
@@ -148,7 +146,7 @@ gegl_expcombine_new_exposure (void)
   e->hi = e->lo = e;
 
   memset (e->pixels, 0, sizeof (e->pixels));
-  e->ti = GEGL_NAN;
+  e->ti = NAN;
 
   return e;
 }
@@ -261,8 +259,8 @@ gegl_expcombine_normalize (gfloat *response,
   guint  i;
   gfloat val_mid;
 
-  g_return_val_if_fail (response, GEGL_NAN);
-  g_return_val_if_fail (steps > 0, GEGL_NAN);
+  g_return_val_if_fail (response, NAN);
+  g_return_val_if_fail (steps > 0, NAN);
 
   /* Find the first and last non-zero values in response curve */
   for (step_min = 0;
@@ -274,7 +272,7 @@ gegl_expcombine_normalize (gfloat *response,
        --step_max)
     ;
 
-  g_return_val_if_fail (step_max >= step_min, GEGL_NAN);
+  g_return_val_if_fail (step_max >= step_min, NAN);
   step_mid = step_min + (step_max - step_min) / 2;
 
   /* Find the non-zero mid-value of the response curve */
@@ -414,7 +412,7 @@ gegl_expcombine_apply_debevec  (gfloat              *hdr,
               white_step[1] = step[1];
               white_step[2] = step[2];
               /* TODO: This is not an fminf in luminance. Should it be? */
-              /* ti_min        = MIN (exp_i->ti, ti_min); */
+              /* ti_min        = fminf (exp_i->ti, ti_min); */
               continue;
             }
 
@@ -426,7 +424,7 @@ gegl_expcombine_apply_debevec  (gfloat              *hdr,
               black_step[1] = step[1];
               black_step[2] = step[2];
               /* TODO: This is not an fminf in luminance. Should it be? */
-              /* ti_max        = MAX (exp_i->ti, ti_max); */
+              /* ti_max        = fmaxf (exp_i->ti, ti_max); */
               continue;
             }
 
@@ -569,9 +567,9 @@ gegl_expcombine_apply_response (gfloat              *hdr,
            * present
            */
           if (step > step_max)
-              ti_min = MIN (ti_min, exp_i->ti);
+              ti_min = fminf (ti_min, exp_i->ti);
           if (step < step_min)
-              ti_max = MAX (ti_max, exp_i->ti);
+              ti_max = fmaxf (ti_max, exp_i->ti);
 
           /* anti ghosting: monotonous increase in time should result in
            * monotonous increase in intensity; make forward and backward check,
@@ -1276,8 +1274,6 @@ gegl_chant_class_init (GeglChantClass *klass)
   GObjectClass             *object_class;
   GeglOperationClass       *operation_class;
 
-  GEGL_NAN = sqrt(-1);
-
   object_class    = G_OBJECT_CLASS (klass);
   operation_class = GEGL_OPERATION_CLASS (klass);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]