Author: sginsberg
Date: Thu Sep 10 19:41:44 2009
New Revision: 43024
URL:
http://svn.reactos.org/svn/reactos?rev=43024&view=rev
Log:
- Fix various warnings in inflib (thanks to Ged for help with what appears to be a gcc bug
in push_token)
- Disable useless gcc warning in libjpeg
- Fix a 64-bit warning in pefixup
Modified:
trunk/reactos/dll/3rdparty/libjpeg/libjpeg.rbuild
trunk/reactos/lib/inflib/infcore.c
trunk/reactos/lib/inflib/infget.c
trunk/reactos/lib/inflib/infpriv.h
trunk/reactos/lib/inflib/infput.c
trunk/reactos/tools/pefixup.c
Modified: trunk/reactos/dll/3rdparty/libjpeg/libjpeg.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/3rdparty/libjpeg/libjp…
==============================================================================
--- trunk/reactos/dll/3rdparty/libjpeg/libjpeg.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/3rdparty/libjpeg/libjpeg.rbuild [iso-8859-1] Thu Sep 10 19:41:44
2009
@@ -1,6 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="libjpeg" type="win32dll" entrypoint="0"
installbase="system32" installname="libjpeg.dll"
allowwarnings="true" crt="msvcrt">
+ <compilerflag compilerset="gcc">-Wno-main</compilerflag>
<define name="WIN32" />
<define name="_WINDOWS" />
<define name="_MBCS" />
Modified: trunk/reactos/lib/inflib/infcore.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/inflib/infcore.c?rev=4…
==============================================================================
--- trunk/reactos/lib/inflib/infcore.c [iso-8859-1] (original)
+++ trunk/reactos/lib/inflib/infcore.c [iso-8859-1] Thu Sep 10 19:41:44 2009
@@ -48,7 +48,7 @@
PINFCACHESECTION cur_section; /* pointer to the section being parsed*/
PINFCACHELINE line; /* current line */
unsigned int line_pos; /* current line position in file */
- unsigned int error; /* error code */
+ INFSTATUS error; /* error code */
unsigned int token_len; /* current token len */
TCHAR token[MAX_FIELD_LEN+1]; /* current token */
};
@@ -391,7 +391,17 @@
parser->token_len += len;
for ( ; len > 0; len--, dst++, src++)
- *dst = *src ? (TCHAR)*src : L' ';
+ {
+ if (*src)
+ {
+ *dst = *src;
+ }
+ else
+ {
+ *dst = _T(' ');
+ }
+ }
+
*dst = 0;
parser->start = pos;
@@ -808,7 +818,7 @@
{
if (error_line)
*error_line = parser.line_pos;
- return (INFSTATUS)parser.error;
+ return parser.error;
}
/* find the [strings] section */
Modified: trunk/reactos/lib/inflib/infget.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/inflib/infget.c?rev=43…
==============================================================================
--- trunk/reactos/lib/inflib/infget.c [iso-8859-1] (original)
+++ trunk/reactos/lib/inflib/infget.c [iso-8859-1] Thu Sep 10 19:41:44 2009
@@ -305,7 +305,7 @@
Ptr = CacheField->Data;
}
- *IntegerValue = _tcstol(Ptr, NULL, 0);
+ *IntegerValue = (LONG)_tcstol(Ptr, NULL, 0);
return INF_STATUS_SUCCESS;
}
@@ -348,7 +348,7 @@
Size = 0;
while (FieldPtr != NULL)
{
- Size += (_tcslen (FieldPtr->Data) + 1);
+ Size += ((ULONG)_tcslen (FieldPtr->Data) + 1);
FieldPtr = FieldPtr->Next;
}
Size++;
@@ -366,7 +366,7 @@
FieldPtr = CacheField;
while (FieldPtr != NULL)
{
- Size = _tcslen (FieldPtr->Data) + 1;
+ Size = (ULONG)_tcslen (FieldPtr->Data) + 1;
_tcscpy (Ptr, FieldPtr->Data);
@@ -420,7 +420,7 @@
Ptr = CacheField->Data;
}
- Size = _tcslen (Ptr) + 1;
+ Size = (ULONG)_tcslen (Ptr) + 1;
if (RequiredSize != NULL)
*RequiredSize = Size;
Modified: trunk/reactos/lib/inflib/infpriv.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/inflib/infpriv.h?rev=4…
==============================================================================
--- trunk/reactos/lib/inflib/infpriv.h [iso-8859-1] (original)
+++ trunk/reactos/lib/inflib/infpriv.h [iso-8859-1] Thu Sep 10 19:41:44 2009
@@ -13,11 +13,11 @@
#define FIELD_OFFSET(t,f) ((ptrdiff_t)&(((t*)0)->f))
#endif
-#define INF_STATUS_INSUFFICIENT_RESOURCES (0xC000009A)
-#define INF_STATUS_BAD_SECTION_NAME_LINE (0xC0700001)
-#define INF_STATUS_SECTION_NAME_TOO_LONG (0xC0700002)
-#define INF_STATUS_WRONG_INF_STYLE (0xC0700003)
-#define INF_STATUS_NOT_ENOUGH_MEMORY (0xC0700004)
+#define INF_STATUS_INSUFFICIENT_RESOURCES ((INFSTATUS)0xC000009A)
+#define INF_STATUS_BAD_SECTION_NAME_LINE ((INFSTATUS)0xC0700001)
+#define INF_STATUS_SECTION_NAME_TOO_LONG ((INFSTATUS)0xC0700002)
+#define INF_STATUS_WRONG_INF_STYLE ((INFSTATUS)0xC0700003)
+#define INF_STATUS_NOT_ENOUGH_MEMORY ((INFSTATUS)0xC0700004)
typedef struct _INFCACHEFIELD
{
Modified: trunk/reactos/lib/inflib/infput.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/inflib/infput.c?rev=43…
==============================================================================
--- trunk/reactos/lib/inflib/infput.c [iso-8859-1] (original)
+++ trunk/reactos/lib/inflib/infput.c [iso-8859-1] Thu Sep 10 19:41:44 2009
@@ -37,7 +37,7 @@
}
/* Doesn't fit? */
- Length = _tcslen(Text);
+ Length = (ULONG)_tcslen(Text);
if (OutBuf->FreeSize < Length + 1 && INF_SUCCESS(OutBuf->Status))
{
DPRINT("Out of free space. TotalSize %u FreeSize %u Length %u\n",
@@ -145,8 +145,8 @@
NeedQuotes = FALSE;
while (_T('\0') != *p && ! NeedQuotes)
{
- NeedQuotes = _T(',') == *p || _T(';') == *p ||
- _T('\\') == *p;
+ NeedQuotes = (BOOLEAN)(_T(',') == *p || _T(';') == *p
||
+ _T('\\') == *p);
p++;
}
if (NeedQuotes)
Modified: trunk/reactos/tools/pefixup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/pefixup.c?rev=43024&…
==============================================================================
--- trunk/reactos/tools/pefixup.c [iso-8859-1] (original)
+++ trunk/reactos/tools/pefixup.c [iso-8859-1] Thu Sep 10 19:41:44 2009
@@ -39,6 +39,7 @@
typedef unsigned short WORD;
typedef unsigned int DWORD;
typedef int LONG;
+typedef long LONG_PTR;
#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16
#define IMAGE_SIZEOF_SHORT_NAME 8
@@ -46,7 +47,7 @@
#define IMAGE_NT_SIGNATURE 0x00004550
#define IMAGE_SCN_MEM_DISCARDABLE 0x2000000
#define IMAGE_SCN_MEM_NOT_PAGED 0x8000000
-#define FIELD_OFFSET(t,f) ((LONG)&(((t*)0)->f))
+#define FIELD_OFFSET(t,f) ((LONG)(LONG_PTR)&(((t*)0)->f))
#define IMAGE_FIRST_SECTION(h) ((PIMAGE_SECTION_HEADER) ((unsigned
long)h+FIELD_OFFSET(IMAGE_NT_HEADERS,OptionalHeader)+((PIMAGE_NT_HEADERS)(h))->FileHeader.SizeOfOptionalHeader))
#define IMAGE_DIRECTORY_ENTRY_EXPORT 0