[ros-diffs] [tkreuzer] 55498: [SHELL32] Fix 64 bit MSVC build, fix some warnings

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Wed Feb 8 21:38:59 UTC 2012


Author: tkreuzer
Date: Wed Feb  8 21:38:53 2012
New Revision: 55498

URL: http://svn.reactos.org/svn/reactos?rev=55498&view=rev
Log:
[SHELL32]
Fix 64 bit MSVC build, fix some warnings

Modified:
    trunk/reactos/dll/win32/shell32/drvdefext.cpp
    trunk/reactos/dll/win32/shell32/shellole.cpp
    trunk/reactos/include/psdk/shlobj.h

Modified: trunk/reactos/dll/win32/shell32/drvdefext.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/drvdefext.cpp?rev=55498&r1=55497&r2=55498&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/drvdefext.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/drvdefext.cpp [iso-8859-1] Wed Feb  8 21:38:53 2012
@@ -44,7 +44,8 @@
 static VOID
 GetDriveNameWithLetter(LPWSTR pwszText, UINT cchTextMax, LPCWSTR pwszDrive)
 {
-    DWORD dwMaxComp, dwFileSys, cchText = 0;
+    DWORD dwMaxComp, dwFileSys;
+    SIZE_T cchText = 0;
 
     if (GetVolumeInformationW(pwszDrive, pwszText, cchTextMax, NULL, &dwMaxComp, &dwFileSys, NULL, 0))
     {
@@ -219,8 +220,8 @@
         TRACE("FreeSpace %u a %f cx %d\n", m_FreeSpacePerc, M_PI+m_FreeSpacePerc/100.0f*M_PI*2.0f, cx);
 
         HBRUSH hbrOld = (HBRUSH)SelectObject(pDrawItem->hDC, hMagBrush);
-        INT xRadial = xCenter + (INT)(cosf(M_PI+m_FreeSpacePerc/100.0f*M_PI*2.0f)*cx/2);
-        INT yRadial = yCenter - (INT)(sinf(M_PI+m_FreeSpacePerc/100.0f*M_PI*2.0f)*cy/2);
+        INT xRadial = xCenter + (INT)(cos(M_PI+m_FreeSpacePerc/100.0f*M_PI*2.0f)*cx/2);
+        INT yRadial = yCenter - (INT)(sin(M_PI+m_FreeSpacePerc/100.0f*M_PI*2.0f)*cy/2);
         Pie(pDrawItem->hDC,
             pDrawItem->rcItem.left, pDrawItem->rcItem.top,
             pDrawItem->rcItem.right, pDrawItem->rcItem.bottom - 10,
@@ -241,8 +242,8 @@
             if (m_FreeSpacePerc < 50 && x == xRadial)
                 SelectObject(pDrawItem->hDC, hDarkMagPen);
 
-            float cos_val = (x - xCenter)*2.0f/cx;
-            INT y = yCenter+sinf(acosf(cos_val))*cy/2;
+            double cos_val = (x - xCenter)*2.0f/cx;
+            INT y = yCenter+(INT)sin(acos(cos_val))*cy/2;
             MoveToEx(pDrawItem->hDC, x, y, NULL);
             LineTo(pDrawItem->hDC, x, y + 10);
         }
@@ -390,7 +391,7 @@
             {
                 /* Property Sheet */
                 LPPSHNOTIFY lppsn = (LPPSHNOTIFY)lParam;
-                
+
                 if (lppsn->hdr.code == PSN_APPLY)
                 {
                     CDrvDefExt *pDrvDefExt = (CDrvDefExt*)GetWindowLongPtr(hwndDlg, DWLP_USER);
@@ -505,7 +506,7 @@
 
 CDrvDefExt::~CDrvDefExt()
 {
-    
+
 }
 
 HRESULT WINAPI

Modified: trunk/reactos/dll/win32/shell32/shellole.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shellole.cpp?rev=55498&r1=55497&r2=55498&view=diff
==============================================================================
--- trunk/reactos/dll/win32/shell32/shellole.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/shellole.cpp [iso-8859-1] Wed Feb  8 21:38:53 2012
@@ -248,7 +248,7 @@
  * SEE ALSO
  *     CoTaskMemAlloc, SHLoadOLE
  */
-LPVOID WINAPI SHAlloc(DWORD len)
+LPVOID WINAPI SHAlloc(SIZE_T len)
 {
     LPVOID ret;
 
@@ -596,7 +596,7 @@
         grfFlags, grfMode, dwDisposition, ppstg, puCodePage);
 
     hres = psstg->Open(fmtid, grfMode, ppstg);
- 
+
      switch (dwDisposition)
      {
          case CREATE_ALWAYS:
@@ -608,16 +608,16 @@
                      return hres;
                  hres = E_FAIL;
              }
- 
+
          case OPEN_ALWAYS:
          case CREATE_NEW:
              if (FAILED(hres))
                  hres = psstg->Create(fmtid, pclsid, grfFlags, grfMode, ppstg);
- 
+
          case OPEN_EXISTING:
              if (FAILED(hres))
                  return hres;
- 
+
              if (puCodePage)
              {
                  prop.ulKind = PRSPEC_PROPID;
@@ -629,7 +629,7 @@
                      *puCodePage = ret.iVal;
              }
      }
- 
+
      return S_OK;
 }
 
@@ -641,32 +641,32 @@
 {
     STATPROPSETSTG stat;
     HRESULT hres;
- 
+
     FIXME("%p %u %u %p %p\n", pps, uCodePage, cpspec, rgpspec, rgvar);
- 
+
     memset(rgvar, 0, cpspec*sizeof(PROPVARIANT));
     hres = pps->ReadMultiple(cpspec, rgpspec, rgvar);
     if (FAILED(hres))
         return hres;
- 
+
     if (!uCodePage)
     {
         PROPSPEC prop;
         PROPVARIANT ret;
- 
+
         prop.ulKind = PRSPEC_PROPID;
         prop.propid = PID_CODEPAGE;
         hres = pps->ReadMultiple(1, &prop, &ret);
         if(FAILED(hres) || ret.vt!=VT_I2)
             return S_OK;
- 
+
         uCodePage = ret.iVal;
     }
- 
+
     hres = pps->Stat(&stat);
     if (FAILED(hres))
         return S_OK;
- 
+
     /* TODO: do something with codepage and stat */
     return S_OK;
 }
@@ -680,20 +680,20 @@
     STATPROPSETSTG stat;
     UINT codepage;
     HRESULT hres;
- 
+
     FIXME("%p %p %u %p %p %d\n", pps, uCodePage, cpspec, rgpspec, rgvar, propidNameFirst);
- 
+
     hres = pps->Stat(&stat);
     if (FAILED(hres))
         return hres;
- 
+
     if (uCodePage && *uCodePage)
         codepage = *uCodePage;
     else
     {
         PROPSPEC prop;
         PROPVARIANT ret;
- 
+
         prop.ulKind = PRSPEC_PROPID;
         prop.propid = PID_CODEPAGE;
         hres = pps->ReadMultiple(1, &prop, &ret);
@@ -701,14 +701,14 @@
             return hres;
         if (ret.vt!=VT_I2 || !ret.iVal)
             return E_FAIL;
- 
+
         codepage = ret.iVal;
         if (uCodePage)
             *uCodePage = codepage;
     }
- 
+
     /* TODO: do something with codepage and stat */
- 
+
     hres = pps->WriteMultiple(cpspec, rgpspec, rgvar, propidNameFirst);
     return hres;
 }

Modified: trunk/reactos/include/psdk/shlobj.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/shlobj.h?rev=55498&r1=55497&r2=55498&view=diff
==============================================================================
--- trunk/reactos/include/psdk/shlobj.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/shlobj.h [iso-8859-1] Wed Feb  8 21:38:53 2012
@@ -82,7 +82,7 @@
 #endif
 
 UINT         WINAPI SHAddFromPropSheetExtArray(HPSXA,LPFNADDPROPSHEETPAGE,LPARAM);
-LPVOID       WINAPI SHAlloc(ULONG) __WINE_ALLOC_SIZE(1);
+LPVOID       WINAPI SHAlloc(SIZE_T) __WINE_ALLOC_SIZE(1);
 HRESULT      WINAPI SHCoCreateInstance(LPCWSTR,const CLSID*,IUnknown*,REFIID,LPVOID*);
 HPSXA        WINAPI SHCreatePropSheetExtArray(HKEY,LPCWSTR,UINT);
 HPSXA        WINAPI SHCreatePropSheetExtArrayEx(HKEY,LPCWSTR,UINT,IDataObject*);
@@ -1812,7 +1812,7 @@
  * SHOpenWithDialog
  */
 
-enum tagOPEN_AS_INFO_FLAGS 
+enum tagOPEN_AS_INFO_FLAGS
 {
 	OAIF_ALLOW_REGISTRATION = 1,
 	OAIF_REGISTER_EXT       = 2,
@@ -1871,14 +1871,14 @@
  * Travel log
  */
 
-#define TLOG_BACK  -1 
-#define TLOG_FORE   1 
-
-#define TLMENUF_INCLUDECURRENT      0x00000001 
-#define TLMENUF_CHECKCURRENT        (TLMENUF_INCLUDECURRENT | 0x00000002) 
-#define TLMENUF_BACK                0x00000010  // Default 
-#define TLMENUF_FORE                0x00000020 
-#define TLMENUF_BACKANDFORTH        (TLMENUF_BACK | TLMENUF_FORE | TLMENUF_INCLUDECURRENT) 
+#define TLOG_BACK  -1
+#define TLOG_FORE   1
+
+#define TLMENUF_INCLUDECURRENT      0x00000001
+#define TLMENUF_CHECKCURRENT        (TLMENUF_INCLUDECURRENT | 0x00000002)
+#define TLMENUF_BACK                0x00000010  // Default
+#define TLMENUF_FORE                0x00000020
+#define TLMENUF_BACKANDFORTH        (TLMENUF_BACK | TLMENUF_FORE | TLMENUF_INCLUDECURRENT)
 
 /*****************************************************************************
  * IDockingWindowSite interface




More information about the Ros-diffs mailing list