changeset 1694:31f16da1052a

Fix warnings building with MinGW on Windows.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 02 May 2012 00:11:15 +0000
parents b2311922a4de
children 90d02916b878
files win/dw.c
diffstat 1 files changed, 21 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/win/dw.c	Tue May 01 23:25:20 2012 +0000
+++ b/win/dw.c	Wed May 02 00:11:15 2012 +0000
@@ -10114,13 +10114,17 @@
    {
       if(mult)
       {
-         *x *= ratiox;
-         *y *= ratioy;
+         if(x)
+            *x *= ratiox;
+         if(y)
+            *y *= ratioy;
       }
       else
       {
-         *x /= ratiox;
-         *y /= ratioy;
+         if(x)
+            *x /= ratiox;
+         if(y)
+            *y /= ratioy;
       }
    }
 }
@@ -10232,16 +10236,16 @@
 
    GetTextExtentPoint32(hdc, wtext, (int)_tcslen(wtext), &sz);
 
-#ifdef GDIPLUS
-   _convert_dpi(hdc, &(sz.cx), &(sz.cy), FALSE);
-#endif
-
    if(width)
       *width = sz.cx;
 
    if(height)
       *height = sz.cy;
 
+#ifdef GDIPLUS
+   _convert_dpi(hdc, width, height, FALSE);
+#endif
+
    SelectObject(hdc, oldFont);
    if(mustdelete)
       DeleteObject(hFont);
@@ -11708,7 +11712,7 @@
 {
     DWPrint *p = print;
     HPIXMAP pixmap;
-    int x, result = DW_ERROR_UNKNOWN;
+    int x, width, height, result = DW_ERROR_UNKNOWN;
     
     if(!p)
         return result;
@@ -11716,18 +11720,21 @@
     if (!(pixmap = calloc(1,sizeof(struct _hpixmap))))
         return result;
 
-    pixmap->width = GetDeviceCaps(p->pd.hDC, HORZRES); 
-    pixmap->height = GetDeviceCaps(p->pd.hDC, VERTRES);
-
-    pixmap->hbm = CreateCompatibleBitmap(p->pd.hDC, pixmap->width, pixmap->height);
+    width = GetDeviceCaps(p->pd.hDC, HORZRES); 
+    height = GetDeviceCaps(p->pd.hDC, VERTRES);
+
+    pixmap->hbm = CreateCompatibleBitmap(p->pd.hDC, width, height);
     pixmap->hdc = p->pd.hDC;
     pixmap->transcolor = DW_RGB_TRANSPARENT;
 
 #ifdef GDIPLUS
    /* Convert the size based on the DPI */
-   _convert_dpi(pixmap->hdc, &(pixmap->width), &(pixmap->height), FALSE);
+   _convert_dpi(pixmap->hdc, &width, &height, FALSE);
 #endif
 
+    pixmap->width = width;
+    pixmap->height = height;
+
     SelectObject(pixmap->hdc, pixmap->hbm);
 
     /* Start the job */