signed/unsigned and some const-correctness

This commit is contained in:
Jeff Teunissen 2010-09-27 14:01:07 -04:00
parent 3515816b33
commit ad6e799981
10 changed files with 24 additions and 23 deletions

View file

@ -23,7 +23,7 @@ typedef struct {
-addString:(const char *)string toValue:(const char *) key; -addString:(const char *)string toValue:(const char *) key;
-(char *) convertListToString:(id) list; -(char *) convertListToString:(id) list;
-(const char *) getStringFor:(const char *) name; - (const char *) getStringFor:(const char *) name;
-removeKeyword:(const char *) key; -removeKeyword:(const char *) key;
-(unsigned int) getValueFor:(const char *) name; -(unsigned int) getValueFor:(const char *) name;
-changeStringFor:(const char *)key to:(const char *) value; -changeStringFor:(const char *)key to:(const char *) value;

View file

@ -14,7 +14,7 @@
-print -print
{ {
int i; NSUInteger i;
dict_t *d; dict_t *d;
for (i = 0; i < numElements; i++) { for (i = 0; i < numElements; i++) {
@ -34,7 +34,7 @@ JDC
-copy -copy
{ {
id new; id new;
int i; NSUInteger i;
dict_t *d; dict_t *d;
char *old; char *old;
@ -166,7 +166,7 @@ JDC
if (d != NULL) if (d != NULL)
return d->value; return d->value;
return ""; return (char *) "";
} }
// //

View file

@ -31,7 +31,7 @@
-writeListFile:(const char *) filename -writeListFile:(const char *) filename
{ {
FILE *fp; FILE *fp;
int i; NSUInteger i;
id obj; id obj;
fp = fopen (filename, "w+t"); fp = fopen (filename, "w+t");
@ -54,7 +54,7 @@
// //
-(id) findDictKeyword:(const char *) key -(id) findDictKeyword:(const char *) key
{ {
int i; NSUInteger i;
dict_t *d; dict_t *d;
id dict; id dict;

View file

@ -368,7 +368,8 @@ int nument;
f region:(BOOL) reg; f region:(BOOL) reg;
{ {
epair_t *e; epair_t *e;
int i, ang; int ang;
unsigned int i;
id new; id new;
vec3_t mins, maxs; vec3_t mins, maxs;
int org[3]; int org[3];

View file

@ -157,8 +157,8 @@ insertEC:
*/ */
- (void) insertEC:ec - (void) insertEC:ec
{ {
const char *name; const char *name;
int i; unsigned int i;
name =[ec classname]; name =[ec classname];
for (i = 0; i <[self count]; i++) { for (i = 0; i <[self count]; i++) {
@ -262,7 +262,7 @@ id entity_classes_i;
-(id) classForName:(const char *) name -(id) classForName:(const char *) name
{ {
int i; unsigned int i;
id o; id o;
for (i = 0; i <[self count]; i++) { for (i = 0; i <[self count]; i++) {

View file

@ -2,10 +2,10 @@
ADDITIONAL_CPPFLAGS += ADDITIONAL_CPPFLAGS +=
# Additional flags to pass to the Objective-C compiler # Additional flags to pass to the Objective-C compiler
ADDITIONAL_OBJCFLAGS += -DUSING_NIBS -Wall -Werror ADDITIONAL_OBJCFLAGS += -DUSING_NIBS -Wall -Werror -Wsign-compare -Wwrite-strings #-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
# Additional flags to pass to the C compiler # Additional flags to pass to the C compiler
ADDITIONAL_CFLAGS += -Wall -Werror ADDITIONAL_CFLAGS += -Wall -Werror -Wsign-compare -Wwrite-strings #-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
# Additional include directories the compiler should search # Additional include directories the compiler should search
ADDITIONAL_INCLUDE_DIRS += -I ../.. -I ../../../../include ADDITIONAL_INCLUDE_DIRS += -I ../.. -I ../../../../include

View file

@ -301,7 +301,7 @@ writeMapFile
fname useRegion:(BOOL) reg fname useRegion:(BOOL) reg
{ {
FILE *f; FILE *f;
int i; unsigned int i;
Sys_Printf ("writeMapFile: %s\n", fname); Sys_Printf ("writeMapFile: %s\n", fname);

View file

@ -521,7 +521,7 @@ Sys_Printf ("openProjectFile: %s\n", path);
void void
changeString (char cf, char ct, char *string) changeString (char cf, char ct, char *string)
{ {
int j; unsigned int j;
for (j = 0; j < strlen (string); j++) for (j = 0; j < strlen (string); j++)
if (string[j] == cf) if (string[j] == cf)

View file

@ -136,7 +136,7 @@ Every five minutes, save a modified map
if (autodirty) { if (autodirty) {
autodirty = NO; autodirty = NO;
#define FN_AUTOSAVE "/qcache/AutoSaveMap.map" #define FN_AUTOSAVE "/qcache/AutoSaveMap.map"
[map_i writeMapFile: FN_AUTOSAVE useRegion:NO]; [map_i writeMapFile: (char *) FN_AUTOSAVE useRegion:NO];
} }
[map_i writeStats]; [map_i writeStats];
} }
@ -363,9 +363,9 @@ App delegate methods
[self disableFlushWindow]; [self disableFlushWindow];
if ([map_i count] != [entitycount_i intValue]) if ([map_i count] != (unsigned) [entitycount_i intValue])
[entitycount_i setIntValue:[map_i count]]; [entitycount_i setIntValue:[map_i count]];
if ([[map_i currentEntity] count] != [brushcount_i intValue]) if ([[map_i currentEntity] count] != (unsigned) [brushcount_i intValue])
[brushcount_i setIntValue:[[map_i currentEntity] count]]; [brushcount_i setIntValue:[[map_i currentEntity] count]];
if (updatecamera) if (updatecamera)
@ -716,7 +716,7 @@ saveBSP
strcat (expandedcmd, "\n"); strcat (expandedcmd, "\n");
printf ("system: %s", expandedcmd); printf ("system: %s", expandedcmd);
[project_i addToOutput:"\n\n========= BUSY =========\n\n"]; [project_i addToOutput: (char *) "\n\n========= BUSY =========\n\n"];
[project_i addToOutput:expandedcmd]; [project_i addToOutput:expandedcmd];
if ([preferences_i getShowBSP]) if ([preferences_i getShowBSP])
@ -784,7 +784,7 @@ saveBSP
kill (bsppid, 9); kill (bsppid, 9);
// CheckCmdDone (cmdte, 0, NULL); // CheckCmdDone (cmdte, 0, NULL);
[project_i addToOutput:"\n\n========= STOPPED =========\n\n"]; [project_i addToOutput: (char *) "\n\n========= STOPPED =========\n\n"];
return self; return self;
} }

View file

@ -175,7 +175,7 @@ _shrinkIfDesired (Storage * self)
-insertElement:(void *) -insertElement:(void *)
anElement at:(NSUInteger) index anElement at:(NSUInteger) index
{ {
int i; NSUInteger i;
CHECK_INDEX (index); CHECK_INDEX (index);
_makeRoomForAnotherIfNecessary (self); _makeRoomForAnotherIfNecessary (self);
@ -193,7 +193,7 @@ anElement at:(NSUInteger) index
-removeElementAt:(NSUInteger) index -removeElementAt:(NSUInteger) index
{ {
int i; NSUInteger i;
CHECK_INDEX (index); CHECK_INDEX (index);
numElements--; numElements--;
@ -239,7 +239,7 @@ index with:(void *) newElement
-write:(TypedStream *) aStream -write:(TypedStream *) aStream
{ {
int i; NSUInteger i;
[super write:aStream]; [super write:aStream];
objc_write_types (aStream, "III*", objc_write_types (aStream, "III*",
@ -251,7 +251,7 @@ index with:(void *) newElement
-read:(TypedStream *) aStream -read:(TypedStream *) aStream
{ {
int i; NSUInteger i;
[super read:aStream]; [super read:aStream];
objc_read_types (aStream, "III*", objc_read_types (aStream, "III*",