]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied patch [ 1195797 ] Fixes to compile on Win64
authorJulian Smart <julian@anthemion.co.uk>
Sun, 22 May 2005 12:10:55 +0000 (12:10 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sun, 22 May 2005 12:10:55 +0000 (12:10 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34241 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/arrimpl.cpp
include/wx/hashmap.h
include/wx/listbase.h
src/msw/dlmsw.cpp
src/msw/filedlg.cpp
src/msw/mediactrl.cpp
src/msw/timer.cpp
src/msw/utils.cpp

index d0e3a7f5cdead6ceaca002c28920b6beecad1135..bde773663932a9d36ed586bd585e32098db41429 100644 (file)
@@ -98,7 +98,7 @@ int name::Index(const T& Item, bool bFromEnd) const                           \
       size_t ui = size() - 1;                                                 \
       do {                                                                    \
         if ( (T*)base_array::operator[](ui) == &Item )                        \
-          return ui;                                                          \
+          return wx_static_cast(int, ui);                                     \
         ui--;                                                                 \
       }                                                                       \
       while ( ui != 0 );                                                      \
@@ -107,7 +107,7 @@ int name::Index(const T& Item, bool bFromEnd) const                           \
   else {                                                                      \
     for( size_t ui = 0; ui < size(); ui++ ) {                                 \
       if( (T*)base_array::operator[](ui) == &Item )                           \
-        return ui;                                                            \
+        return wx_static_cast(int, ui);                                       \
     }                                                                         \
   }                                                                           \
                                                                               \
index b8689b86f6e9f7bc151fbedfde44f4e79f27e930..b1d2f0631423e10a00dba891b70db75f525bfdc2 100644 (file)
@@ -341,7 +341,7 @@ protected: \
     /* returns NULL if not found */ \
     Node** GetNodePtr( const const_key_type& key ) const \
     { \
-        unsigned long hash = m_hasher( key ); \
+        unsigned long hash = wx_static_cast(unsigned long, m_hasher( key )); \
         Node** node = &m_table[hash % m_tableBuckets]; \
  \
         while( *node ) \
@@ -358,7 +358,7 @@ protected: \
     /* expressing it in terms of GetNodePtr is 5-8% slower :-( */ \
     Node* GetNode( const const_key_type& key ) const \
     { \
-        unsigned long hash = m_hasher( key ); \
+        unsigned long hash = wx_static_cast(unsigned long, m_hasher( key )); \
         Node* node = m_table[hash % m_tableBuckets]; \
  \
         while( node ) \
index 3d4cd4da72b383d07dce82f0bf4f50204b0fe661..597bc3eb50e0b42a644bcae98e2c79368f053592 100644 (file)
@@ -373,7 +373,7 @@ public:
     const wxString& GetLabel() const { return m_item.m_text; }
     const wxString& GetText() const { return m_item.m_text; }
     int GetImage() const { return m_item.m_image; }
-    long GetData() const { return m_item.m_data; }
+    long GetData() const { return wx_static_cast(long, m_item.m_data); }
     long GetMask() const { return m_item.m_mask; }
     const wxListItem& GetItem() const { return m_item; }
 
index aebf3e5165e6d98f4aa18a6073ed3ba2177c3dd2..d9a49f3a1f67b560d3bdbea359a0d83d22f79c37 100644 (file)
@@ -80,7 +80,7 @@ public:
     };
 
     static BOOL CALLBACK
-        EnumModulesProc(PSTR name, DWORD base, ULONG size, void *data);
+        EnumModulesProc(PSTR name, DWORD64 base, ULONG size, void *data);
 };
 
 // ----------------------------------------------------------------------------
@@ -209,7 +209,7 @@ wxString wxVersionDLL::GetFileVersion(const wxString& filename) const
 /* static */
 BOOL CALLBACK
 wxDynamicLibraryDetailsCreator::EnumModulesProc(PSTR name,
-                                                DWORD base,
+                                                DWORD64 base,
                                                 ULONG size,
                                                 void *data)
 {
index abf12be7982ea036afa0cc519a0f160ff98102ef..a31464cb56ba6c7df176d95f76997b370d5cdb9e 100644 (file)
@@ -82,7 +82,7 @@ IMPLEMENT_CLASS(wxFileDialog, wxFileDialogBase)
 // hook function for moving the dialog
 // ----------------------------------------------------------------------------
 
-UINT APIENTRY
+UINT_PTR APIENTRY
 wxFileDialogHookFunction(HWND      hDlg,
                          UINT      iMsg,
                          WPARAM    WXUNUSED(wParam),
index b8fd0d369d6fd8686e8f92828fcd4d4b430bbe97..6f65bf9987fda91d8fb89090f5dbb8caecc78e88 100644 (file)
@@ -1303,13 +1303,15 @@ bool wxAMMediaBackend::Load(const wxString& fileName)
 #if defined(_WIN32)
     ::SetWindowLong(m_hNotifyWnd, GWL_WNDPROC,
                        (LONG)wxAMMediaBackend::NotifyWndProc);
+    ::SetWindowLong(m_hNotifyWnd, GWL_USERDATA,
+                       (LONG) this);
 #else
     ::SetWindowLongPtr(m_hNotifyWnd, GWLP_WNDPROC,
                        (LONG_PTR)wxAMMediaBackend::NotifyWndProc);
+    ::SetWindowLongPtr(m_hNotifyWnd, GWL_USERDATA,
+                       (LONG) this);
 #endif
 
-    ::SetWindowLong(m_hNotifyWnd, GWL_USERDATA,
-                       (LONG) this);
 
     wxAMVERIFY( m_pME->SetNotifyWindow((LONG_PTR)m_hNotifyWnd,
                                        WM_GRAPHNOTIFY, 0) );
@@ -2141,7 +2143,11 @@ LRESULT CALLBACK wxMCIMediaBackend::NotifyWndProc(HWND hWnd, UINT nMsg,
                                                   LPARAM lParam)
 {
     wxMCIMediaBackend* backend = (wxMCIMediaBackend*)
+#ifdef _WIN32
         ::GetWindowLong(hWnd, GWL_USERDATA);
+#else
+        ::GetWindowLongPtr(hWnd, GWLP_USERDATA);
+#endif        
     wxASSERT(backend);
 
     return backend->OnNotifyWndProc(hWnd, nMsg, wParam, lParam);
index 127f497d8ee5cd42dd147ed9724524e55afa3993..9a2b997200f01ec25060d916c0c75134c72bdcf2 100644 (file)
@@ -61,7 +61,7 @@ static wxTimerMap& TimerMap()
 // ----------------------------------------------------------------------------
 
 // timer callback used for all timers
-void WINAPI wxTimerProc(HWND hwnd, UINT msg, UINT idTimer, DWORD dwTime);
+void WINAPI wxTimerProc(HWND hwnd, UINT msg, UINT_PTR idTimer, DWORD dwTime);
 
 // ----------------------------------------------------------------------------
 // macros
@@ -155,7 +155,7 @@ void wxProcessTimer(wxTimer& timer)
 void WINAPI
 wxTimerProc(HWND WXUNUSED(hwnd),
             UINT WXUNUSED(msg),
-            UINT idTimer,
+            UINT_PTR idTimer,
             DWORD WXUNUSED(dwTime))
 {
     wxTimerMap::iterator node = TimerMap().find((unsigned long)idTimer);
index 365d1788409214d598f612a8168ade7aca6397de..d8cedf876e88c470b707cf2eebd10e35777ee2ec 100644 (file)
@@ -1045,9 +1045,9 @@ wxMemorySize wxGetFreeMemory()
 {
 #if defined(__WIN64__)
     MEMORYSTATUSEX memStatex;
-    statex.dwLength = sizeof (statex);
-    ::GlobalMemoryStatusEx (&statex);
-    return (wxMemorySize)memStatus.ullAvailPhys;
+    memStatex.dwLength = sizeof (memStatex);
+    ::GlobalMemoryStatusEx (&memStatex);
+    return (wxMemorySize)memStatex.ullAvailPhys;
 #else /* if defined(__WIN32__) */
     MEMORYSTATUS memStatus;
     memStatus.dwLength = sizeof(MEMORYSTATUS);