From 120359ef8e77b97248c29b9018ae8030ad03e821 Mon Sep 17 00:00:00 2001 From: Dmitry Gorbachev Date: Wed, 3 Dec 2008 17:32:36 +0000 Subject: [PATCH] Silence compiler warnings (6/11). svn path=/trunk/; revision=37828 --- reactos/lib/3rdparty/mingw/gccmain.c | 2 +- reactos/lib/cmlib/hivecell.c | 8 ++++---- reactos/lib/cmlib/hivedata.h | 2 +- reactos/lib/cmlib/hivewrt.c | 6 +++--- reactos/lib/drivers/ip/network/ip.c | 3 +-- reactos/lib/rtl/debug.c | 5 +++-- reactos/lib/sdk/crt/wine/heap.c | 2 +- reactos/lib/smlib/lookupss.c | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/reactos/lib/3rdparty/mingw/gccmain.c b/reactos/lib/3rdparty/mingw/gccmain.c index 0888741ff09..21a150e7289 100644 --- a/reactos/lib/3rdparty/mingw/gccmain.c +++ b/reactos/lib/3rdparty/mingw/gccmain.c @@ -46,7 +46,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 == -1) + if (nptrs == (unsigned long) -1) { for (nptrs = 0; __CTOR_LIST__[nptrs + 1] != 0; nptrs++); } diff --git a/reactos/lib/cmlib/hivecell.c b/reactos/lib/cmlib/hivecell.c index c87ba71b48d..845daaaa3dc 100644 --- a/reactos/lib/cmlib/hivecell.c +++ b/reactos/lib/cmlib/hivecell.c @@ -9,7 +9,7 @@ #define NDEBUG #include -static PHCELL __inline CMAPI +static __inline PHCELL CMAPI HvpGetCellHeader( PHHIVE RegistryHive, HCELL_INDEX CellIndex) @@ -74,7 +74,7 @@ HvGetCell( return (PVOID)(HvpGetCellHeader(RegistryHive, CellIndex) + 1); } -static LONG __inline CMAPI +static __inline LONG CMAPI HvpGetCellFullSize( PHHIVE RegistryHive, PVOID Cell) @@ -141,7 +141,7 @@ HvIsCellDirty(IN PHHIVE Hive, return IsDirty; } -static ULONG __inline CMAPI +static __inline ULONG CMAPI HvpComputeFreeListIndex( ULONG Size) { @@ -424,7 +424,7 @@ HvReallocateCell( * FIXME: Merge with adjacent free cell if possible. * FIXME: Implement shrinking. */ - if (Size > OldCellSize) + if (Size > (ULONG)OldCellSize) { NewCellIndex = HvAllocateCell(RegistryHive, Size, Storage, HCELL_NIL); if (NewCellIndex == HCELL_NIL) diff --git a/reactos/lib/cmlib/hivedata.h b/reactos/lib/cmlib/hivedata.h index adfd9824904..bd5e025c7e4 100644 --- a/reactos/lib/cmlib/hivedata.h +++ b/reactos/lib/cmlib/hivedata.h @@ -80,7 +80,7 @@ typedef ULONG HCELL_INDEX, *PHCELL_INDEX; // // Cell Magic Values // -#define HCELL_NIL -1 +#define HCELL_NIL -1U #define HCELL_CACHED 1 #define HCELL_TYPE_MASK 0x80000000 diff --git a/reactos/lib/cmlib/hivewrt.c b/reactos/lib/cmlib/hivewrt.c index 33a2d7aabb9..a4e3d3c3ccc 100644 --- a/reactos/lib/cmlib/hivewrt.c +++ b/reactos/lib/cmlib/hivewrt.c @@ -79,7 +79,7 @@ HvpWriteLog( { LastIndex = BlockIndex; BlockIndex = RtlFindSetBits(&RegistryHive->DirtyVector, 1, BlockIndex); - if (BlockIndex == ~0 || BlockIndex < LastIndex) + if (BlockIndex == ~0U || BlockIndex < LastIndex) { break; } @@ -182,7 +182,7 @@ HvpWriteHive( { LastIndex = BlockIndex; BlockIndex = RtlFindSetBits(&RegistryHive->DirtyVector, 1, BlockIndex); - if (BlockIndex == ~0 || BlockIndex < LastIndex) + if (BlockIndex == ~0U || BlockIndex < LastIndex) { break; } @@ -239,7 +239,7 @@ HvSyncHive( { ASSERT(RegistryHive->ReadOnly == FALSE); - if (RtlFindSetBits(&RegistryHive->DirtyVector, 1, 0) == ~0) + if (RtlFindSetBits(&RegistryHive->DirtyVector, 1, 0) == ~0U) { return TRUE; } diff --git a/reactos/lib/drivers/ip/network/ip.c b/reactos/lib/drivers/ip/network/ip.c index b910258be5c..d1529f3aa1d 100644 --- a/reactos/lib/drivers/ip/network/ip.c +++ b/reactos/lib/drivers/ip/network/ip.c @@ -150,8 +150,7 @@ VOID IPDispatchProtocol( Protocol = 0; } - if (Protocol < IP_PROTOCOL_TABLE_SIZE && - Protocol >= 0) + if (Protocol < IP_PROTOCOL_TABLE_SIZE) { /* Call the appropriate protocol handler */ (*ProtocolTable[Protocol])(Interface, IPPacket); diff --git a/reactos/lib/rtl/debug.c b/reactos/lib/rtl/debug.c index cbf291c06b4..9470fe819e1 100644 --- a/reactos/lib/rtl/debug.c +++ b/reactos/lib/rtl/debug.c @@ -61,7 +61,8 @@ vDbgPrintExWithPrefixInternal(IN LPCSTR Prefix, EXCEPTION_RECORD ExceptionRecord; /* Check if we should print it or not */ - if ((ComponentId != -1) && !(NtQueryDebugFilterState(ComponentId, Level))) + if ((ComponentId != -1U) && + !(NtQueryDebugFilterState(ComponentId, Level))) { /* This message is masked */ return Status; @@ -96,7 +97,7 @@ vDbgPrintExWithPrefixInternal(IN LPCSTR Prefix, if (!NT_SUCCESS(Status)) return Status; /* Check if we went past the buffer */ - if (Length == -1) + if (Length == -1U) { /* Terminate it if we went over-board */ Buffer[sizeof(Buffer) - 1] = '\n'; diff --git a/reactos/lib/sdk/crt/wine/heap.c b/reactos/lib/sdk/crt/wine/heap.c index d183ebc3273..daabff8babb 100644 --- a/reactos/lib/sdk/crt/wine/heap.c +++ b/reactos/lib/sdk/crt/wine/heap.c @@ -255,7 +255,7 @@ void * CDECL _aligned_offset_realloc(void *memblock, size_t size, /* Get previous size of block */ old_size = _msize(*saved); - if (old_size == -1) + if (old_size == (size_t)-1) { /* It seems this function was called with an invalid pointer. Bail out. */ return NULL; diff --git a/reactos/lib/smlib/lookupss.c b/reactos/lib/smlib/lookupss.c index cfd1134f7bb..8a3e6b6223c 100644 --- a/reactos/lib/smlib/lookupss.c +++ b/reactos/lib/smlib/lookupss.c @@ -36,7 +36,7 @@ SmLookupSubsystem (IN PWSTR Name, IN PVOID Environment OPTIONAL) { NTSTATUS Status = STATUS_SUCCESS; - UNICODE_STRING usKeyName = {0}; + UNICODE_STRING usKeyName = { 0, 0, NULL }; OBJECT_ATTRIBUTES Oa = {0}; HANDLE hKey = (HANDLE) 0; @@ -62,7 +62,7 @@ SmLookupSubsystem (IN PWSTR Name, & Oa); if(NT_SUCCESS(Status)) { - UNICODE_STRING usValueName = {0}; + UNICODE_STRING usValueName = { 0, 0, NULL }; PWCHAR KeyValueInformation = NULL; ULONG KeyValueInformationLength = 1024; ULONG ResultLength = 0L;