From 4289bcee6407f7fcf290229a2c465a7cc3a646a2 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 31 May 2014 15:29:10 +0000 Subject: [PATCH] [HOST] Try to fix some host warnings. svn path=/trunk/; revision=63512 --- reactos/lib/cmlib/hivewrt.c | 4 ++-- reactos/tools/geninc/geninc.c | 9 +++------ reactos/tools/log2lines/cmd.c | 16 ++++++++-------- reactos/tools/log2lines/match.c | 8 ++++---- reactos/tools/obj2bin/obj2bin.c | 12 ++++++------ 5 files changed, 23 insertions(+), 26 deletions(-) diff --git a/reactos/lib/cmlib/hivewrt.c b/reactos/lib/cmlib/hivewrt.c index 330ff81f0ff..a0e529f6ea0 100644 --- a/reactos/lib/cmlib/hivewrt.c +++ b/reactos/lib/cmlib/hivewrt.c @@ -14,8 +14,8 @@ HvpWriteLog( PHHIVE RegistryHive) { ULONG FileOffset; - ULONG BufferSize; - ULONG BitmapSize; + UINT BufferSize; + UINT BitmapSize; PUCHAR Buffer; PUCHAR Ptr; ULONG BlockIndex; diff --git a/reactos/tools/geninc/geninc.c b/reactos/tools/geninc/geninc.c index 6133b5cc408..295f2cfe8b8 100644 --- a/reactos/tools/geninc/geninc.c +++ b/reactos/tools/geninc/geninc.c @@ -5,19 +5,16 @@ #include #include #include +#include #define IMAGE_FILE_MACHINE_I386 0x014c #define IMAGE_FILE_MACHINE_AMD64 0x8664 #define IMAGE_FILE_MACHINE_ARMNT 0x01c4 -#ifdef _WIN32 +#ifdef _MSC_VER #define PRIx64 "I64x" -typedef unsigned __int16 uint16_t; -typedef unsigned __int32 uint32_t; -typedef unsigned __int64 uint64_t; #else -#include -#define PRIx64 "llx" +#include #define _stricmp strcasecmp #endif diff --git a/reactos/tools/log2lines/cmd.c b/reactos/tools/log2lines/cmd.c index ca7afaa8749..8fd80bd859b 100644 --- a/reactos/tools/log2lines/cmd.c +++ b/reactos/tools/log2lines/cmd.c @@ -20,7 +20,7 @@ * is inserted, so the string looks right on the console but still * contains the original string, plus other garbage: */ -static char +static char *backSpaceEdit(char *s) { char c; @@ -58,7 +58,7 @@ handle_switch(FILE *outFile, int *sw, char *arg, char *desc) *sw = x; changed = 1; } - } + } if (desc) { esclog(outFile, "%s is %d (%s)\n", desc, *sw, changed ? "changed":"unchanged"); @@ -90,14 +90,14 @@ handle_switch_str(FILE *outFile, char *sw, char *arg, char *desc) changed = 1; } } - } + } if (desc) { esclog(outFile, "%s is \"%s\" (%s)\n", desc, sw, changed ? "changed":"unchanged"); if (!arg) esclog(outFile, "(readonly)\n"); } - + return changed; } @@ -132,14 +132,14 @@ handle_switch_pstr(FILE *outFile, char **psw, char *arg, char *desc) } } } - } + } if (desc) { esclog(outFile, "%s is \"%s\" (%s)\n", desc, *psw, changed ? "changed":"unchanged"); if (!arg) esclog(outFile, "(readonly)\n"); } - + return changed; } @@ -155,7 +155,7 @@ handle_address_cmd(FILE *outFile, char *arg) if(( s = strchr(arg, ':') )) { *s = ' '; - if ( (cnt = sscanf(arg,"%20s %lx", Image, &Offset)) == 2) + if ( (cnt = sscanf(arg,"%20s %x", Image, &Offset)) == 2) { if (( plm = entry_lookup(&cache, Image) )) { @@ -292,7 +292,7 @@ handle_escape_cmd(FILE *outFile, char *Line, char *path, char *LineOut) { memset(&summ, 0, sizeof(SUMM)); esclog(outFile, "Statistics cleared\n"); - } + } else stat_print(outFile, &summ); break; diff --git a/reactos/tools/log2lines/match.c b/reactos/tools/log2lines/match.c index 256a8b71902..c0bc98bcf41 100644 --- a/reactos/tools/log2lines/match.c +++ b/reactos/tools/log2lines/match.c @@ -32,8 +32,8 @@ static int match_mod(FILE *outFile, char *Line, int processed) { static int state = 0; char Image[NAMESIZE]; - DWORD Base; - DWORD Size; + UINT Base; + UINT Size; PLIST_MEMBER plm; int cnt; @@ -48,13 +48,13 @@ static int match_mod(FILE *outFile, char *Line, int processed) switch (state) { case 1: - if ( (cnt = sscanf(Line,"%lx %lx %20s", &Base, &Size, Image)) == 3 ) + if ( (cnt = sscanf(Line,"%x %x %20s", &Base, &Size, Image)) == 3 ) { if (( plm = entry_lookup(&cache, Image) )) { plm->RelBase = Base; plm->Size = Size; - l2l_dbg(1, "Relocated: %s %08x -> %08x\n", Image, plm->ImageBase, plm->RelBase); + l2l_dbg(1, "Relocated: %s %p -> %p\n", Image, (void*)plm->ImageBase, (void*)plm->RelBase); } return 0; } diff --git a/reactos/tools/obj2bin/obj2bin.c b/reactos/tools/obj2bin/obj2bin.c index 88c6e95d724..34e596f48fb 100644 --- a/reactos/tools/obj2bin/obj2bin.c +++ b/reactos/tools/obj2bin/obj2bin.c @@ -52,8 +52,8 @@ RelocateSection( break; default: - printf("Unknown relocatation type %d, address 0x%lx\n", - pReloc->Type, pReloc->VirtualAddress); + printf("Unknown relocatation type %u, address 0x%x\n", + pReloc->Type, (unsigned)pReloc->VirtualAddress); } pReloc++; @@ -99,7 +99,7 @@ int main(int argc, char *argv[]) if (!pData) { fclose(pSourceFile); - fprintf(stderr, "Failed to allocate %ld bytes\n", nFileSize); + fprintf(stderr, "Failed to allocate %lu bytes\n", nFileSize); return -3; } @@ -108,7 +108,7 @@ int main(int argc, char *argv[]) { free(pData); fclose(pSourceFile); - fprintf(stderr, "Failed to read %ld bytes from source file\n", nFileSize); + fprintf(stderr, "Failed to read %lu bytes from source file\n", nFileSize); return -4; } @@ -147,8 +147,8 @@ int main(int argc, char *argv[]) { free(pData); fclose(pDestFile); - fprintf(stderr, "Failed to write %ld bytes to destination file\n", - pSectionHeader->SizeOfRawData); + fprintf(stderr, "Failed to write %u bytes to destination file\n", + (unsigned int)pSectionHeader->SizeOfRawData); return -6; } -- 2.17.1