From 89d2d4d5bc210be0cdb027bda5afd3a9c1b0f449 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 27 Aug 2008 20:27:32 +0000 Subject: [PATCH] Merge 34714, 34716, 34718, 34720 from ros-amd64-bringup branch: recyclebin: DWORD -> SIZE_T and SIZE_T -> DWORD rtl: - cast AtomName to ULONG_PTR instead of ULONG - RtlQueryProcessdebugInformation(): cast teb->ClientId.UniqueProcess to ULONG_PTR for assignment to Pid. - vs(w)nprintf: cast argument to ULONG_PTR instead of unsigned long for a %p crt: - int -> intptr_t - unsigned long -> uintptr_t - #undef _MINGW_IMPORT in ctype.c, to avoid warnings scrnsafe: rename _toul to _toulptr and make it return an ULONG_PTR svn path=/trunk/; revision=35712 --- reactos/lib/recyclebin/recyclebin_v5.c | 4 ++-- reactos/lib/recyclebin/recyclebin_v5_enumerator.c | 4 ++-- reactos/lib/rtl/atom.c | 4 ++-- reactos/lib/rtl/dbgbuffer.c | 4 ++-- reactos/lib/rtl/sprintf.c | 2 +- reactos/lib/rtl/srw.c | 2 +- reactos/lib/rtl/swprintf.c | 2 +- reactos/lib/sdk/crt/process/_system.c | 2 +- reactos/lib/sdk/crt/process/process.c | 6 +++--- reactos/lib/sdk/crt/string/ctype.c | 2 ++ reactos/lib/sdk/scrnsave/scrnsave.c | 8 ++++---- 11 files changed, 21 insertions(+), 19 deletions(-) diff --git a/reactos/lib/recyclebin/recyclebin_v5.c b/reactos/lib/recyclebin/recyclebin_v5.c index 1cacc925adb..3090055cdbe 100644 --- a/reactos/lib/recyclebin/recyclebin_v5.c +++ b/reactos/lib/recyclebin/recyclebin_v5.c @@ -564,7 +564,7 @@ RecycleBin5_Create( LPWSTR FileName; /* Pointer into BufferName buffer */ LPCSTR DesktopIniContents = "[.ShellClassInfo]\r\nCLSID={645FF040-5081-101B-9F08-00AA002F954E}\r\n"; INFO2_HEADER Info2Contents[] = { { 5, 0, 0, 0x320, 0 } }; - SIZE_T BytesToWrite, BytesWritten, Needed; + DWORD BytesToWrite, BytesWritten, Needed; HANDLE hFile = INVALID_HANDLE_VALUE; HRESULT hr; @@ -676,7 +676,7 @@ HRESULT RecycleBin5_Constructor(IN LPCWSTR VolumePath, OUT IUnknown **ppUnknown) HANDLE tokenHandle = INVALID_HANDLE_VALUE; PTOKEN_USER TokenUserInfo = NULL; LPWSTR StringSid = NULL, p; - SIZE_T Needed, DirectoryLength; + DWORD Needed, DirectoryLength; INT len; HRESULT hr; diff --git a/reactos/lib/recyclebin/recyclebin_v5_enumerator.c b/reactos/lib/recyclebin/recyclebin_v5_enumerator.c index 07130621e79..37413f352a8 100644 --- a/reactos/lib/recyclebin/recyclebin_v5_enumerator.c +++ b/reactos/lib/recyclebin/recyclebin_v5_enumerator.c @@ -191,9 +191,9 @@ RecycleBin5File_RecycleBinFile_GetAttributes( static HRESULT STDMETHODCALLTYPE RecycleBin5File_RecycleBinFile_GetFileName( IN IRecycleBinFile *This, - IN DWORD BufferSize, + IN SIZE_T BufferSize, IN OUT LPWSTR Buffer, - OUT DWORD *RequiredSize) + OUT SIZE_T *RequiredSize) { struct RecycleBin5File *s = CONTAINING_RECORD(This, struct RecycleBin5File, recycleBinFileImpl); DWORD dwRequired; diff --git a/reactos/lib/rtl/atom.c b/reactos/lib/rtl/atom.c index 74e7879185d..dde6658346f 100644 --- a/reactos/lib/rtl/atom.c +++ b/reactos/lib/rtl/atom.c @@ -90,9 +90,9 @@ RtlpCheckIntegerAtom(PWSTR AtomName, DPRINT("RtlpCheckIntegerAtom(AtomName '%S' AtomValue %p)\n", AtomName, AtomValue); - if (!((ULONG)AtomName & 0xFFFF0000)) + if (!((ULONG_PTR)AtomName & 0xFFFF0000)) { - LoValue = (USHORT)((ULONG)AtomName & 0xFFFF); + LoValue = (USHORT)((ULONG_PTR)AtomName & 0xFFFF); if (LoValue == 0) LoValue = 0xC000; diff --git a/reactos/lib/rtl/dbgbuffer.c b/reactos/lib/rtl/dbgbuffer.c index 323940956c3..92e6fe504c4 100644 --- a/reactos/lib/rtl/dbgbuffer.c +++ b/reactos/lib/rtl/dbgbuffer.c @@ -234,7 +234,7 @@ RtlQueryProcessDebugInformation(IN ULONG ProcessId, IN OUT PRTL_DEBUG_INFORMATION Buf) { NTSTATUS Status = STATUS_SUCCESS; - ULONG Pid = (ULONG) NtCurrentTeb()->ClientId.UniqueProcess; + ULONG Pid = (ULONG_PTR) NtCurrentTeb()->ClientId.UniqueProcess; Buf->Flags = DebugInfoMask; Buf->OffsetFree = sizeof(RTL_DEBUG_INFORMATION); @@ -319,7 +319,7 @@ else Buf->TargetProcessHandle = NtCurrentProcess(); ClientId.UniqueThread = 0; - ClientId.UniqueProcess = (HANDLE)ProcessId; + ClientId.UniqueProcess = (HANDLE)(ULONG_PTR)ProcessId; InitializeObjectAttributes(&ObjectAttributes, NULL, 0, diff --git a/reactos/lib/rtl/sprintf.c b/reactos/lib/rtl/sprintf.c index a00ff412cf0..c213adaeb2f 100644 --- a/reactos/lib/rtl/sprintf.c +++ b/reactos/lib/rtl/sprintf.c @@ -577,7 +577,7 @@ int __cdecl _vsnprintf(char *buf, size_t cnt, const char *fmt, va_list args) flags |= ZEROPAD; } str = number(str, end, - (unsigned long) va_arg(args, void *), 16, + (ULONG_PTR) va_arg(args, void *), 16, field_width, precision, flags); continue; diff --git a/reactos/lib/rtl/srw.c b/reactos/lib/rtl/srw.c index d0d335b14f0..4fe2e57b529 100644 --- a/reactos/lib/rtl/srw.c +++ b/reactos/lib/rtl/srw.c @@ -44,7 +44,7 @@ RTL_SRWLOCK_SHARED | RTL_SRWLOCK_CONTENTION_LOCK) #define RTL_SRWLOCK_BITS 4 -#if defined(__GNUC__) +#if defined(__GNUC__) && !defined(_M_AMD64) /* This macro will cause the code to assert if compiled with a buggy version of GCC that doesn't align the wait blocks properly on the stack! */ #define ASSERT_SRW_WAITBLOCK(ptr) \ diff --git a/reactos/lib/rtl/swprintf.c b/reactos/lib/rtl/swprintf.c index f4851e05b4d..c4b7fa95b71 100644 --- a/reactos/lib/rtl/swprintf.c +++ b/reactos/lib/rtl/swprintf.c @@ -575,7 +575,7 @@ int __cdecl _vsnwprintf(wchar_t *buf, size_t cnt, const wchar_t *fmt, va_list ar flags |= ZEROPAD; } str = number(str, end, - (unsigned long) va_arg(args, void *), 16, + (ULONG_PTR) va_arg(args, void *), 16, field_width, precision, flags); continue; diff --git a/reactos/lib/sdk/crt/process/_system.c b/reactos/lib/sdk/crt/process/_system.c index 94bbe7fcda4..f6173db03c6 100644 --- a/reactos/lib/sdk/crt/process/_system.c +++ b/reactos/lib/sdk/crt/process/_system.c @@ -108,7 +108,7 @@ int system(const char *command) CloseHandle(ProcessInformation.hThread); // system should wait untill the calling process is finished - _cwait(&nStatus,(int)ProcessInformation.hProcess,0); + _cwait(&nStatus,(intptr_t)ProcessInformation.hProcess,0); CloseHandle(ProcessInformation.hProcess); return nStatus; diff --git a/reactos/lib/sdk/crt/process/process.c b/reactos/lib/sdk/crt/process/process.c index 24b97408fdc..99b3208ea87 100644 --- a/reactos/lib/sdk/crt/process/process.c +++ b/reactos/lib/sdk/crt/process/process.c @@ -182,7 +182,7 @@ valisttosT(const _TCHAR* arg0, va_list alist, _TCHAR delim) return str; } -static int +static intptr_t do_spawnT(int mode, const _TCHAR* cmdname, const _TCHAR* args, const _TCHAR* envp) { STARTUPINFO StartupInfo = {0}; @@ -304,7 +304,7 @@ do_spawnT(int mode, const _TCHAR* cmdname, const _TCHAR* args, const _TCHAR* env { case _P_NOWAIT: case _P_NOWAITO: - return((int)ProcessInformation.hProcess); + return((intptr_t)ProcessInformation.hProcess); case _P_OVERLAY: CloseHandle(ProcessInformation.hProcess); _exit(0); @@ -317,7 +317,7 @@ do_spawnT(int mode, const _TCHAR* cmdname, const _TCHAR* args, const _TCHAR* env CloseHandle(ProcessInformation.hProcess); return( 0); } - return( (int)ProcessInformation.hProcess); + return( (intptr_t)ProcessInformation.hProcess); } /* diff --git a/reactos/lib/sdk/crt/string/ctype.c b/reactos/lib/sdk/crt/string/ctype.c index 9a74204d75e..46870724404 100644 --- a/reactos/lib/sdk/crt/string/ctype.c +++ b/reactos/lib/sdk/crt/string/ctype.c @@ -1,4 +1,6 @@ #include +#undef __MINGW_IMPORT +#define __MINGW_IMPORT #include #undef _pctype diff --git a/reactos/lib/sdk/scrnsave/scrnsave.c b/reactos/lib/sdk/scrnsave/scrnsave.c index 72b8d3d483a..8438587e3a9 100644 --- a/reactos/lib/sdk/scrnsave/scrnsave.c +++ b/reactos/lib/sdk/scrnsave/scrnsave.c @@ -36,10 +36,10 @@ static int ISSPACE(TCHAR c) #define ISNUM(c) ((c) >= '0' && c <= '9') -static unsigned long _toul(const TCHAR *s) +static ULONG_PTR _toulptr(const TCHAR *s) { - unsigned long res; - unsigned long n; + ULONG_PTR res; + ULONG_PTR n; const TCHAR *p; for (p = s; *p; p++) @@ -223,7 +223,7 @@ int APIENTRY _tWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPTSTR CmdLine, int fChildPreview = TRUE; while (ISSPACE(*++p)); - hParent = (HWND) _toul(p); + hParent = (HWND) _toulptr(p); if (hParent && IsWindow(hParent)) return LaunchScreenSaver(hParent);