diff --git a/dlls/kernel/atom.c b/dlls/kernel/atom.c index 3c981ac7fbe..00b245972be 100644 --- a/dlls/kernel/atom.c +++ b/dlls/kernel/atom.c @@ -358,7 +358,7 @@ UINT16 WINAPI GetAtomName16( ATOM atom, LPSTR buffer, INT16 count ) ATOMENTRY * entryPtr; HANDLE16 entry; char * strPtr; - UINT len; + INT len; char text[8]; TRACE("%x\n",atom); diff --git a/dlls/kernel/computername.c b/dlls/kernel/computername.c index f0c9fd0ec23..945d11e8355 100644 --- a/dlls/kernel/computername.c +++ b/dlls/kernel/computername.c @@ -100,7 +100,7 @@ static BOOL dns_gethostbyname ( char *name, int *size ) WARN ("Error in gethostbyname_r %d (%d)\n", res, locerr); else { - size_t len = strlen ( host->h_name ); + int len = strlen ( host->h_name ); if ( len < *size ) { strcpy ( name, host->h_name ); @@ -382,7 +382,7 @@ BOOL WINAPI GetComputerNameA(LPSTR name, LPDWORD size) { WCHAR nameW[ MAX_COMPUTERNAME_LENGTH + 1 ]; DWORD sizeW = MAX_COMPUTERNAME_LENGTH; - int len; + unsigned int len; BOOL ret; if ( !GetComputerNameW (nameW, &sizeW) ) return FALSE; @@ -515,7 +515,7 @@ BOOL WINAPI GetComputerNameExW( COMPUTER_NAME_FORMAT type, LPWSTR name, LPDWORD TRACE ("-> %s (%d)\n", debugstr_a (buf), len); __TRY { - int lenW = MultiByteToWideChar( CP_ACP, 0, buf, len, NULL, 0 ); + unsigned int lenW = MultiByteToWideChar( CP_ACP, 0, buf, len, NULL, 0 ); if ( *size < lenW ) { MultiByteToWideChar( CP_ACP, 0, buf, len, name, *size ); @@ -550,7 +550,7 @@ static WCHAR netbios_char ( WCHAR wc ) { static const WCHAR special[] = {'!','@','#','$','%','^','&','\'',')','(','-','_','{','}','~'}; static const WCHAR deflt = '_'; - int i; + unsigned int i; if ( isalnumW ( wc ) ) return wc; for ( i = 0; i < sizeof (special) / sizeof (WCHAR); i++ ) diff --git a/dlls/kernel/console.c b/dlls/kernel/console.c index 96f9b19b5d5..454d9b4b2cf 100644 --- a/dlls/kernel/console.c +++ b/dlls/kernel/console.c @@ -1891,7 +1891,7 @@ BOOL WINAPI WriteConsoleW(HANDLE hConsoleOutput, LPCVOID lpBuffer, DWORD nNumber if (mode & ENABLE_PROCESSED_OUTPUT) { - int i; + unsigned int i; for (i = 0; i < nNumberOfCharsToWrite; i++) { diff --git a/dlls/kernel/cpu.c b/dlls/kernel/cpu.c index c7679ee3253..0923b1766cc 100644 --- a/dlls/kernel/cpu.c +++ b/dlls/kernel/cpu.c @@ -112,7 +112,7 @@ static void create_registry_keys( const SYSTEM_INFO *info ) static const WCHAR SysidW[] = {'A','T',' ','c','o','m','p','a','t','i','b','l','e',0}; static const WCHAR mhzKeyW[] = {'~','M','H','z',0}; - int i; + unsigned int i; HKEY hkey, system_key, cpu_key; OBJECT_ATTRIBUTES attr; UNICODE_STRING nameW, valueW; diff --git a/dlls/kernel/editline.c b/dlls/kernel/editline.c index 28f74165d62..d3a231b143c 100644 --- a/dlls/kernel/editline.c +++ b/dlls/kernel/editline.c @@ -108,7 +108,7 @@ static inline BOOL WCEL_IsSingleLine(WCEL_Context* ctx, size_t len) static inline COORD WCEL_GetCoord(WCEL_Context* ctx, int ofs) { COORD c; - unsigned len = ctx->csbi.dwSize.X - ctx->csbi.dwCursorPosition.X; + int len = ctx->csbi.dwSize.X - ctx->csbi.dwCursorPosition.X; c.Y = ctx->csbi.dwCursorPosition.Y; if (ofs >= len) @@ -330,7 +330,7 @@ static void WCEL_FindPrevInHist(WCEL_Context* ctx) { int startPos = ctx->histPos; WCHAR* data; - int len, oldofs; + unsigned int len, oldofs; if (ctx->histPos && ctx->histPos == ctx->histSize) { startPos--; @@ -394,13 +394,13 @@ static void WCEL_MoveRight(WCEL_Context* ctx) static void WCEL_MoveToLeftWord(WCEL_Context* ctx) { - int new_ofs = WCEL_GetLeftWordTransition(ctx, ctx->ofs); + unsigned int new_ofs = WCEL_GetLeftWordTransition(ctx, ctx->ofs); if (new_ofs != ctx->ofs) ctx->ofs = new_ofs; } static void WCEL_MoveToRightWord(WCEL_Context* ctx) { - int new_ofs = WCEL_GetRightWordTransition(ctx, ctx->ofs); + unsigned int new_ofs = WCEL_GetRightWordTransition(ctx, ctx->ofs); if (new_ofs != ctx->ofs) ctx->ofs = new_ofs; } @@ -461,7 +461,7 @@ static void WCEL_TransposeChar(WCEL_Context* ctx) static void WCEL_TransposeWords(WCEL_Context* ctx) { - int left_ofs = WCEL_GetLeftWordTransition(ctx, ctx->ofs), + unsigned int left_ofs = WCEL_GetLeftWordTransition(ctx, ctx->ofs), right_ofs = WCEL_GetRightWordTransition(ctx, ctx->ofs); if (left_ofs < ctx->ofs && right_ofs > ctx->ofs) { @@ -483,10 +483,10 @@ static void WCEL_TransposeWords(WCEL_Context* ctx) static void WCEL_LowerCaseWord(WCEL_Context* ctx) { - int new_ofs = WCEL_GetRightWordTransition(ctx, ctx->ofs); + unsigned int new_ofs = WCEL_GetRightWordTransition(ctx, ctx->ofs); if (new_ofs != ctx->ofs) { - int i; + unsigned int i; for (i = ctx->ofs; i <= new_ofs; i++) ctx->line[i] = tolowerW(ctx->line[i]); WCEL_Update(ctx, ctx->ofs, new_ofs - ctx->ofs + 1); @@ -496,10 +496,10 @@ static void WCEL_LowerCaseWord(WCEL_Context* ctx) static void WCEL_UpperCaseWord(WCEL_Context* ctx) { - int new_ofs = WCEL_GetRightWordTransition(ctx, ctx->ofs); + unsigned int new_ofs = WCEL_GetRightWordTransition(ctx, ctx->ofs); if (new_ofs != ctx->ofs) { - int i; + unsigned int i; for (i = ctx->ofs; i <= new_ofs; i++) ctx->line[i] = toupperW(ctx->line[i]); WCEL_Update(ctx, ctx->ofs, new_ofs - ctx->ofs + 1); @@ -509,10 +509,10 @@ static void WCEL_UpperCaseWord(WCEL_Context* ctx) static void WCEL_CapitalizeWord(WCEL_Context* ctx) { - int new_ofs = WCEL_GetRightWordTransition(ctx, ctx->ofs); + unsigned int new_ofs = WCEL_GetRightWordTransition(ctx, ctx->ofs); if (new_ofs != ctx->ofs) { - int i; + unsigned int i; ctx->line[ctx->ofs] = toupperW(ctx->line[ctx->ofs]); for (i = ctx->ofs + 1; i <= new_ofs; i++) @@ -568,7 +568,7 @@ static void WCEL_DeleteCurrChar(WCEL_Context* ctx) static void WCEL_DeleteLeftWord(WCEL_Context* ctx) { - int new_ofs = WCEL_GetLeftWordTransition(ctx, ctx->ofs); + unsigned int new_ofs = WCEL_GetLeftWordTransition(ctx, ctx->ofs); if (new_ofs != ctx->ofs) { WCEL_DeleteString(ctx, new_ofs, ctx->ofs); @@ -578,7 +578,7 @@ static void WCEL_DeleteLeftWord(WCEL_Context* ctx) static void WCEL_DeleteRightWord(WCEL_Context* ctx) { - int new_ofs = WCEL_GetRightWordTransition(ctx, ctx->ofs); + unsigned int new_ofs = WCEL_GetRightWordTransition(ctx, ctx->ofs); if (new_ofs != ctx->ofs) { WCEL_DeleteString(ctx, ctx->ofs, new_ofs); diff --git a/dlls/kernel/global16.c b/dlls/kernel/global16.c index 35c4827ce83..e4f6b797481 100644 --- a/dlls/kernel/global16.c +++ b/dlls/kernel/global16.c @@ -674,7 +674,7 @@ DWORD WINAPI GlobalCompact16( DWORD desired ) */ void WINAPI GlobalFreeAll16( HGLOBAL16 owner ) { - DWORD i; + int i; GLOBALARENA *pArena; pArena = pGlobalArena; diff --git a/dlls/kernel/ne_module.c b/dlls/kernel/ne_module.c index 5a68e72bcb6..212650a6aa3 100644 --- a/dlls/kernel/ne_module.c +++ b/dlls/kernel/ne_module.c @@ -623,7 +623,7 @@ static HMODULE16 NE_LoadExeHeader( HANDLE handle, LPCSTR path ) NE_MODULE *pModule; BYTE *pData, *pTempEntryTable; char *buffer, *fastload = NULL; - int fastload_offset = 0, fastload_length = 0; + unsigned int fastload_offset = 0, fastload_length = 0; ET_ENTRY *entry; ET_BUNDLE *bundle, *oldbundle; OFSTRUCT *ofs; diff --git a/dlls/kernel/resource.c b/dlls/kernel/resource.c index 0baf3c4fedd..c41bf4db10a 100644 --- a/dlls/kernel/resource.c +++ b/dlls/kernel/resource.c @@ -309,9 +309,8 @@ BOOL WINAPI EnumResourceTypesA( HMODULE hmod, ENUMRESTYPEPROCA lpfun, LONG_PTR l */ BOOL WINAPI EnumResourceTypesW( HMODULE hmod, ENUMRESTYPEPROCW lpfun, LONG_PTR lparam ) { - int i; + int i, len = 0; BOOL ret = FALSE; - DWORD len = 0; LPWSTR type = NULL; NTSTATUS status; const IMAGE_RESOURCE_DIRECTORY *resdir; @@ -422,10 +421,9 @@ done: */ BOOL WINAPI EnumResourceNamesW( HMODULE hmod, LPCWSTR type, ENUMRESNAMEPROCW lpfun, LONG_PTR lparam ) { - int i; + int i, len = 0; BOOL ret = FALSE; LPWSTR name = NULL; - DWORD len = 0; NTSTATUS status; UNICODE_STRING typeW; LDR_RESOURCE_INFO info; diff --git a/dlls/kernel/sync.c b/dlls/kernel/sync.c index e9d23b3f14e..3f725cbca95 100644 --- a/dlls/kernel/sync.c +++ b/dlls/kernel/sync.c @@ -129,7 +129,7 @@ DWORD WINAPI WaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, { NTSTATUS status; HANDLE hloc[MAXIMUM_WAIT_OBJECTS]; - int i; + unsigned int i; if (count >= MAXIMUM_WAIT_OBJECTS) { diff --git a/dlls/kernel/volume.c b/dlls/kernel/volume.c index bebd74c2276..a09a332bc8a 100644 --- a/dlls/kernel/volume.c +++ b/dlls/kernel/volume.c @@ -198,7 +198,7 @@ static UINT get_registry_drive_type( const WCHAR *root ) RtlInitUnicodeString( &nameW, driveW ); if (!NtQueryValueKey( hkey, &nameW, KeyValuePartialInformation, tmp, sizeof(tmp), &dummy )) { - int i; + unsigned int i; WCHAR *data = (WCHAR *)((KEY_VALUE_PARTIAL_INFORMATION *)tmp)->Data; for (i = 0; i < sizeof(drive_types)/sizeof(drive_types[0]); i++) @@ -569,7 +569,7 @@ static void VOLUME_GetSuperblockLabel( enum fs_type type, const BYTE *superblock if (superblock[0x58] == 0x25 && superblock[0x59] == 0x2f && /* Unicode ID */ ((ver == 0x40) || (ver == 0x43) || (ver == 0x45))) { /* yippee, unicode */ - int i; + unsigned int i; if (len > 17) len = 17; for (i = 0; i < len-1; i++)