winhelp: Fix some comparisons between signed and unsigned.
Michael Stefaniuc
mstefani at redhat.de
Mon May 21 16:19:04 CDT 2007
---
programs/winhelp/hlpfile.c | 15 ++++++++-------
programs/winhelp/macro.c | 2 +-
programs/winhelp/macro.lex.l | 6 +++---
3 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/programs/winhelp/hlpfile.c b/programs/winhelp/hlpfile.c
index e17a34e..417148e 100644
--- a/programs/winhelp/hlpfile.c
+++ b/programs/winhelp/hlpfile.c
@@ -157,7 +157,7 @@ HLPFILE_PAGE *HLPFILE_PageByOffset(HLPFILE* hlpfile, LONG offset)
*/
HLPFILE_PAGE *HLPFILE_PageByHash(HLPFILE* hlpfile, LONG lHash)
{
- int i;
+ unsigned int i;
if (!hlpfile) return 0;
@@ -179,7 +179,7 @@ HLPFILE_PAGE *HLPFILE_PageByHash(HLPFILE* hlpfile, LONG lHash)
*/
HLPFILE_PAGE *HLPFILE_PageByMap(HLPFILE* hlpfile, LONG lMap)
{
- int i;
+ unsigned int i;
if (!hlpfile) return 0;
@@ -1578,12 +1578,13 @@ static BOOL HLPFILE_UncompressLZ77_Phrases(HLPFILE* hlpfile)
*/
static BOOL HLPFILE_Uncompress_Phrases40(HLPFILE* hlpfile)
{
- UINT num, dec_size, cpr_size;
+ UINT num;
+ INT dec_size, cpr_size;
BYTE *buf_idx, *end_idx;
BYTE *buf_phs, *end_phs;
- short i, n;
long* ptr, mask = 0;
- unsigned short bc;
+ unsigned int i;
+ unsigned short bc, n;
if (!HLPFILE_FindSubFile("|PhrIndex", &buf_idx, &end_idx) ||
!HLPFILE_FindSubFile("|PhrImage", &buf_phs, &end_phs)) return FALSE;
@@ -1649,7 +1650,7 @@ static BOOL HLPFILE_Uncompress_Phrases40(HLPFILE* hlpfile)
static BOOL HLPFILE_Uncompress_Topic(HLPFILE* hlpfile)
{
BYTE *buf, *ptr, *end, *newptr;
- int i, newsize = 0;
+ unsigned int i, newsize = 0;
if (!HLPFILE_FindSubFile("|TOPIC", &buf, &end))
{WINE_WARN("topic0\n"); return FALSE;}
@@ -1761,7 +1762,7 @@ static void HLPFILE_Uncompress2(const BYTE *ptr, const BYTE *end, BYTE *newptr,
static BOOL HLPFILE_Uncompress3(char* dst, const char* dst_end,
const BYTE* src, const BYTE* src_end)
{
- int idx, len;
+ unsigned int idx, len;
for (; src < src_end; src++)
{
diff --git a/programs/winhelp/macro.c b/programs/winhelp/macro.c
index 803b5bb..c658bf6 100644
--- a/programs/winhelp/macro.c
+++ b/programs/winhelp/macro.c
@@ -233,7 +233,7 @@ void CALLBACK MACRO_BackFlush(void)
if (win)
{
- int i;
+ unsigned int i;
for (i = 0; i < win->backIndex; i++)
{
diff --git a/programs/winhelp/macro.lex.l b/programs/winhelp/macro.lex.l
index 1480431..1ff76ce 100644
--- a/programs/winhelp/macro.lex.l
+++ b/programs/winhelp/macro.lex.l
@@ -33,7 +33,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(winhelp);
static LPCSTR macroptr;
static LPSTR strptr;
static int quote_stack[32];
-static int quote_stk_idx = 0;
+static unsigned int quote_stk_idx = 0;
struct lexret yylval;
#define YY_INPUT(buf,result,max_size)\
@@ -143,8 +143,8 @@ static int MACRO_CallBoolFunc(FARPROC fn, const char* args, void** ret);
*/
static int MACRO_CheckArgs(void* pa[], unsigned max, const char* args)
{
- int t;
- int len = 0, idx = 0;
+ int t;
+ unsigned int len = 0, idx = 0;
WINE_TRACE("Checking %s\n", args);
--
1.5.0.6
--
Michael Stefaniuc Tel.: +49-711-96437-199
Sr. Network Engineer Fax.: +49-711-96437-111
Red Hat GmbH Email: mstefani at redhat.com
Hauptstaetterstr. 58 http://www.redhat.de/
D-70178 Stuttgart
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20070521/ed42d920/attachment-0001.pgp
More information about the wine-patches
mailing list