From bec6c89c6db12041ddddbaacd024fc967a9d9780 Mon Sep 17 00:00:00 2001 From: Colin Finck Date: Sun, 3 Feb 2008 13:36:10 +0000 Subject: [PATCH] Get inflib_host to build warning-free svn path=/trunk/; revision=32104 --- reactos/lib/inflib/builddep.h | 6 +++--- reactos/lib/inflib/infhostgen.c | 8 ++++---- reactos/lib/inflib/infhostput.c | 2 +- reactos/lib/inflib/infput.c | 14 +++++++------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/reactos/lib/inflib/builddep.h b/reactos/lib/inflib/builddep.h index ac39869df81..570eec2cc51 100644 --- a/reactos/lib/inflib/builddep.h +++ b/reactos/lib/inflib/builddep.h @@ -16,9 +16,9 @@ #include #define FREE(Area) free(Area) -#define MALLOC(Size) malloc(Size) -#define ZEROMEMORY(Area, Size) memset((Area), '\0', (Size)) -#define MEMCPY(Dest, Src, Size) memcpy((Dest), (Src), (Size)) +#define MALLOC(Size) malloc((size_t)(Size)) +#define ZEROMEMORY(Area, Size) memset((Area), '\0', (size_t)(Size)) +#define MEMCPY(Dest, Src, Size) memcpy((Dest), (Src), (size_t)(Size)) #define INF_STATUS_SUCCESS 0 #define INF_STATUS_NO_MEMORY ENOMEM diff --git a/reactos/lib/inflib/infhostgen.c b/reactos/lib/inflib/infhostgen.c index 2777e22e603..ee1b52a571c 100644 --- a/reactos/lib/inflib/infhostgen.c +++ b/reactos/lib/inflib/infhostgen.c @@ -100,7 +100,7 @@ InfHostOpenFile(PHINF InfHandle, DPRINT("fopen() successful\n"); /* Query file size */ - if (fseek(File, 0, SEEK_END)) + if (fseek(File, (size_t)0, SEEK_END)) { DPRINT1("fseek() to EOF failed (errno %d)\n", errno); fclose(File); @@ -114,10 +114,10 @@ InfHostOpenFile(PHINF InfHandle, fclose(File); return -1; } - DPRINT("File size: %lu\n", FileLength); + DPRINT("File size: %u\n", (UINT)FileLength); /* Rewind */ - if (fseek(File, 0, SEEK_SET)) + if (fseek(File, (size_t)0, SEEK_SET)) { DPRINT1("fseek() to BOF failed (errno %d)\n", errno); fclose(File); @@ -134,7 +134,7 @@ InfHostOpenFile(PHINF InfHandle, } /* Read file */ - if (FileLength != fread(FileBuffer, 1, FileLength, File)) + if (FileLength != fread(FileBuffer, (size_t)1, (size_t)FileLength, File)) { DPRINT1("fread() failed (errno %d)\n", errno); fclose(File); diff --git a/reactos/lib/inflib/infhostput.c b/reactos/lib/inflib/infhostput.c index 55ced937bb6..3eb59704af8 100644 --- a/reactos/lib/inflib/infhostput.c +++ b/reactos/lib/inflib/infhostput.c @@ -43,7 +43,7 @@ InfHostWriteFile(HINF InfHandle, const CHAR *FileName, fprintf(File, "; %s\r\n\r\n", HeaderComment); } - if (BufferSize != fwrite(Buffer, 1, BufferSize, File)) + if (BufferSize != fwrite(Buffer, (size_t)1, (size_t)BufferSize, File)) { DPRINT1("fwrite() failed (errno %d)\n", errno); fclose(File); diff --git a/reactos/lib/inflib/infput.c b/reactos/lib/inflib/infput.c index 70c9024d4e8..a970b3f7665 100644 --- a/reactos/lib/inflib/infput.c +++ b/reactos/lib/inflib/infput.c @@ -40,13 +40,13 @@ Output(POUTPUTBUFFER OutBuf, PCTSTR Text) Length = _tcslen(Text); if (OutBuf->FreeSize < Length + 1 && INF_SUCCESS(OutBuf->Status)) { - DPRINT("Out of free space. TotalSize %lu FreeSize %lu Length %u\n", - OutBuf->TotalSize, OutBuf->FreeSize, Length); + DPRINT("Out of free space. TotalSize %u FreeSize %u Length %u\n", + (UINT)OutBuf->TotalSize, (UINT)OutBuf->FreeSize, (UINT)Length); /* Round up to next SIZE_INC */ NewSize = OutBuf->TotalSize + (((Length + 1) - OutBuf->FreeSize + (SIZE_INC - 1)) / SIZE_INC) * SIZE_INC; - DPRINT("NewSize %lu\n", NewSize); + DPRINT("NewSize %u\n", (UINT)NewSize); NewBuf = MALLOC(NewSize); /* Abort if failed */ if (NULL == NewBuf) @@ -59,8 +59,8 @@ Output(POUTPUTBUFFER OutBuf, PCTSTR Text) /* Need to copy old contents? */ if (NULL != OutBuf->Buffer) { - DPRINT("Copying %lu bytes from old content\n", - OutBuf->TotalSize - OutBuf->FreeSize); + DPRINT("Copying %u bytes from old content\n", + (UINT)(OutBuf->TotalSize - OutBuf->FreeSize)); MEMCPY(NewBuf, OutBuf->Buffer, OutBuf->TotalSize - OutBuf->FreeSize); OutBuf->Current = NewBuf + (OutBuf->Current - OutBuf->Buffer); FREE(OutBuf->Buffer); @@ -72,8 +72,8 @@ Output(POUTPUTBUFFER OutBuf, PCTSTR Text) OutBuf->Buffer = NewBuf; OutBuf->FreeSize += NewSize - OutBuf->TotalSize; OutBuf->TotalSize = NewSize; - DPRINT("After reallocation TotalSize %lu FreeSize %lu\n", - OutBuf->TotalSize, OutBuf->FreeSize); + DPRINT("After reallocation TotalSize %u FreeSize %u\n", + (UINT)OutBuf->TotalSize, (UINT)OutBuf->FreeSize); } /* We're guaranteed to have enough room now. Copy char by char because of