Michael Stefaniuc : winhelp:
Fix some comparisons between signed and unsigned.
Alexandre Julliard
julliard at wine.codeweavers.com
Tue May 22 07:00:15 CDT 2007
Module: wine
Branch: master
Commit: 306c1dc32726d32185187d6013f10519e9267e36
URL: http://source.winehq.org/git/wine.git/?a=commit;h=306c1dc32726d32185187d6013f10519e9267e36
Author: Michael Stefaniuc <mstefani at redhat.de>
Date: Mon May 21 23:19:04 2007 +0200
winhelp: Fix some comparisons between signed and unsigned.
---
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);
More information about the wine-cvs
mailing list