From ff091bdac59dddbb37c3c258089cb6bfda88d8f7 Mon Sep 17 00:00:00 2001 From: Dmitry Gorbachev Date: Wed, 3 Dec 2008 17:33:13 +0000 Subject: [PATCH] Silence compiler warnings (7/11). svn path=/trunk/; revision=37829 --- reactos/dll/cpl/console/colors.c | 6 +++--- reactos/dll/cpl/console/layout.c | 2 +- reactos/dll/cpl/main/mouse.c | 2 +- reactos/dll/cpl/timedate/ntpclient.c | 2 +- reactos/dll/ntdll/rtl/version.c | 2 +- reactos/dll/win32/kernel32/file/dir.c | 8 ++++---- reactos/dll/win32/kernel32/file/file.c | 2 +- reactos/dll/win32/kernel32/file/mailslot.c | 2 +- reactos/dll/win32/kernel32/file/npipe.c | 2 +- reactos/dll/win32/kernel32/file/volume.c | 2 +- reactos/dll/win32/kernel32/misc/muldiv.c | 2 +- reactos/dll/win32/kernel32/misc/profile.c | 2 +- reactos/dll/win32/kernel32/misc/time.c | 2 +- reactos/dll/win32/kernel32/process/procsup.c | 2 +- reactos/dll/win32/kernel32/thread/tls.c | 4 ++-- reactos/dll/win32/netcfgx/netcfg_iface.c | 2 +- reactos/dll/win32/netcfgx/tcpipconf_notify.c | 2 +- reactos/dll/win32/netshell/connectmanager.c | 2 +- reactos/dll/win32/netshell/lanconnectui.c | 4 ++-- reactos/dll/win32/netshell/shfldr_netconnect.c | 10 +++++----- reactos/dll/win32/opengl32/opengl32.c | 6 +++--- reactos/dll/win32/userenv/directory.c | 2 +- reactos/dll/win32/userenv/profile.c | 2 +- reactos/dll/win32/userenv/setup.c | 2 ++ 24 files changed, 38 insertions(+), 36 deletions(-) diff --git a/reactos/dll/cpl/console/colors.c b/reactos/dll/cpl/console/colors.c index 25fa28ac64d..3b833255cb4 100644 --- a/reactos/dll/cpl/console/colors.c +++ b/reactos/dll/cpl/console/colors.c @@ -116,7 +116,7 @@ ColorsProc( break; } - if (red == -1) + if (red == -1U) { red = SendMessage(GetDlgItem(hwndDlg, IDC_UPDOWN_COLOR_RED), UDM_GETPOS, 0, 0); if (HIWORD(red)) @@ -127,7 +127,7 @@ ColorsProc( red = LOBYTE(red); } - if (green == -1) + if (green == -1U) { green = SendMessage(GetDlgItem(hwndDlg, IDC_UPDOWN_COLOR_GREEN), UDM_GETPOS, 0, 0); if (HIWORD(green)) @@ -138,7 +138,7 @@ ColorsProc( green = LOBYTE(green); } - if (blue == -1) + if (blue == -1U) { blue = SendMessage(GetDlgItem(hwndDlg, IDC_UPDOWN_COLOR_BLUE), UDM_GETPOS, 0, 0); if (HIWORD(blue)) diff --git a/reactos/dll/cpl/console/layout.c b/reactos/dll/cpl/console/layout.c index afa0a6771ef..989707550a8 100644 --- a/reactos/dll/cpl/console/layout.c +++ b/reactos/dll/cpl/console/layout.c @@ -160,7 +160,7 @@ LayoutProc( SendMessage(GetDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_LEFT), UDM_SETRANGE, 0, (LPARAM)MAKELONG(xres, 0)); SendMessage(GetDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_TOP), UDM_SETRANGE, 0, (LPARAM)MAKELONG(yres, 0)); - if (pConInfo->WindowPosition != -1) + if (pConInfo->WindowPosition != -1U) { SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, LOWORD(pConInfo->WindowPosition), FALSE); SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_TOP, HIWORD(pConInfo->WindowPosition), FALSE); diff --git a/reactos/dll/cpl/main/mouse.c b/reactos/dll/cpl/main/mouse.c index e7dde62f9c7..8fbdc6b999a 100644 --- a/reactos/dll/cpl/main/mouse.c +++ b/reactos/dll/cpl/main/mouse.c @@ -969,7 +969,7 @@ OnDrawItem(UINT idCtl, GetSysColor(COLOR_WINDOWTEXT)); } - if (lpdis->itemID != -1) + if (lpdis->itemID != -1U) { CopyRect(&rc, &lpdis->rcItem); rc.left += 5; diff --git a/reactos/dll/cpl/timedate/ntpclient.c b/reactos/dll/cpl/timedate/ntpclient.c index f2ed06cae0f..b52d4ff0d7c 100644 --- a/reactos/dll/cpl/timedate/ntpclient.c +++ b/reactos/dll/cpl/timedate/ntpclient.c @@ -75,7 +75,7 @@ GetTransmitTime(PTIMEPACKET ptp) static BOOL SendData(PINFO pInfo) { - TIMEPACKET tp = {0,}; + TIMEPACKET tp = { 0, 0 }; INT Ret; ZeroMemory(&pInfo->SendPacket, sizeof(pInfo->SendPacket)); diff --git a/reactos/dll/ntdll/rtl/version.c b/reactos/dll/ntdll/rtl/version.c index e8a39b23ec8..c55db1a252a 100644 --- a/reactos/dll/ntdll/rtl/version.c +++ b/reactos/dll/ntdll/rtl/version.c @@ -104,7 +104,7 @@ RtlGetNtVersionNumbers(LPDWORD major, LPDWORD minor, LPDWORD build) NTSTATUS NTAPI RtlGetVersion(RTL_OSVERSIONINFOW *Info) { - ULONG i, MaxLength; + LONG i, MaxLength; if (Info->dwOSVersionInfoSize == sizeof(RTL_OSVERSIONINFOW) || Info->dwOSVersionInfoSize == sizeof(RTL_OSVERSIONINFOEXW)) diff --git a/reactos/dll/win32/kernel32/file/dir.c b/reactos/dll/win32/kernel32/file/dir.c index 3eb1f0eaa0b..928f8a3bbb5 100644 --- a/reactos/dll/win32/kernel32/file/dir.c +++ b/reactos/dll/win32/kernel32/file/dir.c @@ -830,10 +830,10 @@ SearchPathA ( LPSTR *lpFilePart ) { - UNICODE_STRING PathU = {0}; - UNICODE_STRING FileNameU = {0}; - UNICODE_STRING ExtensionU = {0}; - UNICODE_STRING BufferU = {0}; + UNICODE_STRING PathU = { 0, 0, NULL }; + UNICODE_STRING FileNameU = { 0, 0, NULL }; + UNICODE_STRING ExtensionU = { 0, 0, NULL }; + UNICODE_STRING BufferU = { 0, 0, NULL }; ANSI_STRING Path; ANSI_STRING FileName; ANSI_STRING Extension; diff --git a/reactos/dll/win32/kernel32/file/file.c b/reactos/dll/win32/kernel32/file/file.c index a0b84cfe49a..f457604e010 100644 --- a/reactos/dll/win32/kernel32/file/file.c +++ b/reactos/dll/win32/kernel32/file/file.c @@ -479,7 +479,7 @@ SetFilePointer(HANDLE hFile, *lpDistanceToMoveHigh = FilePosition.CurrentByteOffset.u.HighPart; } - if (FilePosition.CurrentByteOffset.u.LowPart == -1) + if (FilePosition.CurrentByteOffset.u.LowPart == -1U) { /* The value of -1 is valid here, especially when the new file position is greater than 4 GB. Since NtSetInformationFile diff --git a/reactos/dll/win32/kernel32/file/mailslot.c b/reactos/dll/win32/kernel32/file/mailslot.c index 5b9237bbf45..91441a5c778 100644 --- a/reactos/dll/win32/kernel32/file/mailslot.c +++ b/reactos/dll/win32/kernel32/file/mailslot.c @@ -165,7 +165,7 @@ GetMailslotInfo(HANDLE hMailslot, if (lpReadTimeout != NULL) { if (Buffer.ReadTimeout.LowPart == 0 && - Buffer.ReadTimeout.HighPart == 0x80000000) + Buffer.ReadTimeout.HighPart == (LONG)0x80000000) *lpReadTimeout = MAILSLOT_WAIT_FOREVER; else *lpReadTimeout = (DWORD)(Buffer.ReadTimeout.QuadPart / -10000); diff --git a/reactos/dll/win32/kernel32/file/npipe.c b/reactos/dll/win32/kernel32/file/npipe.c index 0cdf2d85bb9..ec68156f180 100644 --- a/reactos/dll/win32/kernel32/file/npipe.c +++ b/reactos/dll/win32/kernel32/file/npipe.c @@ -952,7 +952,7 @@ GetNamedPipeHandleStateA(HANDLE hNamedPipe, LPSTR lpUserName, DWORD nMaxUserNameSize) { - UNICODE_STRING UserNameW = {0}; + UNICODE_STRING UserNameW = { 0, 0, NULL }; ANSI_STRING UserNameA; BOOL Ret; diff --git a/reactos/dll/win32/kernel32/file/volume.c b/reactos/dll/win32/kernel32/file/volume.c index dd1a6b65e2d..7061f9193ae 100644 --- a/reactos/dll/win32/kernel32/file/volume.c +++ b/reactos/dll/win32/kernel32/file/volume.c @@ -495,7 +495,7 @@ GetVolumeInformationA( ) { UNICODE_STRING FileSystemNameU; - UNICODE_STRING VolumeNameU = {0}; + UNICODE_STRING VolumeNameU = { 0, 0, NULL }; ANSI_STRING VolumeName; ANSI_STRING FileSystemName; PWCHAR RootPathNameW; diff --git a/reactos/dll/win32/kernel32/misc/muldiv.c b/reactos/dll/win32/kernel32/misc/muldiv.c index 3a64f7f1472..f1147467a55 100644 --- a/reactos/dll/win32/kernel32/misc/muldiv.c +++ b/reactos/dll/win32/kernel32/misc/muldiv.c @@ -53,7 +53,7 @@ MulDiv(INT nNumber, /* Do the sign changes */ if ((LONG)Result.LowPart >= 0) { - return (Negative >= 0) ? Result.LowPart : -(LONG)Result.LowPart; + return (Negative >= 0) ? (LONG)Result.LowPart : -(LONG)Result.LowPart; } } diff --git a/reactos/dll/win32/kernel32/misc/profile.c b/reactos/dll/win32/kernel32/misc/profile.c index a529a3737d1..ea3e08dffbf 100644 --- a/reactos/dll/win32/kernel32/misc/profile.c +++ b/reactos/dll/win32/kernel32/misc/profile.c @@ -76,7 +76,7 @@ static RTL_CRITICAL_SECTION_DEBUG critsect_debug = { 0, 0, &PROFILE_CritSect, { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, 0, 0 + 0, 0, 0, 0, 0 }; static RTL_CRITICAL_SECTION PROFILE_CritSect = { &critsect_debug, -1, 0, 0, 0, 0 }; diff --git a/reactos/dll/win32/kernel32/misc/time.c b/reactos/dll/win32/kernel32/misc/time.c index 30bba6e655e..93ce6f5f27b 100644 --- a/reactos/dll/win32/kernel32/misc/time.c +++ b/reactos/dll/win32/kernel32/misc/time.c @@ -250,7 +250,7 @@ FileTimeToDosDateTime( { PDOSTIME pdtime=(PDOSTIME) lpFatTime; PDOSDATE pddate=(PDOSDATE) lpFatDate; - SYSTEMTIME SystemTime = { 0 }; + SYSTEMTIME SystemTime = { 0, 0, 0, 0, 0, 0, 0, 0 }; if ( lpFileTime == NULL ) return FALSE; diff --git a/reactos/dll/win32/kernel32/process/procsup.c b/reactos/dll/win32/kernel32/process/procsup.c index 14fb7adcb6a..7b8bafbb84b 100644 --- a/reactos/dll/win32/kernel32/process/procsup.c +++ b/reactos/dll/win32/kernel32/process/procsup.c @@ -639,7 +639,7 @@ CreateProcessInternalW(HANDLE hToken, BOOLEAN FoundQuotes = FALSE; BOOLEAN QuotesNeeded = FALSE; BOOLEAN CmdLineIsAppName = FALSE; - UNICODE_STRING ApplicationName = {0}; + UNICODE_STRING ApplicationName = { 0, 0, NULL }; OBJECT_ATTRIBUTES LocalObjectAttributes; POBJECT_ATTRIBUTES ObjectAttributes; HANDLE hSection = NULL, hProcess = NULL, hThread = NULL, hDebug = NULL; diff --git a/reactos/dll/win32/kernel32/thread/tls.c b/reactos/dll/win32/kernel32/thread/tls.c index 10d68db4e85..b6fc73d8b00 100644 --- a/reactos/dll/win32/kernel32/thread/tls.c +++ b/reactos/dll/win32/kernel32/thread/tls.c @@ -31,11 +31,11 @@ TlsAlloc(VOID) /* Try to get regular TEB slot. */ Index = RtlFindClearBitsAndSet(NtCurrentPeb()->TlsBitmap, 1, 0); - if (Index == ~0) + if (Index == ~0U) { /* If it fails, try to find expansion TEB slot. */ Index = RtlFindClearBitsAndSet(NtCurrentPeb()->TlsExpansionBitmap, 1, 0); - if (Index != ~0) + if (Index != ~0U) { if (NtCurrentTeb()->TlsExpansionSlots == NULL) { diff --git a/reactos/dll/win32/netcfgx/netcfg_iface.c b/reactos/dll/win32/netcfgx/netcfg_iface.c index 6a131ea7042..845bf7213ac 100644 --- a/reactos/dll/win32/netcfgx/netcfg_iface.c +++ b/reactos/dll/win32/netcfgx/netcfg_iface.c @@ -14,7 +14,7 @@ typedef struct NetCfgComponentItem * pProtocol; } INetCfgImpl, *LPINetCfgImpl; -static LPINetCfgImpl __inline impl_from_INetCfgLock(INetCfgLock *iface) +static __inline LPINetCfgImpl impl_from_INetCfgLock(INetCfgLock *iface) { return (INetCfgImpl*)((char *)iface - FIELD_OFFSET(INetCfgImpl, lpVtblLock)); } diff --git a/reactos/dll/win32/netcfgx/tcpipconf_notify.c b/reactos/dll/win32/netcfgx/tcpipconf_notify.c index 87eba1089e5..5145cdb0eaa 100644 --- a/reactos/dll/win32/netcfgx/tcpipconf_notify.c +++ b/reactos/dll/win32/netcfgx/tcpipconf_notify.c @@ -107,7 +107,7 @@ typedef struct UINT MaxNum; }TcpipPortSettings; -static LPTcpipConfNotifyImpl __inline impl_from_INetCfgComponentControl(INetCfgComponentControl *iface) +static __inline LPTcpipConfNotifyImpl impl_from_INetCfgComponentControl(INetCfgComponentControl *iface) { return (TcpipConfNotifyImpl*)((char *)iface - FIELD_OFFSET(TcpipConfNotifyImpl, lpVtblCompControl)); } diff --git a/reactos/dll/win32/netshell/connectmanager.c b/reactos/dll/win32/netshell/connectmanager.c index 726dee7c768..a0d4da69df6 100644 --- a/reactos/dll/win32/netshell/connectmanager.c +++ b/reactos/dll/win32/netshell/connectmanager.c @@ -26,7 +26,7 @@ typedef struct } INetConnectionImpl, *LPINetConnectionImpl; -static LPINetConnectionManagerImpl __inline impl_from_EnumNetConnection(IEnumNetConnection *iface) +static __inline LPINetConnectionManagerImpl impl_from_EnumNetConnection(IEnumNetConnection *iface) { return (LPINetConnectionManagerImpl)((char *)iface - FIELD_OFFSET(INetConnectionManagerImpl, lpVtblNetConnection)); } diff --git a/reactos/dll/win32/netshell/lanconnectui.c b/reactos/dll/win32/netshell/lanconnectui.c index 32d30c369ef..1e4b9ce7fa4 100644 --- a/reactos/dll/win32/netshell/lanconnectui.c +++ b/reactos/dll/win32/netshell/lanconnectui.c @@ -32,12 +32,12 @@ typedef struct LONG ref; }INetConnectionPropertyUiImpl, *LPINetConnectionPropertyUiImpl; -static LPINetConnectionPropertyUiImpl __inline impl_from_NetLanConnectionUiInfo(INetLanConnectionUiInfo *iface) +static __inline LPINetConnectionPropertyUiImpl impl_from_NetLanConnectionUiInfo(INetLanConnectionUiInfo *iface) { return (LPINetConnectionPropertyUiImpl)((char *)iface - FIELD_OFFSET(INetConnectionPropertyUiImpl, lpLanConUiInfoVtbl)); } -static LPINetConnectionPropertyUiImpl __inline impl_from_NetConnectionConnectUi(INetConnectionConnectUi *iface) +static __inline LPINetConnectionPropertyUiImpl impl_from_NetConnectionConnectUi(INetConnectionConnectUi *iface) { return (LPINetConnectionPropertyUiImpl)((char *)iface - FIELD_OFFSET(INetConnectionPropertyUiImpl, lpNetConnectionConnectUi)); } diff --git a/reactos/dll/win32/netshell/shfldr_netconnect.c b/reactos/dll/win32/netshell/shfldr_netconnect.c index 5838c3c85fb..4c602270384 100644 --- a/reactos/dll/win32/netshell/shfldr_netconnect.c +++ b/reactos/dll/win32/netshell/shfldr_netconnect.c @@ -79,28 +79,28 @@ static const IObjectWithSiteVtbl vt_ObjectWithSite; static const IQueryInfoVtbl vt_QueryInfo; static const IExtractIconWVtbl vt_ExtractIconW; -static LPIContextMenuImpl __inline impl_from_IExtractIcon(IExtractIconW *iface) +static __inline LPIContextMenuImpl impl_from_IExtractIcon(IExtractIconW *iface) { return (LPIContextMenuImpl)((char *)iface - FIELD_OFFSET(IContextMenuImpl, lpVtblExtractIconW)); } -static LPIContextMenuImpl __inline impl_from_IObjectWithSite(IObjectWithSite *iface) +static __inline LPIContextMenuImpl impl_from_IObjectWithSite(IObjectWithSite *iface) { return (LPIContextMenuImpl)((char *)iface - FIELD_OFFSET(IContextMenuImpl, lpVtblObjectWithSite)); } -static LPIGenericSFImpl __inline impl_from_IPersistFolder2(IPersistFolder2 *iface) +static __inline LPIGenericSFImpl impl_from_IPersistFolder2(IPersistFolder2 *iface) { return (LPIGenericSFImpl)((char *)iface - FIELD_OFFSET(IGenericSFImpl, lpVtblPersistFolder2)); } -static LPIGenericSFImpl __inline impl_from_IShellExecuteHookW(IShellExecuteHookW *iface) +static __inline LPIGenericSFImpl impl_from_IShellExecuteHookW(IShellExecuteHookW *iface) { return (LPIGenericSFImpl)((char *)iface - FIELD_OFFSET(IGenericSFImpl, lpVtblShellExecuteHookW)); } -static LPIContextMenuImpl __inline impl_from_IQueryInfo(IQueryInfo *iface) +static __inline LPIContextMenuImpl impl_from_IQueryInfo(IQueryInfo *iface) { return (LPIContextMenuImpl)((char *)iface - FIELD_OFFSET(IContextMenuImpl, lpVtblQueryInfo)); } diff --git a/reactos/dll/win32/opengl32/opengl32.c b/reactos/dll/win32/opengl32/opengl32.c index 0f124929b71..66f95a8edd1 100644 --- a/reactos/dll/win32/opengl32/opengl32.c +++ b/reactos/dll/win32/opengl32/opengl32.c @@ -21,7 +21,7 @@ static DWORD OPENGL32_RegGetDriverInfo( LPCWSTR driver, GLDRIVERDATA *icd ); /* global vars */ /* Do not assume it have the free value -1 set, any value can be in here */ -DWORD OPENGL32_tls = -1; +DWORD OPENGL32_tls = -1U; GLPROCESSDATA OPENGL32_processdata; @@ -103,7 +103,7 @@ OPENGL32_ProcessAttach() TRUE /* bInheritHandle */ }; OPENGL32_tls = TlsAlloc(); - if (-1 == OPENGL32_tls) + if (-1U == OPENGL32_tls) return FALSE; memset( &OPENGL32_processdata, 0, sizeof (OPENGL32_processdata) ); @@ -179,7 +179,7 @@ OPENGL32_ProcessDetach() CloseHandle( OPENGL32_processdata.dcdata_mutex ); /* free TLS */ - if (OPENGL32_tls != -1) + if (OPENGL32_tls != -1U) TlsFree(OPENGL32_tls); } diff --git a/reactos/dll/win32/userenv/directory.c b/reactos/dll/win32/userenv/directory.c index 3bb4dd2f3a7..3c841bf99c2 100644 --- a/reactos/dll/win32/userenv/directory.c +++ b/reactos/dll/win32/userenv/directory.c @@ -169,7 +169,7 @@ CopyDirectory (LPCWSTR lpDestinationPath, FindClose (hFind); - DPRINT ("Copy Directory() done\n"); + DPRINT ("CopyDirectory() done\n"); return TRUE; } diff --git a/reactos/dll/win32/userenv/profile.c b/reactos/dll/win32/userenv/profile.c index 0bd88b48df3..7f49021dd78 100644 --- a/reactos/dll/win32/userenv/profile.c +++ b/reactos/dll/win32/userenv/profile.c @@ -912,7 +912,7 @@ LoadUserProfileW( DWORD UserNameLength = 0, DomainLength = 0; PTOKEN_USER UserSid = NULL; SID_NAME_USE AccountType; - UNICODE_STRING SidString = { 0, }; + UNICODE_STRING SidString = { 0, 0, NULL }; LONG Error; BOOL ret = FALSE; DWORD dwLength = sizeof(szUserHivePath) / sizeof(szUserHivePath[0]); diff --git a/reactos/dll/win32/userenv/setup.c b/reactos/dll/win32/userenv/setup.c index 7397fd612aa..47599415e58 100644 --- a/reactos/dll/win32/userenv/setup.c +++ b/reactos/dll/win32/userenv/setup.c @@ -114,6 +114,8 @@ InitializeProfiles (VOID) HKEY hKey; LONG Error; + DPRINT("InitializeProfiles()\n"); + /* Load profiles directory path */ if (!LoadStringW(hInstance, IDS_PROFILEPATH,