From 0c4880e99dd047dc92abb0ea6a04febb91908aef Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Mon, 9 May 2016 16:58:31 -0700 Subject: [PATCH] efl: everyone should now rely on Eina MIN/MAX redefinition. --- src/examples/evas/shooter/evas-3d-shooter-macros.h | 3 --- src/lib/ecore/ecore_private.h | 8 -------- src/lib/ecore_win32/ecore_win32_private.h | 10 ---------- src/lib/ecore_x/xcb/ecore_xcb_dnd.c | 4 ---- src/lib/ecore_x/xcb/ecore_xcb_private.h | 8 -------- src/lib/edje/edje_private.h | 4 ---- src/lib/eet/eet_image.c | 6 ------ src/lib/eina/eina_private.h | 8 -------- src/lib/eina/eina_str.c | 2 +- src/lib/eina/eina_tiler.c | 1 + src/lib/elementary/elm_priv.h | 4 ---- src/lib/evas/canvas/render2/region.c | 7 ------- src/lib/evas/include/evas_macros.h | 6 ------ .../evas/image_loaders/gif/evas_image_load_gif.c | 3 --- src/static_libs/rg_etc/rg_etc1.c | 8 ++++++-- src/static_libs/rg_etc/rg_etc2.c | 4 +++- 16 files changed, 11 insertions(+), 75 deletions(-) diff --git a/src/examples/evas/shooter/evas-3d-shooter-macros.h b/src/examples/evas/shooter/evas-3d-shooter-macros.h index ce23acf851..d7f21860da 100644 --- a/src/examples/evas/shooter/evas-3d-shooter-macros.h +++ b/src/examples/evas/shooter/evas-3d-shooter-macros.h @@ -1,6 +1,3 @@ -#define MAX(x, y) (((x) > (y)) ? (x) : (y)) -#define MIN(x, y) (((x) < (y)) ? (x) : (y)) - #define FOG_COLOR 0.5, 0.5, 0.5 #define FOG_FACTOR 0.01 #define WIDTH 1920 diff --git a/src/lib/ecore/ecore_private.h b/src/lib/ecore/ecore_private.h index c95a4d94f0..062c8a2ef9 100644 --- a/src/lib/ecore/ecore_private.h +++ b/src/lib/ecore/ecore_private.h @@ -69,14 +69,6 @@ extern int _ecore_log_dom; # define PATH_MAX 4096 #endif -#ifndef MIN -# define MIN(x, y) (((x) > (y)) ? (y) : (x)) -#endif - -#ifndef MAX -# define MAX(x, y) (((x) > (y)) ? (x) : (y)) -#endif - #ifndef ABS # define ABS(x) ((x) < 0 ? -(x) : (x)) #endif diff --git a/src/lib/ecore_win32/ecore_win32_private.h b/src/lib/ecore_win32/ecore_win32_private.h index b5a805adde..c90674f2f1 100644 --- a/src/lib/ecore_win32/ecore_win32_private.h +++ b/src/lib/ecore_win32/ecore_win32_private.h @@ -6,16 +6,6 @@ extern "C" { #endif -#ifdef MIN -# undef MIN -#endif -#define MIN(a,b) (((a) < (b)) ? (a) : (b)) - -#ifdef MAX -# undef MAX -#endif -#define MAX(a,b) (((a) < (b)) ? (b) : (a)) - /* logging messages macros */ extern int _ecore_win32_log_dom_global; diff --git a/src/lib/ecore_x/xcb/ecore_xcb_dnd.c b/src/lib/ecore_x/xcb/ecore_xcb_dnd.c index 07eae1f22a..974ec0e4b2 100644 --- a/src/lib/ecore_x/xcb/ecore_xcb_dnd.c +++ b/src/lib/ecore_x/xcb/ecore_xcb_dnd.c @@ -1,9 +1,5 @@ #include "ecore_xcb_private.h" -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - /* local structures */ typedef struct _Version_Cache_Item { diff --git a/src/lib/ecore_x/xcb/ecore_xcb_private.h b/src/lib/ecore_x/xcb/ecore_xcb_private.h index 61452f2385..d6bb743934 100644 --- a/src/lib/ecore_x/xcb/ecore_xcb_private.h +++ b/src/lib/ecore_x/xcb/ecore_xcb_private.h @@ -73,14 +73,6 @@ extern int _ecore_xcb_log_dom; # define MAXHOSTNAMELEN 256 # endif -# ifndef MIN -# define MIN(x, y) (((x) > (y)) ? (y) : (x)) -# endif - -# ifndef MAX -# define MAX(a, b) ((a < b) ? b : a) -# endif - #define CHECK_XCB_CONN \ { \ if (xcb_connection_has_error(_ecore_xcb_conn)) \ diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h index 92148e8d50..5bfecbc845 100644 --- a/src/lib/edje/edje_private.h +++ b/src/lib/edje/edje_private.h @@ -130,10 +130,6 @@ EAPI extern int _edje_default_log_dom ; #define CLAMP(x, min, max) (((x) > (max)) ? (max) : (((x) < (min)) ? (min) : (x))) #endif -#ifndef MIN -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - #ifdef BUILD_EDJE_FP diff --git a/src/lib/eet/eet_image.c b/src/lib/eet/eet_image.c index 557892570b..ba43c20622 100644 --- a/src/lib/eet/eet_image.c +++ b/src/lib/eet/eet_image.c @@ -54,12 +54,6 @@ #define OFFSET_HEIGHT 12 #define OFFSET_BLOCKS 16 -#undef MIN -#define MIN(x, y) (((x) < (y)) ? (x) : (y)) - -#undef MAX -#define MAX(x, y) (((x) > (y)) ? (x) : (y)) - /*---*/ typedef struct _JPEG_error_mgr *emptr; diff --git a/src/lib/eina/eina_private.h b/src/lib/eina/eina_private.h index c51d35fae9..810e4b26e5 100644 --- a/src/lib/eina/eina_private.h +++ b/src/lib/eina/eina_private.h @@ -25,14 +25,6 @@ #include "eina_iterator.h" #include "eina_accessor.h" -#ifndef MIN -# define MIN(x, y) (((x) > (y)) ? (y) : (x)) -#endif - -#ifndef MAX -# define MAX(x, y) (((x) > (y)) ? (x) : (y)) -#endif - #ifndef ABS # define ABS(x) ((x) < 0 ? -(x) : (x)) #endif diff --git a/src/lib/eina/eina_str.c b/src/lib/eina/eina_str.c index 837d61bb70..dcf93c3ca4 100644 --- a/src/lib/eina/eina_str.c +++ b/src/lib/eina/eina_str.c @@ -35,7 +35,7 @@ #include "eina_private.h" #include "eina_str.h" - +#include "eina_cpu.h" /*============================================================================* * Local * diff --git a/src/lib/eina/eina_tiler.c b/src/lib/eina/eina_tiler.c index 5661a1b782..e8abcdc97b 100644 --- a/src/lib/eina/eina_tiler.c +++ b/src/lib/eina/eina_tiler.c @@ -33,6 +33,7 @@ #include "eina_config.h" #include "eina_private.h" #include "eina_tiler.h" +#include "eina_cpu.h" /*============================================================================* * Local * diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h index 101f398b14..90789bb7d9 100644 --- a/src/lib/elementary/elm_priv.h +++ b/src/lib/elementary/elm_priv.h @@ -169,10 +169,6 @@ extern const char *_elm_engines[]; #define ELM_ATSPI_MODE_ON EINA_TRUE /* convenience macro to compress code and avoid typos */ -#undef MIN -#define MIN(x, y) (((x) < (y)) ? (x) : (y)) -#undef MAX -#define MAX(x, y) (((x) > (y)) ? (x) : (y)) #undef CEIL #define CEIL(a) (((a) % 2 != 0) ? ((a) / 2 + 1) : ((a) / 2)) #undef IS_INSIDE diff --git a/src/lib/evas/canvas/render2/region.c b/src/lib/evas/canvas/render2/region.c index 286df409f1..d6974e3b91 100644 --- a/src/lib/evas/canvas/render2/region.c +++ b/src/lib/evas/canvas/render2/region.c @@ -84,13 +84,6 @@ struct _Region #define PIXREGION_END(reg) PIXREGION_BOX(reg, (reg)->data->num - 1) #define PIXREGION_SZOF(n) (sizeof(Region_Data) + ((n) * sizeof(Box))) -#ifndef MIN -# define MIN(a, b) ((a) < (b) ? (a) : (b)) -#endif -#ifndef MAX -# define MAX(a, b) ((a) > (b) ? (a) : (b)) -#endif - // r1 and r2 overlap #define OVERLAP(r1, r2) \ (!(((r1)->x2 <= (r2)->x1) || ((r1)->x1 >= (r2)->x2) || \ diff --git a/src/lib/evas/include/evas_macros.h b/src/lib/evas/include/evas_macros.h index c3bc339de5..1deefb88d0 100644 --- a/src/lib/evas/include/evas_macros.h +++ b/src/lib/evas/include/evas_macros.h @@ -7,12 +7,6 @@ #undef SGN #define SGN(x) (((x) < 0) ? -1 : 1) -#undef MIN -#define MIN(x, y) (((x) < (y)) ? (x) : (y)) - -#undef MAX -#define MAX(x, y) (((x) > (y)) ? (x) : (y)) - /* clamp b between a and c */ #undef CLAMP #define CLAMP(a,b,c) MIN(MAX((b),(a)),(c)) diff --git a/src/modules/evas/image_loaders/gif/evas_image_load_gif.c b/src/modules/evas/image_loaders/gif/evas_image_load_gif.c index ac403522f8..f20b8ccaad 100644 --- a/src/modules/evas/image_loaders/gif/evas_image_load_gif.c +++ b/src/modules/evas/image_loaders/gif/evas_image_load_gif.c @@ -37,9 +37,6 @@ struct _Frame_Info Eina_Bool interlace : 1; // interlaced or not }; -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif #define LOADERR(x) \ do { \ *error = (x); \ diff --git a/src/static_libs/rg_etc/rg_etc1.c b/src/static_libs/rg_etc/rg_etc1.c index 866316793c..cff0094e03 100644 --- a/src/static_libs/rg_etc/rg_etc1.c +++ b/src/static_libs/rg_etc/rg_etc1.c @@ -33,8 +33,12 @@ typedef unsigned int uint; typedef unsigned int uint32; typedef unsigned char DATA8; -#define MIN(A, B) ((A < B) ? A : B) -#define MAX(A, B) ((A > B) ? A : B) +#ifndef MIN +# define MIN(A, B) ((A < B) ? A : B) +#endif +#ifndef MAX +# define MAX(A, B) ((A > B) ? A : B) +#endif #define CLAMP(Value, Low, High) ((Value < Low) ? Low : ((Value > High) ? High : Value)) #define SQUARE(Value) (Value * Value) diff --git a/src/static_libs/rg_etc/rg_etc2.c b/src/static_libs/rg_etc/rg_etc2.c index c0c22ea61a..e8a465fc21 100644 --- a/src/static_libs/rg_etc/rg_etc2.c +++ b/src/static_libs/rg_etc/rg_etc2.c @@ -92,7 +92,9 @@ static const int kAlphaModifiers[16][8] = { #define CLAMP(a) ({ int _b = (a); (((_b) >= 0) ? (((_b) < 256) ? (_b) : 255) : 0); }) // Simple min -#define MIN(a,b) ({ int _z = (a), _y = (b); ((_z <= _y) ? _z : _y); }) +#ifndef MIN +# define MIN(a,b) ({ int _z = (a), _y = (b); ((_z <= _y) ? _z : _y); }) +#endif // Write a BGRA value for output to Evas #define BGRA(r,g,b,a) ((a << 24) | (r << 16) | (g << 8) | b)