changeset 1532:6c55d68fd08a

Fixed some warnings building with MinGW.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 07 Jan 2012 22:59:39 +0000
parents 783a464afab2
children 7bc189ef0cd0
files makefile.mingw win/dw.c
diffstat 2 files changed, 24 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/makefile.mingw	Sat Jan 07 13:59:58 2012 +0000
+++ b/makefile.mingw	Sat Jan 07 22:59:39 2012 +0000
@@ -9,7 +9,7 @@
 DEFS =
 LIBS =
 
-CFLAGS = -O -g -DMSVC -DWIN32 -D__WIN32__ -DGDIPLUS -DBUILD_DLL -I./win -I. -I./platform -Wall -mthreads -o $(@)
+CFLAGS = -O -g -DMSVC -DWIN32 -D__WIN32__ -DGDIPLUS -DISOLATION_AWARE_ENABLED=1 -DBUILD_DLL -I./win -I. -I./platform -Wall -mthreads -o $(@)
 LDFLAGS = -shared -mwindows -mthreads -lcomctl32 -lole32 -loleaut32 -luserenv -lmsimg32 -lgdiplus
 
 COMPATOBJECTS = compat.o dirent.o
--- a/win/dw.c	Sat Jan 07 13:59:58 2012 +0000
+++ b/win/dw.c	Sat Jan 07 22:59:39 2012 +0000
@@ -662,7 +662,8 @@
 
    if(thiscinfo)
    {
-      SubclassWindow(handle, thiscinfo->pOldProc);
+      if(thiscinfo->pOldProc)
+         SetWindowLongPtr(handle, GWLP_WNDPROC, (LPARAM)(WNDPROC)thiscinfo->pOldProc);
 
       /* Delete the brush so as not to leak GDI objects */
       if(thiscinfo->hbrush)
@@ -780,7 +781,7 @@
 {
    int z;
    static HWND lasthwnd, firsthwnd;
-    static int finish_searching;
+   static int finish_searching;
 
    /* Start is 2 when we have cycled completely and
     * need to set the focus to the last widget we found
@@ -915,7 +916,7 @@
 {
    int z;
    static HWND lasthwnd, firsthwnd;
-    static int finish_searching;
+   static int finish_searching;
 
    /* Start is 2 when we have cycled completely and
     * need to set the focus to the last widget we found
@@ -5382,7 +5383,7 @@
       return NULL;
    }
 
-   cinfo->cinfo.pOldProc = (WNDPROC)SubclassWindow(tmp, _containerwndproc);
+   cinfo->cinfo.pOldProc = SubclassWindow(tmp, _containerwndproc);
    cinfo->cinfo.fore = cinfo->cinfo.back = -1;
    cinfo->odd = cinfo->even = DW_RGB_TRANSPARENT;
 
@@ -5425,7 +5426,7 @@
       return NULL;
    }
 
-   cinfo->cinfo.pOldProc = (WNDPROC)SubclassWindow(tmp, _treewndproc);
+   cinfo->cinfo.pOldProc = SubclassWindow(tmp, _treewndproc);
    cinfo->cinfo.fore = cinfo->cinfo.back = -1;
    cinfo->odd = cinfo->even = DW_RGB_TRANSPARENT;
 
@@ -5535,7 +5536,7 @@
       return NULL;
    }
 
-   cinfo->cinfo.pOldProc = (WNDPROC)SubclassWindow(tmp, _treewndproc);
+   cinfo->cinfo.pOldProc = SubclassWindow(tmp, _treewndproc);
    cinfo->cinfo.fore = cinfo->cinfo.back = -1;
    cinfo->odd = cinfo->even = DW_RGB_TRANSPARENT;
 
@@ -5609,7 +5610,7 @@
    if(cinfo)
    {
       cinfo->buddy = handle;
-      cinfo->pOldProc = (WNDPROC)SubclassWindow(handle, _colorwndproc);
+      cinfo->pOldProc = SubclassWindow(handle, _colorwndproc);
       SetWindowLongPtr(handle, GWLP_USERDATA, (LONG_PTR)cinfo);
    }
    return FALSE;
@@ -5677,7 +5678,7 @@
                      DWInstance,
                      NULL);
    cinfo->fore = cinfo->back = -1;
-   cinfo->pOldProc = (WNDPROC)SubclassWindow(tmp, _BtProc);
+   cinfo->pOldProc = SubclassWindow(tmp, _BtProc);
 
    SetWindowLongPtr(tmp, GWLP_USERDATA, (LONG_PTR)cinfo);
    dw_window_set_font(tmp, DefaultFont);
@@ -5709,7 +5710,7 @@
                   NULL);
 
    cinfo->fore = cinfo->back = -1;
-   cinfo->pOldProc = (WNDPROC)SubclassWindow(tmp, _BtProc);
+   cinfo->pOldProc = SubclassWindow(tmp, _BtProc);
 
    SetWindowLongPtr(tmp, GWLP_USERDATA, (LONG_PTR)cinfo);
 
@@ -5768,7 +5769,7 @@
                        NULL);
 
    cinfo->fore = cinfo->back = -1;
-   cinfo->pOldProc = (WNDPROC)SubclassWindow(tmp, _BtProc);
+   cinfo->pOldProc = SubclassWindow(tmp, _BtProc);
 
    SetWindowLongPtr(tmp, GWLP_USERDATA, (LONG_PTR)cinfo);
 
@@ -5852,7 +5853,7 @@
                        NULL );
 
    cinfo->fore = cinfo->back = -1;
-   cinfo->pOldProc = (WNDPROC)SubclassWindow( tmp, _BtProc );
+   cinfo->pOldProc = SubclassWindow( tmp, _BtProc );
 
    SetWindowLongPtr( tmp, GWLP_USERDATA, (LONG_PTR)cinfo );
 
@@ -5943,7 +5944,7 @@
                      NULL);
    ColorInfo *cinfo = calloc(1, sizeof(ColorInfo));
    cinfo->fore = cinfo->back = -1;
-   cinfo->pOldProc = (WNDPROC)SubclassWindow(tmp, _BtProc);
+   cinfo->pOldProc = SubclassWindow(tmp, _BtProc);
    SetWindowLongPtr(tmp, GWLP_USERDATA, (LONG_PTR)cinfo);
    dw_window_set_font(tmp, DefaultFont);
    dw_window_set_color(tmp, DW_CLR_DEFAULT, DW_RGB_TRANSPARENT);
@@ -6042,7 +6043,7 @@
                      (HMENU)id,
                      DWInstance,
                      NULL);
-   cinfo->pOldProc = (WNDPROC)SubclassWindow(tmp, _BtProc);
+   cinfo->pOldProc = SubclassWindow(tmp, _BtProc);
    SetWindowLongPtr(tmp, GWLP_USERDATA, (LONG_PTR)cinfo);
    dw_window_set_data(tmp, "_dw_checkbox", DW_INT_TO_POINTER(1));
    dw_window_set_font(tmp, DefaultFont);
@@ -6080,7 +6081,7 @@
 
    cinfo->cinfo.fore = cinfo->cinfo.back = -1;
    cinfo->odd = cinfo->even = DW_RGB_TRANSPARENT;
-   cinfo->cinfo.pOldProc = (WNDPROC)SubclassWindow(tmp, _containerwndproc);
+   cinfo->cinfo.pOldProc = SubclassWindow(tmp, _containerwndproc);
 
    SetWindowLongPtr(tmp, GWLP_USERDATA, (LONG_PTR)cinfo);
    dw_window_set_font(tmp, DefaultFont);
@@ -8378,6 +8379,7 @@
 {
    int z;
    static HWND lasthwnd = NULL;
+   HIMAGELIST himl;
 
    /* We can't add an invalid handle */
    if(!hicon)
@@ -8397,12 +8399,12 @@
          ImageList_AddIcon(hLarge, hicon);
          if(type)
          {
-            TreeView_SetImageList(handle, hSmall, TVSIL_NORMAL);
+            himl = TreeView_SetImageList(handle, hSmall, TVSIL_NORMAL);
          }
          else
          {
-            ListView_SetImageList(handle, hSmall, LVSIL_SMALL);
-            ListView_SetImageList(handle, hLarge, LVSIL_NORMAL);
+            himl = ListView_SetImageList(handle, hSmall, LVSIL_SMALL);
+            himl = ListView_SetImageList(handle, hLarge, LVSIL_NORMAL);
          }
          lasthwnd = handle;
          return z;
@@ -8414,14 +8416,14 @@
          {
             if(type)
             {
-               TreeView_SetImageList(handle, hSmall, TVSIL_NORMAL);
+               himl = TreeView_SetImageList(handle, hSmall, TVSIL_NORMAL);
             }
             else
             {
-               ListView_SetImageList(handle, hSmall, LVSIL_SMALL);
-               ListView_SetImageList(handle, hLarge, LVSIL_NORMAL);
+               himl = ListView_SetImageList(handle, hSmall, LVSIL_SMALL);
+               himl = ListView_SetImageList(handle, hLarge, LVSIL_NORMAL);
             }
-                lasthwnd = handle;
+            lasthwnd = handle;
          }
          return z;
       }