Stage 1 of clang compiler warning patches.

This commit is contained in:
Euan Thoms
2015-10-31 14:10:03 +08:00
parent 0b490a00c6
commit 3c62cc744e
85 changed files with 185 additions and 165 deletions
+2 -2
View File
@@ -310,7 +310,7 @@ static NSDictionary *BSONTypes()
case 'q': return 0x12;
default:
[NSException raise: NSInvalidArgumentException format: @"%@::%s - invalid encoding type '%c'", [self class], _cmd, encoding];
[NSException raise: NSInvalidArgumentException format: @"%@::%@ - invalid encoding type '%c'", [self class], NSStringFromSelector(_cmd), encoding];
}
return 0;
}
@@ -385,7 +385,7 @@ static NSDictionary *BSONTypes()
}
[NSException raise: NSInvalidArgumentException format: @"%@::%s - invalid encoding type '%c'", [self class], _cmd, encoding];
[NSException raise: NSInvalidArgumentException format: @"%@::%@ - invalid encoding type '%c'", [self class], NSStringFromSelector(_cmd), encoding];
return nil;
}
+1 -1
View File
@@ -1703,7 +1703,7 @@ _makeLDAPChanges (NGLdapConnection *ldapConnection,
hostname: hostname
port: [NSString stringWithFormat: @"%d", port]
encryption: encryption
bindAsCurrentUser: NO];
bindAsCurrentUser: [NSString stringWithFormat: @"%d", NO]];
[ab setBaseDN: [entry dn]
IDField: @"cn"
CNField: @"displayName"
+6 -6
View File
@@ -90,9 +90,9 @@ static NSString *rfc822Months[] = {@"", @"Jan", @"Feb", @"Mar", @"Apr",
NSString *str;
str = [NSString stringWithFormat: @"%.4d%.2d%.2d",
[self yearOfCommonEra],
[self monthOfYear],
[self dayOfMonth]];
(int)[self yearOfCommonEra],
(int)[self monthOfYear],
(int)[self dayOfMonth]];
return str;
}
@@ -109,9 +109,9 @@ static NSString *rfc822Months[] = {@"", @"Jan", @"Feb", @"Mar", @"Apr",
return
[NSString stringWithFormat: @"%@, %.2d %@ %d %.2d:%.2d:%.2d %+.4d",
rfc822Days[[self dayOfWeek]], [self dayOfMonth],
rfc822Months[[self monthOfYear]], [self yearOfCommonEra],
[self hourOfDay], [self minuteOfHour], [self secondOfMinute],
rfc822Days[[self dayOfWeek]], (int)[self dayOfMonth],
rfc822Months[[self monthOfYear]], (int)[self yearOfCommonEra],
(int)[self hourOfDay], (int)[self minuteOfHour], (int)[self secondOfMinute],
timeZoneShift];
}
+1 -1
View File
@@ -46,7 +46,7 @@
{
NSString *newTag;
newTag = [NSString stringWithFormat: @"n%d", [namespaces count]];
newTag = [NSString stringWithFormat: @"n%d", (int)[namespaces count]];
[namespaces setObject: newTag forKey: newNS];
return newTag;
+1 -1
View File
@@ -309,7 +309,7 @@ static int cssEscapingCount;
c == 0xD ||
(c >= 0x20 && c <= 0xD7FF) ||
(c >= 0xE000 && c <= 0xFFFD) ||
(c >= 0x10000 && c <= 0x10FFFF))
(c >= (unichar)0x10000 && c <= (unichar)0x10FFFF))
{
*(start+j) = c;
j++;
+7 -9
View File
@@ -87,7 +87,7 @@ static EOAttribute *textColumn = nil;
{
tableUrl = nil;
initialized = NO;
objectType = -1;
objectType = (SOGoCacheObjectType) -1;
deleted = NO;
version = 0;
}
@@ -394,7 +394,7 @@ static EOAttribute *textColumn = nil;
@"SELECT * FROM %@ WHERE c_path = %@",
tableName, pathValue];
if (startVersion > -1)
[sql appendFormat: @" AND c_version > %d", startVersion];
[sql appendFormat: @" AND c_version > %d", (int)startVersion];
/* execution */
records = [self performSQLQuery: sql];
@@ -422,18 +422,16 @@ static EOAttribute *textColumn = nil;
tableName = [self tableName];
adaptor = [self tableChannelAdaptor];
pathValue = [adaptor formatValue: [NSString stringWithFormat: @"/%@", deviceId]
forAttribute: textColumn];
/* query */
sql = [NSMutableString stringWithFormat:
@"SELECT * FROM %@ WHERE c_type = %d AND c_deleted <> 1", tableName, objectType];
if (startVersion > -1)
[sql appendFormat: @" AND c_version > %d", startVersion];
[sql appendFormat: @" AND c_version > %d", (int)startVersion];
if (deviceId) {
pathValue = [adaptor formatValue: [NSString stringWithFormat: @"/%@%", deviceId]
pathValue = [adaptor formatValue: [NSString stringWithFormat: @"/%@", deviceId]
forAttribute: textColumn];
[sql appendFormat: @" AND c_path like %@", pathValue];
}
@@ -557,7 +555,7 @@ static EOAttribute *textColumn = nil;
lastModifiedValue = (NSInteger) [lastModified timeIntervalSince1970];
if (objectType == -1)
if (objectType == (SOGoCacheObjectType) -1)
[NSException raise: @"SOGoCacheIOException"
format: @"object type has not been set for object '%@'",
self];
@@ -587,7 +585,7 @@ static EOAttribute *textColumn = nil;
@")"),
tableName,
pathValue, parentPathValue, objectType,
creationDateValue, lastModifiedValue,
(int)creationDateValue, (int)lastModifiedValue,
propsValue];
isNew = NO;
}
@@ -601,7 +599,7 @@ static EOAttribute *textColumn = nil;
@" c_version = %d, c_content = %@"
@" WHERE c_path = %@"),
tableName,
lastModifiedValue, deletedValue, version, propsValue,
(int)lastModifiedValue, (int)deletedValue, (int)version, propsValue,
pathValue];
}
+6 -3
View File
@@ -94,7 +94,7 @@
{
[self subclassResponsibility: _cmd];
return nil;
return (Class *) nil;
}
- (void) _setRecord: (NSDictionary *) objectRecord
@@ -254,6 +254,9 @@
- (NSException *) moveToFolder: (SOGoGCSFolder *) newFolder
{
[self subclassResponsibility: _cmd];
// TODO: Add exception handling code and return it
return (NSException *) nil;
}
- (NSException *) delete
@@ -345,7 +348,7 @@
/* attempt a save */
error = [self saveComponent: [[self parsingClass] parseSingleFromSource: [rq contentAsString]]
error = [self saveComponent: [(id)[self parsingClass] parseSingleFromSource: [rq contentAsString]]
baseVersion: baseVersion];
if (error)
response = (WOResponse *) error;
@@ -410,7 +413,7 @@
else
length = 0;
return [NSString stringWithFormat: @"%u", length];
return [NSString stringWithFormat: @"%u", (unsigned int)length];
}
- (NSException *) davMoveToTargetObject: (id) _target
+1 -1
View File
@@ -107,7 +107,7 @@
- (void) setDisplayName: (NSString *) newDisplayName
{
ASSIGN (displayName, newDisplayName);
ASSIGN (displayName, [newDisplayName mutableCopy]);
}
- (NSString *) displayName
+4 -4
View File
@@ -376,12 +376,12 @@ static NSArray *childRecordFields = nil;
if (!displayName)
{
if (activeUserIsOwner)
displayName = [self _displayNameFromOwner];
displayName = [[self _displayNameFromOwner] mutableCopy];
else
{
displayName = [self _displayNameFromSubscriber];
displayName = [[self _displayNameFromSubscriber] mutableCopy];
if (!displayName)
displayName = [self _displayNameFromOwner];
displayName = [[self _displayNameFromOwner] mutableCopy];
}
[displayName retain];
}
@@ -829,7 +829,7 @@ static NSArray *childRecordFields = nil;
{
currentID = [ids objectAtIndex: count];
names = [[currentID componentsSeparatedByString: @"/"] objectEnumerator];
deleteObject = self;
deleteObject = (SOGoContentObject *)self;
while ((currentName = [names nextObject]))
{
deleteObject = [deleteObject lookupName: currentName
+2 -2
View File
@@ -135,7 +135,7 @@
{
NSArray *allSources;
NGLdapEntry *entry;
NSObject <SOGoSource> *source;
NSObject <SOGoSource, SOGoDNSource> *source;
id o;
NSEnumerator *gclasses;
NSString *gclass;
@@ -154,7 +154,7 @@
for (i = 0; i < [allSources count]; i++)
{
source = [[SOGoUserManager sharedUserManager] sourceWithID: [allSources objectAtIndex: i]];
source = (NSObject <SOGoSource, SOGoDNSource> *) [[SOGoUserManager sharedUserManager] sourceWithID: [allSources objectAtIndex: i]];
// Our different sources might not all implements groups support
if ([source respondsToSelector: theSelector])
+3 -3
View File
@@ -1066,7 +1066,7 @@
[_ms appendFormat:@" name=%@", nameInContainer];
if (container)
[_ms appendFormat:@" container=0x%08X/%@",
container, [container valueForKey:@"nameInContainer"]];
(unsigned int)container, [container valueForKey:@"nameInContainer"]];
}
- (NSString *) description
@@ -1074,7 +1074,7 @@
NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:64];
[ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
[ms appendFormat:@"<0x%08X[%@]:", (unsigned int) self, NSStringFromClass([self class])];
[self appendAttributesToDescription:ms];
[ms appendString:@">"];
@@ -1084,7 +1084,7 @@
- (NSString *) loggingPrefix
{
return [NSString stringWithFormat:@"<0x%08X[%@]:%@>",
self, NSStringFromClass([self class]),
(unsigned int) self, NSStringFromClass([self class]),
[self nameInContainer]];
}