summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2017-08-13 23:21:39 +0200
committerCedric BAIL <cedric@osg.samsung.com>2017-08-14 10:16:59 -0700
commitc2abb9a946e7a847fcc2d953c9af9cf228871053 (patch)
treeab222d62c9dff27dddcae72cb6de16b406aff685
parent15108ecad0350f8d1852c57fd8baede532621778 (diff)
downloadefl-c2abb9a946e7a847fcc2d953c9af9cf228871053.tar.gz
ecore_evas: win32 module - fix possibly uninitialized variables
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/modules/ecore_evas/engines/win32/ecore_evas_win32.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c b/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
index 3b87959b1a..bdf0a485f7 100644
--- a/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
+++ b/src/modules/ecore_evas/engines/win32/ecore_evas_win32.c
@@ -920,7 +920,7 @@ _ecore_evas_win32_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj,
}
static void
-_ecore_evas_win32_object_cursor_unset(Ecore_Evas *ee)
+_ecore_evas_win32_object_cursor_unset(Ecore_Evas *ee EINA_UNUSED)
{
ecore_win32_cursor_show(EINA_TRUE);
}
@@ -1114,7 +1114,7 @@ _ecore_evas_win32_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int
{
Eina_Iterator *iter;
Ecore_Win32_Monitor *ewm;
- Ecore_Win32_Monitor *m;
+ Ecore_Win32_Monitor *m = NULL;
unsigned int dist;
int lx;
int ly;
@@ -1143,6 +1143,20 @@ _ecore_evas_win32_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int
}
eina_iterator_free(iter);
+ if (!m)
+ {
+ HDC dc;
+
+ if (x) *x = 0;
+ if (y) *y = 0;
+ dc = GetDC(NULL);
+ if (w) *w = GetDeviceCaps(dc, HORZRES);
+ if (h) *h = GetDeviceCaps(dc, VERTRES);
+ ReleaseDC(NULL, dc);
+
+ return;
+ }
+
if (x)
*x = m->desktop.x;
if (y)
@@ -1159,7 +1173,7 @@ _ecore_evas_win32_screen_dpi_get(const Ecore_Evas *ee, int *xdpi, int *ydpi)
Eina_Iterator *iter;
Ecore_Win32_Monitor *ewm;
unsigned int dist;
- int x_dpi;
+ int x_dpi = -1;
int y_dpi;
int lx;
int ly;
@@ -1189,6 +1203,16 @@ _ecore_evas_win32_screen_dpi_get(const Ecore_Evas *ee, int *xdpi, int *ydpi)
}
eina_iterator_free(iter);
+ if (x_dpi == -1)
+ {
+ HDC dc;
+
+ dc = GetDC(NULL);
+ x_dpi = GetDeviceCaps(dc, LOGPIXELSX);
+ y_dpi = GetDeviceCaps(dc, LOGPIXELSY);
+ ReleaseDC(NULL, dc);
+ }
+
if (xdpi)
*xdpi = x_dpi;
if (ydpi)