From 95e952c388d14ba919bf973aaef64ccee3127cd9 Mon Sep 17 00:00:00 2001 From: Roel Messiant Date: Tue, 21 Dec 2010 00:41:52 +0000 Subject: [PATCH] [CLASSPNP] - Use correct type in sizeof expression (CID 1646 and 10401). - Simplify signature define (CID 3653 and 3654). - Remove funky 0xFF characters. svn path=/trunk/; revision=50076 --- reactos/drivers/storage/classpnp/dictlib.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/reactos/drivers/storage/classpnp/dictlib.c b/reactos/drivers/storage/classpnp/dictlib.c index ba479fe9b52..310b227e0f0 100644 --- a/reactos/drivers/storage/classpnp/dictlib.c +++ b/reactos/drivers/storage/classpnp/dictlib.c @@ -26,30 +26,27 @@ Revision History: #include #include -#define DICTIONARY_SIGNATURE (((ULONG)'dict' << 32) + 'sig ') +#define DICTIONARY_SIGNATURE 'dsig' -struct _DICTIONARY_HEADER { +typedef struct _DICTIONARY_HEADER { struct _DICTIONARY_HEADER* Next; ULONGLONG Key; UCHAR Data[0]; -}; +} DICTIONARY_HEADER, *PDICTIONARY_HEADER; -struct _DICTIONARY_HEADER; -typedef struct _DICTIONARY_HEADER DICTIONARY_HEADER, *PDICTIONARY_HEADER; - VOID InitializeDictionary( IN PDICTIONARY Dictionary ) { - RtlZeroMemory(Dictionary, sizeof(Dictionary)); + RtlZeroMemory(Dictionary, sizeof(DICTIONARY)); Dictionary->Signature = DICTIONARY_SIGNATURE; KeInitializeSpinLock(&Dictionary->SpinLock); return; } - + BOOLEAN TestDictionarySignature( IN PDICTIONARY Dictionary @@ -136,7 +133,7 @@ AllocateDictionaryEntry( return status; } - + PVOID GetDictionaryEntry( IN PDICTIONARY Dictionary, @@ -168,7 +165,7 @@ GetDictionaryEntry( return data; } - + VOID FreeDictionaryEntry( IN PDICTIONARY Dictionary,