Fix CLAMP macro overwritten by glib headers
Fixes #188 When I moved the macro definition below all of the includes, I got the following compiler warning: /usr/include/glib-2.0/glib/gmacros.h:246:0: note: this is the location of the previous definition #define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) So, that's the macro definition that was being used whenever "CLAMP" was used. It's pretty obvious what went wrong.
This commit is contained in:
+3
-7
@@ -49,11 +49,6 @@
|
||||
#include "systemtime.h"
|
||||
#include "hooks.h"
|
||||
|
||||
|
||||
#define MIN(x,y) ((x) < (y) ? (x) : (y))
|
||||
#define MAX(x,y) ((x) > (y) ? (x) : (y))
|
||||
#define CLAMP(lo,x,up) (MAX((lo), MIN((x), (up))))
|
||||
|
||||
/* pause() is not defined on windows platform but is not needed either.
|
||||
Use a noop macro instead. */
|
||||
#ifdef __WIN32__
|
||||
@@ -97,6 +92,8 @@
|
||||
# include "location-corelocation.h"
|
||||
#endif
|
||||
|
||||
#undef CLAMP
|
||||
#define CLAMP(lo,mid,up) (((lo) > (mid)) ? (lo) : (((mid) < (up)) ? (mid) : (up)))
|
||||
|
||||
/* Union of state data for gamma adjustment methods */
|
||||
typedef union {
|
||||
@@ -978,8 +975,7 @@ run_continual_mode(const location_t *loc,
|
||||
}
|
||||
|
||||
/* Clamp alpha value */
|
||||
adjustment_alpha =
|
||||
MAX(0.0, MIN(adjustment_alpha, 1.0));
|
||||
adjustment_alpha = CLAMP(0.0, adjustment_alpha, 1.0);
|
||||
}
|
||||
|
||||
/* Interpolate between 6500K and calculated
|
||||
|
||||
Reference in New Issue
Block a user