- Fix some inflib warnings
authorStefan Ginsberg <stefanginsberg@gmail.com>
Sun, 30 Aug 2009 18:11:09 +0000 (18:11 +0000)
committerStefan Ginsberg <stefanginsberg@gmail.com>
Sun, 30 Aug 2009 18:11:09 +0000 (18:11 +0000)
svn path=/trunk/; revision=42971

reactos/lib/inflib/infcore.c
reactos/lib/inflib/infget.c
reactos/lib/inflib/infhostgen.c
reactos/lib/inflib/infpriv.h

index e583836..9662e9c 100644 (file)
@@ -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 */
index ff23a2c..87c0776 100644 (file)
@@ -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;
index ee1b52a..ff5e15d 100644 (file)
@@ -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);
index 2619b1c..3446f8d 100644 (file)
@@ -69,7 +69,7 @@ typedef struct _INFCONTEXT
   PINFCACHELINE Line;
 } INFCONTEXT;
 
-typedef long INFSTATUS;
+typedef int INFSTATUS;
 
 /* FUNCTIONS ****************************************************************/