Joris Huizer : winegcc: Sign-compare fixes.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Feb 12 09:23:45 CST 2007
Module: wine
Branch: master
Commit: 909425d99d2250f14a7948217750bb23ccf4e83f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=909425d99d2250f14a7948217750bb23ccf4e83f
Author: Joris Huizer <joris_huizer at yahoo.com>
Date: Sat Feb 10 03:57:25 2007 -0800
winegcc: Sign-compare fixes.
---
tools/winegcc/utils.c | 15 ++++++++-------
tools/winegcc/utils.h | 2 +-
tools/winegcc/winegcc.c | 11 ++++++-----
3 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/tools/winegcc/utils.c b/tools/winegcc/utils.c
index 1af91e9..c5b46a4 100644
--- a/tools/winegcc/utils.c
+++ b/tools/winegcc/utils.c
@@ -118,16 +118,16 @@ void strarray_add(strarray* arr, const c
arr->base[arr->size++] = str;
}
-void strarray_del(strarray* arr, int i)
+void strarray_del(strarray* arr, unsigned int i)
{
- if (i < 0 || i >= arr->size) error("Invalid index i=%d", i);
+ if (i >= arr->size) error("Invalid index i=%d", i);
memmove(&arr->base[i], &arr->base[i + 1], (arr->size - i - 1) * sizeof(arr->base[0]));
arr->size--;
}
void strarray_addall(strarray* arr, const strarray* from)
{
- int i;
+ unsigned int i;
for (i = 0; i < from->size; i++)
strarray_add(arr, from->base[i]);
@@ -136,7 +136,7 @@ void strarray_addall(strarray* arr, cons
strarray* strarray_dup(const strarray* arr)
{
strarray* dup = strarray_alloc();
- int i;
+ unsigned int i;
for (i = 0; i < arr->size; i++)
strarray_add(dup, arr->base[i]);
@@ -160,7 +160,7 @@ strarray* strarray_fromstring(const char
char* strarray_tostring(const strarray* arr, const char* sep)
{
char *str, *newstr;
- int i;
+ unsigned int i;
str = strmake("%s", arr->base[0]);
for (i = 1; i < arr->size; i++)
@@ -277,7 +277,7 @@ static file_type guess_lib_type(const ch
file_type get_lib_type(strarray* path, const char* library, char** file)
{
- int i;
+ unsigned int i;
for (i = 0; i < path->size; i++)
{
@@ -289,7 +289,8 @@ file_type get_lib_type(strarray* path, c
void spawn(const strarray* prefix, const strarray* args, int ignore_errors)
{
- int i, status;
+ unsigned int i;
+ int status;
strarray* arr = strarray_dup(args);
const char** argv;
char* prog = 0;
diff --git a/tools/winegcc/utils.h b/tools/winegcc/utils.h
index 02e995a..4c8fec3 100644
--- a/tools/winegcc/utils.h
+++ b/tools/winegcc/utils.h
@@ -48,7 +48,7 @@ strarray* strarray_alloc(void);
strarray* strarray_dup(const strarray* arr);
void strarray_free(strarray* arr);
void strarray_add(strarray* arr, const char* str);
-void strarray_del(strarray* arr, int i);
+void strarray_del(strarray* arr, unsigned int i);
void strarray_addall(strarray* arr, const strarray* from);
strarray* strarray_fromstring(const char* str, const char* delim);
char* strarray_tostring(const strarray* arr, const char* sep);
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index f1aa87e..f1a7bb0 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -170,7 +170,7 @@ struct options
static void clean_temp_files(void)
{
- int i;
+ unsigned int i;
if (keep_generated) return;
@@ -239,7 +239,8 @@ static const strarray* get_translator(en
static void compile(struct options* opts, const char* lang)
{
strarray* comp_args = strarray_alloc();
- int j, gcc_defs = 0;
+ unsigned int j;
+ int gcc_defs = 0;
switch(opts->processor)
{
@@ -434,7 +435,7 @@ static void build(struct options* opts)
const char *output_name, *spec_file, *lang;
const char* winebuild = getenv("WINEBUILD");
int generate_app_loader = 1;
- int j;
+ unsigned int j;
/* NOTE: for the files array we'll use the following convention:
* -axxx: xxx is an archive (.a)
@@ -719,7 +720,7 @@ static int is_linker_arg(const char* arg
"-static", "-static-libgcc", "-shared", "-shared-libgcc", "-symbolic",
"-framework"
};
- int j;
+ unsigned int j;
switch (arg[1])
{
@@ -769,7 +770,7 @@ static int is_mingw_arg(const char* arg)
{
"-mno-cygwin", "-mwindows", "-mconsole", "-mthreads", "-municode"
};
- int j;
+ unsigned int j;
for (j = 0; j < sizeof(mingw_switches)/sizeof(mingw_switches[0]); j++)
if (strcmp(mingw_switches[j], arg) == 0) return 1;
More information about the wine-cvs
mailing list