ntdll: Sign-compare warnings fix.
diff --git a/dlls/ntdll/cdrom.c b/dlls/ntdll/cdrom.c
index f6fed81..998b2dc 100644
--- a/dlls/ntdll/cdrom.c
+++ b/dlls/ntdll/cdrom.c
@@ -1370,7 +1370,7 @@
DWORD lba = raw->DiskOffset.QuadPart >> 11;
struct cdrom_msf* msf;
PBYTE *bp; /* current buffer pointer */
- int i;
+ DWORD i;
if ((lba + raw->SectorCount) >
((1 << 8*sizeof(msf->cdmsf_min0)) * CD_SECS * CD_FRAMES
diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c
index 44b88b2..cd3fdd7e 100644
--- a/dlls/ntdll/heap.c
+++ b/dlls/ntdll/heap.c
@@ -256,7 +256,7 @@
*/
static void HEAP_Dump( HEAP *heap )
{
- int i;
+ unsigned int i;
SUBHEAP *subheap;
char *ptr;
@@ -620,7 +620,7 @@
{
SUBHEAP *subheap;
FREE_LIST_ENTRY *pEntry;
- int i;
+ unsigned int i;
/* Commit memory */
@@ -819,7 +819,7 @@
*/
static BOOL HEAP_IsValidArenaPtr( const HEAP *heap, const ARENA_FREE *ptr )
{
- int i;
+ unsigned int i;
const SUBHEAP *subheap = HEAP_FindSubHeap( heap, ptr );
if (!subheap) return FALSE;
if ((const char *)ptr >= (const char *)subheap->base + subheap->headerSize) return TRUE;
diff --git a/dlls/ntdll/reg.c b/dlls/ntdll/reg.c
index 425ddf8..af0f200 100644
--- a/dlls/ntdll/reg.c
+++ b/dlls/ntdll/reg.c
@@ -899,7 +899,7 @@
NTSTATUS status = STATUS_SUCCESS;
ULONG len;
LPWSTR String;
- INT count = 0;
+ ULONG count = 0;
if (pInfo == NULL)
{
diff --git a/dlls/ntdll/rtlstr.c b/dlls/ntdll/rtlstr.c
index 0e98588..3a50155 100644
--- a/dlls/ntdll/rtlstr.c
+++ b/dlls/ntdll/rtlstr.c
@@ -1511,8 +1511,7 @@
const UNICODE_STRING *search_chars, /* [I] Unicode string which contains the characters to search for */
USHORT *pos) /* [O] Position of the first character found + 2 */
{
- int main_idx;
- unsigned int search_idx;
+ unsigned int main_idx, search_idx;
switch (flags) {
case 0:
@@ -1527,7 +1526,8 @@
*pos = 0;
return STATUS_NOT_FOUND;
case 1:
- for (main_idx = main_str->Length / sizeof(WCHAR) - 1; main_idx >= 0; main_idx--) {
+ main_idx = main_str->Length / sizeof(WCHAR);
+ while (main_idx-- > 0) {
for (search_idx = 0; search_idx < search_chars->Length / sizeof(WCHAR); search_idx++) {
if (main_str->Buffer[main_idx] == search_chars->Buffer[search_idx]) {
*pos = main_idx * sizeof(WCHAR);
@@ -1552,7 +1552,8 @@
*pos = 0;
return STATUS_NOT_FOUND;
case 3:
- for (main_idx = main_str->Length / sizeof(WCHAR) - 1; main_idx >= 0; main_idx--) {
+ main_idx = main_str->Length / sizeof(WCHAR);
+ while (main_idx-- > 0) {
search_idx = 0;
while (search_idx < search_chars->Length / sizeof(WCHAR) &&
main_str->Buffer[main_idx] != search_chars->Buffer[search_idx]) {
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index 9411db1..47e0196 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -274,8 +274,8 @@
/* allocate and initialize the initial TEB */
sigstack_total_size = get_signal_stack_total_size();
- while (1 << sigstack_zero_bits < sigstack_total_size) sigstack_zero_bits++;
- assert( 1 << sigstack_zero_bits == sigstack_total_size ); /* must be a power of 2 */
+ while (1U << sigstack_zero_bits < sigstack_total_size) sigstack_zero_bits++;
+ assert( 1U << sigstack_zero_bits == sigstack_total_size ); /* must be a power of 2 */
assert( sigstack_total_size >= sizeof(TEB) + sizeof(struct startup_info) );
thread_info.teb_size = sigstack_total_size;