Alien-wxWidgets
view release on metacpan or search on metacpan
patches/wxMSW-2.8.12-w64.patch view on Meta::CPAN
Index: src/aui/framemanager.cpp
===================================================================
--- src/aui/framemanager.cpp (revisione 63679)
+++ src/aui/framemanager.cpp (copia locale)
@@ -973,7 +973,7 @@
if (pinfo.name.empty() || already_exists)
{
pinfo.name.Printf(wxT("%08lx%08x%08x%08lx"),
- ((unsigned long)pinfo.window) & 0xffffffff,
+ wxPtrToUInt(pinfo.window) & 0xffffffff,
(unsigned int)time(NULL),
#ifdef __WXWINCE__
(unsigned int)GetTickCount(),
Index: src/common/utilscmn.cpp
===================================================================
--- src/common/utilscmn.cpp (revisione 63679)
+++ src/common/utilscmn.cpp (copia locale)
@@ -822,7 +822,7 @@
//hInstApp member is only valid if the function fails, in which case it
//receives one of the following error values, which are less than or
//equal to 32.
- const int nResult = (int) sei.hInstApp;
+ const int nResult = (INT_PTR) sei.hInstApp;
// Firefox returns file not found for some reason, so make an exception
// for it
Index: src/msw/dcprint.cpp
===================================================================
--- src/msw/dcprint.cpp (revisione 63679)
+++ src/msw/dcprint.cpp (copia locale)
@@ -319,7 +319,7 @@
}
- HGLOBAL hDevMode = (HGLOBAL)(DWORD) data->GetDevMode();
+ HGLOBAL hDevMode = (HGLOBAL) data->GetDevMode();
DEVMODE *lpDevMode = hDevMode ? (DEVMODE *)::GlobalLock(hDevMode) : NULL;
Index: src/msw/window.cpp
===================================================================
--- src/msw/window.cpp (revisione 63679)
+++ src/msw/window.cpp (copia locale)
@@ -2596,8 +2596,8 @@
// trace all messages - useful for the debugging
#ifdef __WXDEBUG__
wxLogTrace(wxTraceMessages,
- wxT("Processing %s(hWnd=%08lx, wParam=%8lx, lParam=%8lx)"),
- wxGetMessageName(message), (long)hWnd, (long)wParam, lParam);
+ wxT("Processing %s(hWnd=%p, wParam=%8lx, lParam=%8lx)"),
+ wxGetMessageName(message), hWnd, (long)wParam, lParam);
#endif // __WXDEBUG__
wxWindowMSW *wnd = wxFindWinFromHandle((WXHWND) hWnd);
@@ -3449,7 +3455,7 @@
#ifdef __WXDEBUG__
if ( oldWin && (oldWin != win) )
{
- wxLogDebug(wxT("HWND %X already associated with another window (%s)"),
- (int) hWnd, win->GetClassInfo()->GetClassName());
+ wxLogDebug(wxT("HWND %p already associated with another window (%s)"),
+ hWnd, win->GetClassInfo()->GetClassName());
}
else
Index: src/msw/toplevel.cpp
===================================================================
--- src/msw/toplevel.cpp (revisione 63679)
+++ src/msw/toplevel.cpp (copia locale)
@@ -1122,7 +1122,7 @@
{
// restore focus to the child which was last focused unless we already
// have it
- wxLogTrace(_T("focus"), _T("wxTLW %08x activated."), (int) m_hWnd);
+ wxLogTrace(_T("focus"), _T("wxTLW %p activated."), m_hWnd);
wxWindow *winFocus = FindFocus();
if ( !winFocus || wxGetTopLevelParent(winFocus) != this )
@@ -1157,10 +1157,10 @@
}
wxLogTrace(_T("focus"),
- _T("wxTLW %08x deactivated, last focused: %08x."),
- (int) m_hWnd,
- (int) (m_winLastFocused ? GetHwndOf(m_winLastFocused)
- : NULL));
+ _T("wxTLW %p deactivated, last focused: %p."),
+ m_hWnd,
+ (m_winLastFocused ? GetHwndOf(m_winLastFocused)
+ : NULL));
event.Skip();
}
Index: src/msw/menuitem.cpp
===================================================================
--- src/msw/menuitem.cpp (revisione 63679)
+++ src/msw/menuitem.cpp (copia locale)
@@ -188,7 +188,7 @@
// return the id for calling Win32 API functions
int wxMenuItem::GetRealId() const
{
- return m_subMenu ? (int)m_subMenu->GetHMenu() : GetId();
+ return m_subMenu ? wxPtrToUInt(m_subMenu->GetHMenu()) : GetId();
}
// get item state
Index: src/msw/mdi.cpp
===================================================================
--- src/msw/mdi.cpp (revisione 63679)
+++ src/msw/mdi.cpp (copia locale)
@@ -763,7 +763,7 @@
wxWindowCreationHook hook(this);
m_hWnd = (WXHWND)::SendMessage(GetWinHwnd(parent->GetClientWindow()),
- WM_MDICREATE, 0, (LONG)(LPSTR)&mcs);
+ WM_MDICREATE, 0, (LPARAM)&mcs);
if ( !m_hWnd )
{
@@ -1433,14 +1433,14 @@
{
success = true;
::InsertMenu(hmenu, i, MF_BYPOSITION | MF_POPUP | MF_STRING,
- (UINT)subMenu, _("&Window"));
+ (UINT_PTR)subMenu, _("&Window"));
break;
}
}
if ( !success )
{
- ::AppendMenu(hmenu, MF_POPUP, (UINT)subMenu, _("&Window"));
+ ::AppendMenu(hmenu, MF_POPUP, (UINT_PTR)subMenu, _("&Window"));
}
}
Index: src/msw/tooltip.cpp
===================================================================
--- src/msw/tooltip.cpp (revisione 63679)
+++ src/msw/tooltip.cpp (copia locale)
@@ -106,7 +106,7 @@
uFlags |= TTF_TRANSPARENT;
}
- uId = (UINT)hwndOwner;
+ uId = (UINT_PTR)hwndOwner;
}
};
Index: src/msw/menu.cpp
===================================================================
--- src/msw/menu.cpp (revisione 63679)
+++ src/msw/menu.cpp (copia locale)
@@ -370,14 +370,14 @@
// id is the numeric id for normal menu items and HMENU for submenus as
// required by ::AppendMenu() API
- UINT id;
+ UINT_PTR id;
wxMenu *submenu = pItem->GetSubMenu();
if ( submenu != NULL ) {
wxASSERT_MSG( submenu->GetHMenu(), wxT("invalid submenu") );
submenu->SetParent(this);
- id = (UINT)submenu->GetHMenu();
+ id = (UINT_PTR)submenu->GetHMenu();
flags |= MF_POPUP;
}
@@ -963,7 +963,7 @@
for ( i = 0, it = m_menus.begin(); i < count; i++, it++ )
{
if ( !::AppendMenu((HMENU)m_hMenu, MF_POPUP | MF_STRING,
- (UINT)(*it)->GetHMenu(),
+ (UINT_PTR)(*it)->GetHMenu(),
m_titles[i]) )
{
wxLogLastError(wxT("AppendMenu"));
@@ -1035,7 +1035,7 @@
int mswpos = MSWPositionForWxMenu(GetMenu(pos),pos);
- UINT id;
+ UINT_PTR id;
UINT flagsOld = ::GetMenuState((HMENU)m_hMenu, mswpos, MF_BYPOSITION);
if ( flagsOld == 0xFFFFFFFF )
{
@@ -1048,7 +1048,7 @@
{
// HIBYTE contains the number of items in the submenu in this case
flagsOld &= 0xff;
- id = (UINT)::GetSubMenu((HMENU)m_hMenu, mswpos);
+ id = (UINT_PTR)::GetSubMenu((HMENU)m_hMenu, mswpos);
}
else
{
@@ -1124,7 +1124,7 @@
if ( !::InsertMenu(GetHmenu(), (UINT)mswpos,
MF_BYPOSITION | MF_POPUP | MF_STRING,
- (UINT)GetHmenuOf(menu), title) )
+ (UINT_PTR)GetHmenuOf(menu), title) )
{
wxLogLastError(wxT("InsertMenu"));
}
@@ -1191,7 +1191,7 @@
#else
if ( !::InsertMenu(GetHmenu(), mswpos,
MF_BYPOSITION | MF_POPUP | MF_STRING,
- (UINT)GetHmenuOf(menu), title) )
+ (UINT_PTR)GetHmenuOf(menu), title) )
{
wxLogLastError(wxT("InsertMenu"));
}
@@ -1250,7 +1250,7 @@
}
#else
if ( !::AppendMenu(GetHmenu(), MF_POPUP | MF_STRING,
- (UINT)submenu, title) )
+ (UINT_PTR)submenu, title) )
{
wxLogLastError(wxT("AppendMenu"));
}
Index: src/msw/tbar95.cpp
===================================================================
--- src/msw/tbar95.cpp (revisione 63679)
+++ src/msw/tbar95.cpp (copia locale)
@@ -802,8 +802,8 @@
TBREPLACEBITMAP replaceBitmap;
replaceBitmap.hInstOld = NULL;
replaceBitmap.hInstNew = NULL;
- replaceBitmap.nIDOld = (UINT) oldToolBarBitmap;
- replaceBitmap.nIDNew = (UINT) hBitmap;
+ replaceBitmap.nIDOld = (UINT_PTR) oldToolBarBitmap;
+ replaceBitmap.nIDNew = (UINT_PTR) hBitmap;
replaceBitmap.nButtons = nButtons;
if ( !::SendMessage(GetHwnd(), TB_REPLACEBITMAP,
0, (LPARAM) &replaceBitmap) )
@@ -832,7 +832,7 @@
{
TBADDBITMAP addBitmap;
addBitmap.hInst = 0;
- addBitmap.nID = (UINT) hBitmap;
+ addBitmap.nID = (UINT_PTR) hBitmap;
if ( ::SendMessage(GetHwnd(), TB_ADDBITMAP,
(WPARAM) nButtons, (LPARAM)&addBitmap) == -1 )
{
@@ -912,7 +912,7 @@
{
const wxString& label = tool->GetLabel();
if ( !label.empty() )
- button.iString = (int)label.c_str();
+ button.iString = (INT_PTR)label.c_str();
}
button.idCommand = tool->GetId();
Index: src/msw/thread.cpp
===================================================================
--- src/msw/thread.cpp (revisione 63679)
+++ src/msw/thread.cpp (copia locale)
@@ -522,7 +522,7 @@
return (THREAD_RETVAL)-1;
}
- rc = (THREAD_RETVAL)thread->Entry();
+ rc = wxPtrToUInt(thread->Entry());
}
wxCATCH_ALL( wxTheApp->OnUnhandledException(); )
@@ -684,7 +684,7 @@
// from Wait()) or ask it to terminate (when called from Delete())
bool shouldDelete = threadToDelete != NULL;
- wxThread::ExitCode rc = 0;
+ DWORD rc = 0;
// we might need to resume the thread if it's currently stopped
bool shouldResume = false;
@@ -837,12 +837,12 @@
{
wxLogLastError(wxT("GetExitCodeThread"));
- rc = (wxThread::ExitCode)-1;
+ rc = (THREAD_RETVAL)-1;
break;
}
- if ( (DWORD)rc != STILL_ACTIVE )
+ if ( rc != STILL_ACTIVE )
break;
// give the other thread some time to terminate, otherwise we may be
@@ -851,14 +851,14 @@
}
if ( pRc )
- *pRc = rc;
+ *pRc = wxUIntToPtr(rc);
// we don't need the thread handle any more in any case
Free();
- return rc == (wxThread::ExitCode)-1 ? wxTHREAD_MISC_ERROR
- : wxTHREAD_NO_ERROR;
+ return rc == (THREAD_RETVAL)-1 ? wxTHREAD_MISC_ERROR
+ : wxTHREAD_NO_ERROR;
}
bool wxThreadInternal::Suspend()
@@ -1162,7 +1162,7 @@
}
#ifdef wxUSE_BEGIN_THREAD
- _endthreadex((unsigned)status);
+ _endthreadex(wxPtrToUInt(status));
#else // !VC++
::ExitThread((DWORD)status);
#endif // VC++/!VC++
Index: src/msw/frame.cpp
===================================================================
--- src/msw/frame.cpp (revisione 63679)
+++ src/msw/frame.cpp (copia locale)
@@ -855,7 +855,8 @@
HDC hdc = ::BeginPaint(GetHwnd(), &ps);
// Erase background before painting or we get white background
- MSWDefWindowProc(WM_ICONERASEBKGND, (WORD)(LONG)ps.hdc, 0L);
+ // Commented out: according to MSDN it's only needed on NT 3.51
+ // MSWDefWindowProc(WM_ICONERASEBKGND, (WORD)(LONG)ps.hdc, 0L);
if ( hIcon )
{
@@ -1080,7 +1081,7 @@
const wxIcon& icon = GetIcon();
HICON hIcon = icon.Ok() ? GetHiconOf(icon)
: (HICON)GetDefaultIcon();
- rc = (long)hIcon;
+ rc = (WXLRESULT)hIcon;
processed = rc != 0;
}
break;
Index: src/msw/pen.cpp
===================================================================
--- src/msw/pen.cpp (revisione 63679)
+++ src/msw/pen.cpp (copia locale)
@@ -172,7 +172,7 @@
case wxSTIPPLE:
logb.lbStyle = BS_PATTERN ;
if (M_PENDATA->m_stipple.Ok())
- logb.lbHatch = (LONG)M_PENDATA->m_stipple.GetHBITMAP();
+ logb.lbHatch = wxPtrToUInt(M_PENDATA->m_stipple.GetHBITMAP());
else
logb.lbHatch = (LONG)0;
break;
Index: src/msw/helpwin.cpp
===================================================================
--- src/msw/helpwin.cpp (revisione 63679)
+++ src/msw/helpwin.cpp (copia locale)
@@ -98,7 +98,7 @@
wxString str = GetValidFilename(m_helpFile);
- return (WinHelp(GetSuitableHWND(this), (const wxChar*) str, HELP_PARTIALKEY, (DWORD)(const wxChar*) k) != 0);
+ return (WinHelp(GetSuitableHWND(this), (const wxChar*) str, HELP_PARTIALKEY, (ULONG_PTR)(const wxChar*) k) != 0);
}
// Can't close the help window explicitly in WinHelp
Index: src/msw/printdlg.cpp
===================================================================
--- src/msw/printdlg.cpp (revisione 63679)
+++ src/msw/printdlg.cpp (copia locale)
@@ -175,10 +175,10 @@
wxWindowsPrintNativeData::~wxWindowsPrintNativeData()
{
- HGLOBAL hDevMode = (HGLOBAL)(DWORD) m_devMode;
+ HGLOBAL hDevMode = (HGLOBAL) m_devMode;
if ( hDevMode )
GlobalFree(hDevMode);
- HGLOBAL hDevNames = (HGLOBAL)(DWORD) m_devNames;
+ HGLOBAL hDevNames = (HGLOBAL) m_devNames;
if ( hDevNames )
GlobalFree(hDevNames);
}
@@ -190,8 +190,8 @@
bool wxWindowsPrintNativeData::TransferTo( wxPrintData &data )
{
- HGLOBAL hDevMode = (HGLOBAL)(DWORD) m_devMode;
- HGLOBAL hDevNames = (HGLOBAL)(DWORD) m_devNames;
+ HGLOBAL hDevMode = (HGLOBAL) m_devMode;
+ HGLOBAL hDevNames = (HGLOBAL) m_devNames;
if (!hDevMode)
{
@@ -396,8 +396,8 @@
bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data )
{
- HGLOBAL hDevMode = (HGLOBAL)(DWORD) m_devMode;
- HGLOBAL hDevNames = (HGLOBAL)(DWORD) m_devNames;
+ HGLOBAL hDevMode = (HGLOBAL) m_devMode;
+ HGLOBAL hDevNames = (HGLOBAL) m_devNames;
WinPrinter printer;
LPTSTR szPrinterName = (LPTSTR)data.GetPrinterName().wx_str();
@@ -452,18 +452,12 @@
// Use PRINTDLG as a way of creating a DEVMODE object
PRINTDLG pd;
- // GNU-WIN32 has the wrong size PRINTDLG - can't work out why.
-#ifdef __GNUWIN32__
- memset(&pd, 0, 66);
- pd.lStructSize = 66;
-#else
memset(&pd, 0, sizeof(PRINTDLG));
#ifdef __WXWINCE__
pd.cbStruct = sizeof(PRINTDLG);
#else
pd.lStructSize = sizeof(PRINTDLG);
#endif
-#endif
pd.hwndOwner = (HWND)NULL;
pd.hDevMode = NULL; // Will be created by PrintDlg
@@ -493,7 +487,7 @@
else
{
hDevMode = pd.hDevMode;
- m_devMode = (void*)(long) hDevMode;
+ m_devMode = (void*) hDevMode;
( run in 0.385 second using v1.01-cache-2.11-cpan-ceb78f64989 )