diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2013-06-10 12:44:57 +0200 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2013-06-10 14:03:33 +0200 |
commit | 094560c29fed9b0b58505717c4e6694ad9ff8a69 (patch) | |
tree | 40c1a253fdc35d171f474f9e4262a4e4b611b417 /sal | |
parent | 44feea1957f6f3ff28917625223e610fe2807c49 (diff) |
mingw64: casting to pointer from narrower integer fixes in sal
Change-Id: I63321e33f92223be47c7ee25dbf03fe3032991d6
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/w32/dllentry.c | 8 | ||||
-rw-r--r-- | sal/osl/w32/thread.c | 8 | ||||
-rw-r--r-- | sal/rtl/alloc_arena.cxx | 2 | ||||
-rw-r--r-- | sal/rtl/alloc_global.cxx | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/sal/osl/w32/dllentry.c b/sal/osl/w32/dllentry.c index 407135683430..39c6c6137d63 100644 --- a/sal/osl/w32/dllentry.c +++ b/sal/osl/w32/dllentry.c @@ -98,7 +98,7 @@ __do_global_dtors (void) void __do_global_ctors (void) { - unsigned long nptrs = (unsigned long) __CTOR_LIST__[0]; + sal_uIntPtr nptrs = (sal_uIntPtr) __CTOR_LIST__[0]; unsigned i; /* @@ -106,7 +106,7 @@ __do_global_ctors (void) * is terminated with a null entry. Otherwise the first entry was * the number of pointers in the list. */ - if (nptrs == (unsigned long)-1) + if (nptrs == (sal_uIntPtr)-1) { for (nptrs = 0; __CTOR_LIST__[nptrs + 1] != 0; nptrs++) ; @@ -264,7 +264,7 @@ static DWORD GetParentProcessId() static DWORD WINAPI ParentMonitorThreadProc( LPVOID lpParam ) { - DWORD dwParentProcessId = (DWORD)lpParam; + DWORD_PTR dwParentProcessId = (DWORD_PTR)lpParam; HANDLE hParentProcess = OpenProcess( SYNCHRONIZE, FALSE, dwParentProcessId ); if ( IsValidHandle( hParentProcess ) ) @@ -300,7 +300,7 @@ BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved ) { DWORD dwThreadId = 0; - DWORD dwParentProcessId = (DWORD)atol( szBuffer ); + DWORD_PTR dwParentProcessId = (DWORD_PTR)atol( szBuffer ); if ( dwParentProcessId && GetParentProcessId() == dwParentProcessId ) { diff --git a/sal/osl/w32/thread.c b/sal/osl/w32/thread.c index 87632851bcd8..d4dbc7f8f9f9 100644 --- a/sal/osl/w32/thread.c +++ b/sal/osl/w32/thread.c @@ -565,14 +565,14 @@ DWORD g_dwTLSTextEncodingIndex = (DWORD)-1; rtl_TextEncoding SAL_CALL osl_getThreadTextEncoding(void) { - DWORD dwEncoding; + DWORD_PTR dwEncoding; rtl_TextEncoding _encoding; BOOL gotACP; if ( (DWORD)-1 == g_dwTLSTextEncodingIndex ) g_dwTLSTextEncodingIndex = TlsAlloc(); - dwEncoding = (DWORD)TlsGetValue( g_dwTLSTextEncodingIndex ); + dwEncoding = (DWORD_PTR)TlsGetValue( g_dwTLSTextEncodingIndex ); _encoding = LOWORD(dwEncoding); gotACP = HIWORD(dwEncoding); @@ -586,7 +586,7 @@ rtl_TextEncoding SAL_CALL osl_getThreadTextEncoding(void) else _encoding = rtl_getTextEncodingFromWindowsCodePage( GetACP() ); - TlsSetValue( g_dwTLSTextEncodingIndex, (LPVOID)MAKELONG( _encoding, TRUE ) ); + TlsSetValue( g_dwTLSTextEncodingIndex, (LPVOID)(DWORD_PTR)MAKELONG( _encoding, TRUE ) ); } return _encoding; @@ -599,7 +599,7 @@ rtl_TextEncoding SAL_CALL osl_setThreadTextEncoding( rtl_TextEncoding Encoding ) { rtl_TextEncoding oldEncoding = osl_getThreadTextEncoding(); - TlsSetValue( g_dwTLSTextEncodingIndex, (LPVOID)MAKELONG( Encoding, TRUE) ); + TlsSetValue( g_dwTLSTextEncodingIndex, (LPVOID)(DWORD_PTR)MAKELONG( Encoding, TRUE) ); return oldEncoding; } diff --git a/sal/rtl/alloc_arena.cxx b/sal/rtl/alloc_arena.cxx index d35ba1fa13d1..9017a5ac2305 100644 --- a/sal/rtl/alloc_arena.cxx +++ b/sal/rtl/alloc_arena.cxx @@ -721,7 +721,7 @@ rtl_arena_activate ( for (i = 1; i <= n; i++) { size = i * arena->m_quantum; - (void) snprintf (namebuf, sizeof(namebuf), "%s_%lu", arena->m_name, size); + (void) snprintf (namebuf, sizeof(namebuf), "%s_%" SAL_PRIuUINTPTR, arena->m_name, size); arena->m_qcache_ptr[i - 1] = rtl_cache_create(namebuf, size, 0, NULL, NULL, NULL, NULL, arena, RTL_CACHE_FLAG_QUANTUMCACHE); } } diff --git a/sal/rtl/alloc_global.cxx b/sal/rtl/alloc_global.cxx index ab571c663631..8194b1346908 100644 --- a/sal/rtl/alloc_global.cxx +++ b/sal/rtl/alloc_global.cxx @@ -210,7 +210,7 @@ void rtl_memory_init() for (i = 0; i < n; i++) { char name[RTL_CACHE_NAME_LENGTH + 1]; - (void) snprintf (name, sizeof(name), "rtl_alloc_%lu", g_alloc_sizes[i]); + (void) snprintf (name, sizeof(name), "rtl_alloc_%" SAL_PRIuUINTPTR, g_alloc_sizes[i]); g_alloc_caches[i] = rtl_cache_create (name, g_alloc_sizes[i], 0, NULL, NULL, NULL, NULL, NULL, 0); } |