I just update the patch for wxWidgets, remove some un-necessary cast from int64 to int32.
some type I change in this patch, the size in win64 are:
Code: Select all
sizeof int = 4
sizeof size_t = 8
sizeof ssize_t = 8
sizeof intptr_t = 8
sizeof HANDLE = 8
sizeof HGLOBAL = 8
sizeof HINSTANCE = 8
sizeof LPDEVMODE = 8
sizeof UINT_PTR = 8
sizeof ULONG_PTR = 8
sizeof LPARAM = 8
and in win32, all above (except intptr_t, it's not define in win32) size are 4.
the only cast from int64 to int32 in this new patch is the return value of thread.
Code: Select all
diff --strip-trailing-cr -Nur wxWidgets-2.8.12/src/msw/thread.cpp wxWidgets-2.8.12.patched/src/msw/thread.cpp
--- wxWidgets-2.8.12/src/msw/thread.cpp 2011-03-22 20:00:54 +0800
+++ wxWidgets-2.8.12.patched/src/msw/thread.cpp 2011-04-07 13:32:55 +0800
@@ -522,7 +522,7 @@
return (THREAD_RETVAL)-1;
}
- rc = (THREAD_RETVAL)thread->Entry();
+ rc = (THREAD_RETVAL)(intptr_t)thread->Entry();
}
wxCATCH_ALL( wxTheApp->OnUnhandledException(); )
@@ -842,7 +842,7 @@
break;
}
- if ( (DWORD)rc != STILL_ACTIVE )
+ if ( (intptr_t)rc != STILL_ACTIVE )
break;
// give the other thread some time to terminate, otherwise we may be
@@ -1000,7 +1000,7 @@
// could we set all bits?
if ( level != 0 )
{
- wxLogDebug(_T("bad level %u in wxThread::SetConcurrency()"), level);
+ wxLogDebug(_T("bad level %Iu in wxThread::SetConcurrency()"), level);
return false;
}
@@ -1162,7 +1162,7 @@
}
#ifdef wxUSE_BEGIN_THREAD
- _endthreadex((unsigned)status);
+ _endthreadex((unsigned)(intptr_t)status);
#else // !VC++
::ExitThread((DWORD)status);
#endif // VC++/!VC++
in wxWidgets 2.9.x trunk, it's doing the same cast here. the return value for thread is a 32bits integer, it can't hold win64 pointer also.
and the _endthreadex() parameter is a unsigned int also in win64. so I think the cast for this won't cause any bad result.