From a8206018e6a46d6a3c8d8227acfa16021f3e0d57 Mon Sep 17 00:00:00 2001 From: Stefan Ginsberg Date: Sun, 30 Aug 2009 18:11:09 +0000 Subject: [PATCH] - Fix some inflib warnings svn path=/trunk/; revision=42971 --- reactos/lib/inflib/infcore.c | 12 ++++++------ reactos/lib/inflib/infget.c | 2 +- reactos/lib/inflib/infhostgen.c | 2 +- reactos/lib/inflib/infpriv.h | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/reactos/lib/inflib/infcore.c b/reactos/lib/inflib/infcore.c index e58383685c0..9662e9cf255 100644 --- a/reactos/lib/inflib/infcore.c +++ b/reactos/lib/inflib/infcore.c @@ -181,8 +181,8 @@ InfpAddSection(PINFCACHE Cache, } /* Allocate and initialize the new section */ - Size = FIELD_OFFSET(INFCACHESECTION, - Name[_tcslen (Name) + 1]); + Size = (ULONG)FIELD_OFFSET(INFCACHESECTION, + Name[_tcslen (Name) + 1]); Section = (PINFCACHESECTION)MALLOC (Size); if (Section == NULL) { @@ -286,8 +286,8 @@ InfpAddFieldToLine(PINFCACHELINE Line, PINFCACHEFIELD Field; ULONG Size; - Size = FIELD_OFFSET(INFCACHEFIELD, - Data[_tcslen(Data) + 1]); + Size = (ULONG)FIELD_OFFSET(INFCACHEFIELD, + Data[_tcslen(Data) + 1]); Field = (PINFCACHEFIELD)MALLOC(Size); if (Field == NULL) { @@ -382,7 +382,7 @@ __inline static int is_eol( struct parser *parser, const CHAR *ptr ) /* push data from current token start up to pos into the current token */ static int push_token( struct parser *parser, const CHAR *pos ) { - unsigned int len = pos - parser->start; + UINT len = (UINT)(pos - parser->start); const CHAR *src = parser->start; TCHAR *dst = parser->token + parser->token_len; @@ -808,7 +808,7 @@ InfpParseBuffer (PINFCACHE file, { if (error_line) *error_line = parser.line_pos; - return parser.error; + return (INFSTATUS)parser.error; } /* find the [strings] section */ diff --git a/reactos/lib/inflib/infget.c b/reactos/lib/inflib/infget.c index ff23a2c3f7b..87c0776ddc1 100644 --- a/reactos/lib/inflib/infget.c +++ b/reactos/lib/inflib/infget.c @@ -243,7 +243,7 @@ InfpGetBinaryField(PINFCONTEXT Context, for (Index = 1; Index < FieldIndex; Index++) CacheField = CacheField->Next; - Size = CacheLine->FieldCount - FieldIndex + 1; + Size = (ULONG)CacheLine->FieldCount - FieldIndex + 1; if (RequiredSize != NULL) *RequiredSize = Size; diff --git a/reactos/lib/inflib/infhostgen.c b/reactos/lib/inflib/infhostgen.c index ee1b52a571c..ff5e15d7d36 100644 --- a/reactos/lib/inflib/infhostgen.c +++ b/reactos/lib/inflib/infhostgen.c @@ -107,7 +107,7 @@ InfHostOpenFile(PHINF InfHandle, return -1; } - FileLength = ftell(File); + FileLength = (ULONG)ftell(File); if ((ULONG) -1 == FileLength) { DPRINT1("ftell() failed (errno %d)\n", errno); diff --git a/reactos/lib/inflib/infpriv.h b/reactos/lib/inflib/infpriv.h index 2619b1ca77a..3446f8d3ce1 100644 --- a/reactos/lib/inflib/infpriv.h +++ b/reactos/lib/inflib/infpriv.h @@ -69,7 +69,7 @@ typedef struct _INFCONTEXT PINFCACHELINE Line; } INFCONTEXT; -typedef long INFSTATUS; +typedef int INFSTATUS; /* FUNCTIONS ****************************************************************/ -- 2.17.1