Applied patch [ 1195797 ] Fixes to compile on Win64

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34241 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2005-05-22 12:10:55 +00:00
parent 921c65ed3d
commit 106d80ad37
8 changed files with 21 additions and 15 deletions

View File

@@ -98,7 +98,7 @@ int name::Index(const T& Item, bool bFromEnd) const \
size_t ui = size() - 1; \ size_t ui = size() - 1; \
do { \ do { \
if ( (T*)base_array::operator[](ui) == &Item ) \ if ( (T*)base_array::operator[](ui) == &Item ) \
return ui; \ return wx_static_cast(int, ui); \
ui--; \ ui--; \
} \ } \
while ( ui != 0 ); \ while ( ui != 0 ); \
@@ -107,7 +107,7 @@ int name::Index(const T& Item, bool bFromEnd) const \
else { \ else { \
for( size_t ui = 0; ui < size(); ui++ ) { \ for( size_t ui = 0; ui < size(); ui++ ) { \
if( (T*)base_array::operator[](ui) == &Item ) \ if( (T*)base_array::operator[](ui) == &Item ) \
return ui; \ return wx_static_cast(int, ui); \
} \ } \
} \ } \
\ \

View File

@@ -341,7 +341,7 @@ protected: \
/* returns NULL if not found */ \ /* returns NULL if not found */ \
Node** GetNodePtr( const const_key_type& key ) const \ 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]; \ Node** node = &m_table[hash % m_tableBuckets]; \
\ \
while( *node ) \ while( *node ) \
@@ -358,7 +358,7 @@ protected: \
/* expressing it in terms of GetNodePtr is 5-8% slower :-( */ \ /* expressing it in terms of GetNodePtr is 5-8% slower :-( */ \
Node* GetNode( const const_key_type& key ) const \ 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]; \ Node* node = m_table[hash % m_tableBuckets]; \
\ \
while( node ) \ while( node ) \

View File

@@ -373,7 +373,7 @@ public:
const wxString& GetLabel() const { return m_item.m_text; } const wxString& GetLabel() const { return m_item.m_text; }
const wxString& GetText() const { return m_item.m_text; } const wxString& GetText() const { return m_item.m_text; }
int GetImage() const { return m_item.m_image; } 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; } long GetMask() const { return m_item.m_mask; }
const wxListItem& GetItem() const { return m_item; } const wxListItem& GetItem() const { return m_item; }

View File

@@ -80,7 +80,7 @@ public:
}; };
static BOOL CALLBACK 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 */ /* static */
BOOL CALLBACK BOOL CALLBACK
wxDynamicLibraryDetailsCreator::EnumModulesProc(PSTR name, wxDynamicLibraryDetailsCreator::EnumModulesProc(PSTR name,
DWORD base, DWORD64 base,
ULONG size, ULONG size,
void *data) void *data)
{ {

View File

@@ -82,7 +82,7 @@ IMPLEMENT_CLASS(wxFileDialog, wxFileDialogBase)
// hook function for moving the dialog // hook function for moving the dialog
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
UINT APIENTRY UINT_PTR APIENTRY
wxFileDialogHookFunction(HWND hDlg, wxFileDialogHookFunction(HWND hDlg,
UINT iMsg, UINT iMsg,
WPARAM WXUNUSED(wParam), WPARAM WXUNUSED(wParam),

View File

@@ -1303,13 +1303,15 @@ bool wxAMMediaBackend::Load(const wxString& fileName)
#if defined(_WIN32) #if defined(_WIN32)
::SetWindowLong(m_hNotifyWnd, GWL_WNDPROC, ::SetWindowLong(m_hNotifyWnd, GWL_WNDPROC,
(LONG)wxAMMediaBackend::NotifyWndProc); (LONG)wxAMMediaBackend::NotifyWndProc);
::SetWindowLong(m_hNotifyWnd, GWL_USERDATA,
(LONG) this);
#else #else
::SetWindowLongPtr(m_hNotifyWnd, GWLP_WNDPROC, ::SetWindowLongPtr(m_hNotifyWnd, GWLP_WNDPROC,
(LONG_PTR)wxAMMediaBackend::NotifyWndProc); (LONG_PTR)wxAMMediaBackend::NotifyWndProc);
::SetWindowLongPtr(m_hNotifyWnd, GWL_USERDATA,
(LONG) this);
#endif #endif
::SetWindowLong(m_hNotifyWnd, GWL_USERDATA,
(LONG) this);
wxAMVERIFY( m_pME->SetNotifyWindow((LONG_PTR)m_hNotifyWnd, wxAMVERIFY( m_pME->SetNotifyWindow((LONG_PTR)m_hNotifyWnd,
WM_GRAPHNOTIFY, 0) ); WM_GRAPHNOTIFY, 0) );
@@ -2141,7 +2143,11 @@ LRESULT CALLBACK wxMCIMediaBackend::NotifyWndProc(HWND hWnd, UINT nMsg,
LPARAM lParam) LPARAM lParam)
{ {
wxMCIMediaBackend* backend = (wxMCIMediaBackend*) wxMCIMediaBackend* backend = (wxMCIMediaBackend*)
#ifdef _WIN32
::GetWindowLong(hWnd, GWL_USERDATA); ::GetWindowLong(hWnd, GWL_USERDATA);
#else
::GetWindowLongPtr(hWnd, GWLP_USERDATA);
#endif
wxASSERT(backend); wxASSERT(backend);
return backend->OnNotifyWndProc(hWnd, nMsg, wParam, lParam); return backend->OnNotifyWndProc(hWnd, nMsg, wParam, lParam);

View File

@@ -61,7 +61,7 @@ static wxTimerMap& TimerMap()
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// timer callback used for all timers // 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 // macros
@@ -155,7 +155,7 @@ void wxProcessTimer(wxTimer& timer)
void WINAPI void WINAPI
wxTimerProc(HWND WXUNUSED(hwnd), wxTimerProc(HWND WXUNUSED(hwnd),
UINT WXUNUSED(msg), UINT WXUNUSED(msg),
UINT idTimer, UINT_PTR idTimer,
DWORD WXUNUSED(dwTime)) DWORD WXUNUSED(dwTime))
{ {
wxTimerMap::iterator node = TimerMap().find((unsigned long)idTimer); wxTimerMap::iterator node = TimerMap().find((unsigned long)idTimer);

View File

@@ -1045,9 +1045,9 @@ wxMemorySize wxGetFreeMemory()
{ {
#if defined(__WIN64__) #if defined(__WIN64__)
MEMORYSTATUSEX memStatex; MEMORYSTATUSEX memStatex;
statex.dwLength = sizeof (statex); memStatex.dwLength = sizeof (memStatex);
::GlobalMemoryStatusEx (&statex); ::GlobalMemoryStatusEx (&memStatex);
return (wxMemorySize)memStatus.ullAvailPhys; return (wxMemorySize)memStatex.ullAvailPhys;
#else /* if defined(__WIN32__) */ #else /* if defined(__WIN32__) */
MEMORYSTATUS memStatus; MEMORYSTATUS memStatus;
memStatus.dwLength = sizeof(MEMORYSTATUS); memStatus.dwLength = sizeof(MEMORYSTATUS);