Author: ion
Date: Fri Mar 2 10:21:33 2007
New Revision: 25943
URL:
http://svn.reactos.org/svn/reactos?rev=25943&view=rev
Log:
- Fix some rtl warnings on /W3.
Modified:
trunk/reactos/lib/rtl/atom.c
trunk/reactos/lib/rtl/critical.c
trunk/reactos/lib/rtl/debug.c
trunk/reactos/lib/rtl/largeint.c
trunk/reactos/lib/rtl/unicodeprefix.c
Modified: trunk/reactos/lib/rtl/atom.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/atom.c?rev=25943&a…
==============================================================================
--- trunk/reactos/lib/rtl/atom.c (original)
+++ trunk/reactos/lib/rtl/atom.c Fri Mar 2 10:21:33 2007
@@ -366,7 +366,7 @@
Entry->ReferenceCount = 1;
Entry->Flags = 0x0;
- Entry->NameLength = AtomNameLen;
+ Entry->NameLength = (UCHAR)AtomNameLen;
RtlCopyMemory(Entry->Name,
AtomName,
(AtomNameLen + 1) * sizeof(WCHAR));
Modified: trunk/reactos/lib/rtl/critical.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/critical.c?rev=259…
==============================================================================
--- trunk/reactos/lib/rtl/critical.c (original)
+++ trunk/reactos/lib/rtl/critical.c Fri Mar 2 10:21:33 2007
@@ -65,9 +65,9 @@
}
DPRINT("Created Event: %p \n", hNewEvent);
- if ((hEvent =
_InterlockedCompareExchangePointer((PVOID*)&CriticalSection->LockSemaphore,
- (PVOID)hNewEvent,
- 0))) {
+ if ((hEvent =
(HANDLE)_InterlockedCompareExchange((PLONG)&CriticalSection->LockSemaphore,
+ (LONG)hNewEvent,
+ 0))) {
/* Some just created an event */
DPRINT("Closing already created event: %p\n", hNewEvent);
Modified: trunk/reactos/lib/rtl/debug.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/debug.c?rev=25943&…
==============================================================================
--- trunk/reactos/lib/rtl/debug.c (original)
+++ trunk/reactos/lib/rtl/debug.c Fri Mar 2 10:21:33 2007
@@ -111,7 +111,7 @@
}
/* Update length */
- DebugString.Length += Length;
+ DebugString.Length += (USHORT)Length;
/* First, let the debugger know as well */
if (RtlpCheckForActiveDebugger(FALSE))
@@ -270,11 +270,11 @@
STRING Input;
/* Setup the input string */
- Input.MaximumLength = MaximumResponseLength;
+ Input.MaximumLength = (USHORT)MaximumResponseLength;
Input.Buffer = Response;
/* Setup the output string */
- Output.Length = strlen (Prompt);
+ Output.Length = strlen(Prompt);
Output.Buffer = Prompt;
/* Call the system service */
@@ -284,7 +284,7 @@
/*
* @implemented
*/
-BOOLEAN
+NTSTATUS
NTAPI
DbgQueryDebugFilterState(IN ULONG ComponentId,
IN ULONG Level)
Modified: trunk/reactos/lib/rtl/largeint.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/largeint.c?rev=259…
==============================================================================
--- trunk/reactos/lib/rtl/largeint.c (original)
+++ trunk/reactos/lib/rtl/largeint.c Fri Mar 2 10:21:33 2007
@@ -75,7 +75,7 @@
)
{
if (Remainder)
- *Remainder = Dividend.QuadPart % Divisor;
+ *Remainder = (ULONG)(Dividend.QuadPart % Divisor);
return (ULONG)(Dividend.QuadPart / Divisor);
}
@@ -128,7 +128,7 @@
LARGE_INTEGER RC;
if (Remainder)
- *Remainder = Dividend.QuadPart % Divisor;
+ *Remainder = (ULONG)(Dividend.QuadPart % Divisor);
RC.QuadPart = Dividend.QuadPart / Divisor;
Modified: trunk/reactos/lib/rtl/unicodeprefix.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/unicodeprefix.c?re…
==============================================================================
--- trunk/reactos/lib/rtl/unicodeprefix.c (original)
+++ trunk/reactos/lib/rtl/unicodeprefix.c Fri Mar 2 10:21:33 2007
@@ -25,7 +25,6 @@
/* FUNCTIONS ***************************************************************/
-static
ULONG
NTAPI
ComputeUnicodeNameLength(IN PUNICODE_STRING UnicodeName)
@@ -44,7 +43,6 @@
return NamesFound;
}
-static
RTL_GENERIC_COMPARE_RESULTS
NTAPI
CompareUnicodeStrings(IN PUNICODE_STRING Prefix,
@@ -57,7 +55,6 @@
ULONG i;
WCHAR FoundPrefix, FoundString;
PWCHAR p, p1;
- DPRINT("CompareUnicodeStrings: %wZ %wZ\n", String, Prefix);
/* Handle case noticed in npfs when Prefix = '\' and name starts with
'\' */
if ((PrefixLength == 1) &&
@@ -157,7 +154,6 @@
PUNICODE_PREFIX_TABLE_ENTRY CurrentEntry, PreviousEntry, Entry, NextEntry;
PRTL_SPLAY_LINKS SplayLinks;
RTL_GENERIC_COMPARE_RESULTS Result;
- DPRINT("RtlFindUnicodePrefix\n");
/* Find out how many names there are */
NameCount = ComputeUnicodeNameLength(FullName);
@@ -165,7 +161,7 @@
/* Find the right spot where to start looking for this entry */
PreviousEntry = (PUNICODE_PREFIX_TABLE_ENTRY)PrefixTable;
CurrentEntry = PreviousEntry->NextPrefixTree;
- while (CurrentEntry->NameLength > NameCount)
+ while (CurrentEntry->NameLength > (CSHORT)NameCount)
{
/* Not a match, move to the next entry */
PreviousEntry = CurrentEntry;
@@ -175,21 +171,17 @@
/* Loop every entry which has valid entries */
while (CurrentEntry->NameLength)
{
- DPRINT("CurrentEntry->NameLength 0x%x\n",
CurrentEntry->NameLength);
-
/* Get the splay links and loop */
SplayLinks = &CurrentEntry->Links;
while (SplayLinks)
{
/* Get the entry */
- DPRINT("SplayLinks %p\n", SplayLinks);
Entry = CONTAINING_RECORD(SplayLinks,
UNICODE_PREFIX_TABLE_ENTRY,
Links);
/* Do the comparison */
Result = CompareUnicodeStrings(Entry->Prefix, FullName, 0);
- DPRINT("Result 0x%x\n", Result);
if (Result == GenericGreaterThan)
{
/* Prefix is greater, so restart on the left child */
@@ -208,7 +200,6 @@
* NOTE: An index of 0 means case-insensitive(ie, we'll be case
* insensitive since index 0, ie, all the time)
*/
- DPRINT("CaseInsensitiveIndex %lx\n", CaseInsensitiveIndex);
if (!CaseInsensitiveIndex)
{
/*
@@ -242,7 +233,6 @@
}
/* Return the entry */
- DPRINT("RtlFindUnicodePrefix: %p\n", Entry);
return Entry;
}
@@ -258,13 +248,11 @@
(Result != GenericGreaterThan))
{
/* This is a positive match, return it */
- DPRINT("RtlFindUnicodePrefix: %p\n", NextEntry);
return NextEntry;
}
/* No match yet, continue looping the circular list */
NextEntry = NextEntry->CaseMatch;
- DPRINT("NextEntry %p\n", NextEntry);
} while (NextEntry != Entry);
/*
@@ -275,15 +263,13 @@
break;
}
- /* Splay links exausted, move to next entry */
+ /* Splay links exhausted, move to next entry */
PreviousEntry = CurrentEntry;
CurrentEntry = CurrentEntry->NextPrefixTree;
- DPRINT("CurrentEntry %p\n", CurrentEntry);
- }
-
- /* If we got here, nothing was found */
- DPRINT("RtlFindUnicodePrefix: %p\n", NULL);
- return NULL;
+ }
+
+ /* If we got here, nothing was found */
+ return NULL;
}
/*
@@ -293,7 +279,7 @@
NTAPI
RtlInitializeUnicodePrefix(PUNICODE_PREFIX_TABLE PrefixTable)
{
- /* Setup the table */
+ /* Setup the table */
PrefixTable->NameLength = 0;
PrefixTable->LastNextEntry = NULL;
PrefixTable->NodeTypeCode = PFX_NTC_TABLE;
@@ -313,20 +299,19 @@
ULONG NameCount;
RTL_GENERIC_COMPARE_RESULTS Result;
PRTL_SPLAY_LINKS SplayLinks;
- DPRINT("RtlInsertUnicodePrefix\n");
/* Find out how many names there are */
NameCount = ComputeUnicodeNameLength(Prefix);
/* Set up the initial entry data */
- PrefixTableEntry->NameLength = NameCount;
+ PrefixTableEntry->NameLength = (CSHORT)NameCount;
PrefixTableEntry->Prefix = Prefix;
RtlInitializeSplayLinks(&PrefixTableEntry->Links);
/* Find the right spot where to insert this entry */
PreviousEntry = (PUNICODE_PREFIX_TABLE_ENTRY)PrefixTable;
CurrentEntry = PreviousEntry->NextPrefixTree;
- while (CurrentEntry->NameLength > NameCount)
+ while (CurrentEntry->NameLength > (CSHORT)NameCount)
{
/* Not a match, move to the next entry */
PreviousEntry = CurrentEntry;
@@ -334,7 +319,7 @@
}
/* Check if we did find a tree by now */
- if (CurrentEntry->NameLength != NameCount)
+ if (CurrentEntry->NameLength != (CSHORT)NameCount)
{
/* We didn't, so insert a new entry in the list */
PreviousEntry->NextPrefixTree = PrefixTableEntry;
@@ -345,11 +330,10 @@
PrefixTableEntry->CaseMatch = PrefixTableEntry;
/* Quick return */
- DPRINT("RtlInsertUnicodePrefix TRUE\n");
return TRUE;
}
- /* We found a tree, so star thte search loop */
+ /* We found a tree, so start the search loop */
Entry = CurrentEntry;
while (TRUE)
{
@@ -368,7 +352,6 @@
(GenericEqual))
{
/* We must fail the insert: it already exists */
- DPRINT("RtlInsertUnicodePrefix FALSE\n");
return FALSE;
}
@@ -461,8 +444,7 @@
Entry->NextPrefixTree = NextEntry;
/* Return success */
- DPRINT("RtlInsertUnicodePrefix TRUE\n");
- return TRUE;
+ return TRUE;
}
/*
@@ -475,7 +457,6 @@
{
PRTL_SPLAY_LINKS SplayLinks;
PUNICODE_PREFIX_TABLE_ENTRY Entry, CaseMatchEntry;
- DPRINT("RtlNextUnicodePrefix\n");
/* We might need this entry 2/3rd of the time, so cache it now */
CaseMatchEntry = PrefixTable->LastNextEntry->CaseMatch;
@@ -534,7 +515,6 @@
/* Save this entry as the last one returned, and return it */
PrefixTable->LastNextEntry = Entry;
- DPRINT("RtlNextUnicodePrefix: %p\n", Entry);
return Entry;
}
@@ -548,7 +528,6 @@
{
PUNICODE_PREFIX_TABLE_ENTRY Entry, RefEntry, NewEntry;
PRTL_SPLAY_LINKS SplayLinks;
- DPRINT("RtlRemoveUnicodePrefix\n");
/* Erase the last entry */
PrefixTable->LastNextEntry = NULL;