From: Cedric BAIL Date: Mon, 9 May 2016 23:58:31 +0000 (-0700) Subject: efl: everyone should now rely on Eina MIN/MAX redefinition. X-Git-Tag: upstream/1.20.0~6419 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0c4880e99dd047dc92abb0ea6a04febb91908aef;p=platform%2Fupstream%2Fefl.git efl: everyone should now rely on Eina MIN/MAX redefinition. --- diff --git a/src/examples/evas/shooter/evas-3d-shooter-macros.h b/src/examples/evas/shooter/evas-3d-shooter-macros.h index ce23acf..d7f2186 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 c95a4d9..062c8a2 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 b5a805a..c90674f 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 07eae1f..974ec0e 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 61452f2..d6bb743 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 92148e8..5bfecbc 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 5578925..ba43c20 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 c51d35f..810e4b2 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 837d61b..dcf93c3 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 5661a1b..e8abcdc 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 101f398..90789bb 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 286df40..d6974e3 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 c3bc339..1deefb8 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 ac40352..f20b8cc 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 8663167..cff0094 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 c0c22ea..e8a465f 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)