elementary/elm_win: Also check for potential NULL in other defines
authorStefan Schmidt <stefan@datenfreihafen.org>
Thu, 14 Jun 2012 15:56:42 +0000 (15:56 +0000)
committerStefan Schmidt <stefan@datenfreihafen.org>
Thu, 14 Jun 2012 15:56:42 +0000 (15:56 +0000)
Thanks to Daniel Willmann pointing them out to me. Actually I wonder
why we need all this define and undef for ENGINE_COMPARE. Will dig a
bit deeper into that and see if we may can go with a single one.

SVN revision: 72144

src/lib/elm_win.c

index 147c6e1..7c2e5c8 100644 (file)
@@ -1270,7 +1270,7 @@ _elm_ee_xwin_get(const Ecore_Evas *ee)
    Ecore_X_Window xwin = 0;
 
    if (!ee) return 0;
-#define ENGINE_COMPARE(name) (!strcmp(_elm_preferred_engine, name))
+#define ENGINE_COMPARE(name) (_elm_preferred_engine && !strcmp(_elm_preferred_engine, name))
    if (ENGINE_COMPARE(ELM_SOFTWARE_X11))
      {
         if (ee) xwin = ecore_evas_software_x11_window_get(ee);
@@ -2619,7 +2619,7 @@ elm_win_fullscreen_set(Evas_Object *obj,
    ELM_WIN_CHECK(obj);
    ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
    // YYY: handle if sd->img_obj
-#define ENGINE_COMPARE(name) (!strcmp(_elm_preferred_engine, name))
+#define ENGINE_COMPARE(name) (_elm_preferred_engine && !strcmp(_elm_preferred_engine, name))
    if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
        ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
      {
@@ -2643,7 +2643,7 @@ elm_win_fullscreen_get(const Evas_Object *obj)
    ELM_WIN_CHECK(obj) EINA_FALSE;
    ELM_WIN_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
 
-#define ENGINE_COMPARE(name) (!strcmp(_elm_preferred_engine, name))
+#define ENGINE_COMPARE(name) (_elm_preferred_engine && !strcmp(_elm_preferred_engine, name))
    if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
        ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
      {