diff --git a/tools/winegcc/utils.c b/tools/winegcc/utils.c index 1af91e9b23e..c5b46a457fc 100644 --- a/tools/winegcc/utils.c +++ b/tools/winegcc/utils.c @@ -118,16 +118,16 @@ void strarray_add(strarray* arr, const char* str) 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, const strarray* from) 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* str, const char* delim) 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 char* dir, const char* library, char** fil 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, const char* library, char** file) 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 02e995ac0d6..4c8fec31173 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 f1aa87e466d..f1a7bb0acde 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(enum processor processor) 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;