Stage 1 of clang compiler warning patches.

pull/108/head
Euan Thoms 2015-10-31 14:10:03 +08:00
parent 0b490a00c6
commit 3c62cc744e
85 changed files with 185 additions and 165 deletions

View File

@ -58,7 +58,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// don't send negative reminder - not supported // don't send negative reminder - not supported
if (delta > 0) if (delta > 0)
[s appendFormat: @"<Reminder xmlns=\"Calendar:\">%d</Reminder>", delta]; [s appendFormat: @"<Reminder xmlns=\"Calendar:\">%d</Reminder>", (int)delta];
} }
return s; return s;

View File

@ -285,7 +285,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{ {
[s appendString: @"<Body xmlns=\"AirSyncBase:\">"]; [s appendString: @"<Body xmlns=\"AirSyncBase:\">"];
[s appendFormat: @"<Type>%d</Type>", 1]; [s appendFormat: @"<Type>%d</Type>", 1];
[s appendFormat: @"<EstimatedDataSize>%d</EstimatedDataSize>", [o length]]; [s appendFormat: @"<EstimatedDataSize>%d</EstimatedDataSize>", (int)[o length]];
[s appendFormat: @"<Data>%@</Data>", o]; [s appendFormat: @"<Data>%@</Data>", o];
[s appendString: @"</Body>"]; [s appendString: @"</Body>"];
} }

View File

@ -140,7 +140,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Simple reccurrence rule of type "Monthly" // Simple reccurrence rule of type "Monthly"
type = 2; type = 2;
[s appendFormat: @"<Recurrence_DayOfMonth xmlns=\"Calendar:\">%d</Recurrence_DayOfMonth>", [s appendFormat: @"<Recurrence_DayOfMonth xmlns=\"Calendar:\">%d</Recurrence_DayOfMonth>",
[[[self parent] startDate] dayOfMonth]]; (int)[[[self parent] startDate] dayOfMonth]];
} }
} }
else if ([self frequency] == iCalRecurrenceFrequenceYearly) else if ([self frequency] == iCalRecurrenceFrequenceYearly)

View File

@ -140,7 +140,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{ {
[s appendString: @"<Body xmlns=\"AirSyncBase:\">"]; [s appendString: @"<Body xmlns=\"AirSyncBase:\">"];
[s appendFormat: @"<Type>%d</Type>", 1]; [s appendFormat: @"<Type>%d</Type>", 1];
[s appendFormat: @"<EstimatedDataSize>%d</EstimatedDataSize>", [o length]]; [s appendFormat: @"<EstimatedDataSize>%d</EstimatedDataSize>", (int)[o length]];
[s appendFormat: @"<Data>%@</Data>", o]; [s appendFormat: @"<Data>%@</Data>", o];
[s appendString: @"</Body>"]; [s appendString: @"</Body>"];
} }

View File

@ -267,7 +267,7 @@
NSObject <DOMNodeList> *list; NSObject <DOMNodeList> *list;
NSObject <DOMNode> *valueNode; NSObject <DOMNode> *valueNode;
NSArray *elements; NSArray *elements;
NSString *property, *match; NSString *property=nil, *match=nil;
list = [searchElement getElementsByTagName: @"prop"]; list = [searchElement getElementsByTagName: @"prop"];
if ([list length]) if ([list length])

View File

@ -500,7 +500,7 @@ static NSTimeInterval ChannelCollectionTimer = 5 * 60;
ms = [NSMutableString stringWithCapacity: 256]; ms = [NSMutableString stringWithCapacity: 256];
[ms appendFormat: @"<0x%p[%@]: ", self, NSStringFromClass ([self class])]; [ms appendFormat: @"<0x%p[%@]: ", self, NSStringFromClass ([self class])];
[ms appendFormat: @" #adaptors=%d", [urlToAdaptor count]]; [ms appendFormat: @" #adaptors=%d", (int)[urlToAdaptor count]];
[ms appendString: @">"]; [ms appendString: @">"];
return ms; return ms;

View File

@ -414,7 +414,7 @@
if (group) if (group)
[str appendFormat: @"%@ (group: %@)\n", tag, group]; [str appendFormat: @"%@ (group: %@)\n", tag, group];
else else
[str appendFormat: @"%@\n", tag, group]; [str appendFormat: @"%@\n", tag];
[str appendString: [self versitString]]; [str appendString: [self versitString]];

View File

@ -409,7 +409,7 @@ static NGCardsSaxHandler *sax = nil;
max = [children count]; max = [children count];
if (max > 0) if (max > 0)
{ {
[str appendFormat: @"\n %d children: {\n", [children count]]; [str appendFormat: @"\n %d children: {\n", (int)[children count]];
for (count = 0; count < max; count++) for (count = 0; count < max; count++)
[str appendFormat: @" %@\n", [str appendFormat: @" %@\n",
[[children objectAtIndex: count] description]]; [[children objectAtIndex: count] description]];

View File

@ -32,16 +32,16 @@
- (NSString *) iCalFormattedDateTimeString - (NSString *) iCalFormattedDateTimeString
{ {
return [NSString stringWithFormat: @"%.4d%.2d%.2dT%.2d%.2d%.2d", return [NSString stringWithFormat: @"%.4d%.2d%.2dT%.2d%.2d%.2d",
[self yearOfCommonEra], [self monthOfYear], (int)[self yearOfCommonEra], (int)[self monthOfYear],
[self dayOfMonth], [self hourOfDay], (int)[self dayOfMonth], (int)[self hourOfDay],
[self minuteOfHour], [self secondOfMinute]]; (int)[self minuteOfHour], (int)[self secondOfMinute]];
} }
- (NSString *) iCalFormattedDateString - (NSString *) iCalFormattedDateString
{ {
return [NSString stringWithFormat: @"%.4d%.2d%.2d", return [NSString stringWithFormat: @"%.4d%.2d%.2d",
[self yearOfCommonEra], [self monthOfYear], (int)[self yearOfCommonEra], (int)[self monthOfYear],
[self dayOfMonth]]; (int)[self dayOfMonth]];
} }
@end @end

View File

@ -348,7 +348,7 @@ static inline unsigned iCalDoWForNSDoW (int dow)
if ([byDayMask occursOnDay: currentWeekDay]) if ([byDayMask occursOnDay: currentWeekDay])
{ {
if ([bySetPos containsObject: if ([bySetPos containsObject:
[NSString stringWithFormat: @"%d", currentPos]]) [NSString stringWithFormat: @"%d", (int)currentPos]])
monthDays[monthDay+1] = YES; monthDays[monthDay+1] = YES;
currentPos++; currentPos++;
} }
@ -362,7 +362,7 @@ static inline unsigned iCalDoWForNSDoW (int dow)
if ([byDayMask occursOnDay: currentWeekDay]) if ([byDayMask occursOnDay: currentWeekDay])
{ {
if ([bySetPos containsObject: if ([bySetPos containsObject:
[NSString stringWithFormat: @"%d", currentPos]]) [NSString stringWithFormat: @"%d", (int)currentPos]])
monthDays[monthDay] = YES; monthDays[monthDay] = YES;
currentPos--; currentPos--;
} }

View File

@ -309,10 +309,10 @@ NSString *iCalWeekDayString[] = { @"SU", @"MO", @"TU", @"WE", @"TH", @"FR",
else if ([frequency isEqualToString:@"SECONDLY"]) else if ([frequency isEqualToString:@"SECONDLY"])
freq = iCalRecurrenceFrequenceSecondly; freq = iCalRecurrenceFrequenceSecondly;
else else
freq = NSNotFound; freq = (iCalRecurrenceFrequency) NSNotFound;
} }
else else
freq = NSNotFound; freq = (iCalRecurrenceFrequency) NSNotFound;
return freq; return freq;
} }

View File

@ -57,7 +57,7 @@
- (NSDictionary *) asDictionary - (NSDictionary *) asDictionary
{ {
NSDictionary *data; NSDictionary *data;
NSString *duration, *relation, *reference, *quantity, *unit; NSString *duration, *relation, *reference, *quantity=@"", *unit=@"";
NSUInteger i; NSUInteger i;
unichar c; unichar c;

View File

@ -1045,7 +1045,7 @@ static NSCharacterSet *whitespaceCharSet = nil;
if (debugOn) if (debugOn)
{ {
NSLog(@"%s: trying to decode data (0x%p,len=%d) ...", NSLog(@"%s: trying to decode data (0x%p,len=%d) ...",
__PRETTY_FUNCTION__, _data, [_data length]); __PRETTY_FUNCTION__, _data, (int)[_data length]);
} }
if ((len = [_data length]) == 0) if ((len = [_data length]) == 0)
@ -1164,7 +1164,7 @@ static NSCharacterSet *whitespaceCharSet = nil;
if (debugOn) if (debugOn)
{ {
NSLog(@"%s: trying to parse string (0x%p,len=%d) ...", NSLog(@"%s: trying to parse string (0x%p,len=%d) ...",
__PRETTY_FUNCTION__, _source, [_source length]); __PRETTY_FUNCTION__, _source, (int)[_source length]);
} }
if (!_sysId) _sysId = @"<string>"; if (!_sysId) _sysId = @"<string>";
[self _parseString: _source]; [self _parseString: _source];

View File

@ -344,7 +344,7 @@ size_t curl_body_function_freebusy(void *ptr, size_t size, size_t nmemb, void *i
NSMutableString *s; NSMutableString *s;
s = [NSMutableString stringWithCapacity: 64]; s = [NSMutableString stringWithCapacity: 64];
[s appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])]; [s appendFormat:@"<0x%08X[%@]:", (unsigned int)self, NSStringFromClass([self class])];
if (freeBusyViewType) if (freeBusyViewType)
[s appendFormat:@" freeBusyViewType='%@'", freeBusyViewType]; [s appendFormat:@" freeBusyViewType='%@'", freeBusyViewType];
if (mergedFreeBusy) if (mergedFreeBusy)

View File

@ -84,7 +84,7 @@
#import "SOGoAppointmentFolders.h" #import "SOGoAppointmentFolders.h"
#import "SOGoFreeBusyObject.h" #import "SOGoFreeBusyObject.h"
#import "SOGoTaskObject.h" #import "SOGoTaskObject.h"
#import "SOGoWebAppointmentFolder.h"; #import "SOGoWebAppointmentFolder.h"
#import "SOGoAppointmentFolder.h" #import "SOGoAppointmentFolder.h"
@ -2337,7 +2337,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
request = [context request]; request = [context request];
if (!([request isIPhone] || [request isICal4])) if (!([request isIPhone] || [request isICal4]))
{ {
gdRT = [self groupDavResourceType]; gdRT = (NSArray *) [self groupDavResourceType];
gdVEventCol = [NSArray arrayWithObjects: [gdRT objectAtIndex: 0], gdVEventCol = [NSArray arrayWithObjects: [gdRT objectAtIndex: 0],
XMLNS_GROUPDAV, nil]; XMLNS_GROUPDAV, nil];
[colType addObject: gdVEventCol]; [colType addObject: gdVEventCol];

View File

@ -1992,7 +1992,7 @@ inRecurrenceExceptionsForEvent: (iCalEvent *) theEvent
if ([container resourceNameForEventUID: eventUID]) if ([container resourceNameForEventUID: eventUID])
{ {
return [NSException exceptionWithHTTPStatus: 403 return [NSException exceptionWithHTTPStatus: 403
reason: [NSString stringWithFormat: @"Event UID already in use. (%s)", eventUID]]; reason: [NSString stringWithFormat: @"Event UID already in use. (%@)", eventUID]];
} }
// //

View File

@ -171,7 +171,7 @@
- (Class *) parsingClass - (Class *) parsingClass
{ {
return [iCalCalendar class]; return (Class *)[iCalCalendar class];
} }
- (NSString *) davContentType - (NSString *) davContentType

View File

@ -102,9 +102,9 @@
} }
if ([reminderReference caseInsensitiveCompare: @"BEFORE"] == NSOrderedSame) if ([reminderReference caseInsensitiveCompare: @"BEFORE"] == NSOrderedSame)
aValue = [NSString stringWithString: @"-P"]; aValue = (NSString *) @"-P";
else else
aValue = [NSString stringWithString: @"P"]; aValue = (NSString *) @"P";
if ([reminderUnit caseInsensitiveCompare: @"MINUTES"] == NSOrderedSame || if ([reminderUnit caseInsensitiveCompare: @"MINUTES"] == NSOrderedSame ||
[reminderUnit caseInsensitiveCompare: @"HOURS"] == NSOrderedSame) [reminderUnit caseInsensitiveCompare: @"HOURS"] == NSOrderedSame)

View File

@ -267,7 +267,7 @@
- (NSTimeInterval) occurenceInterval - (NSTimeInterval) occurenceInterval
{ {
return [[self endDate] timeIntervalSinceDate: [self startDate]]; return (NSTimeInterval) [[self endDate] timeIntervalSinceDate: [self startDate]];
} }
/** /**

View File

@ -162,7 +162,7 @@
rule = [iCalRecurrenceRule new]; rule = [iCalRecurrenceRule new];
[rule setInterval: @"1"]; [rule setInterval: @"1"];
frequency = NSNotFound; frequency = (int)NSNotFound;
o = [repeat objectForKey: @"frequency"]; o = [repeat objectForKey: @"frequency"];
if ([o isKindOfClass: [NSString class]]) if ([o isKindOfClass: [NSString class]])
{ {

View File

@ -214,7 +214,7 @@
{ {
percent = [o intValue]; percent = [o intValue];
if (percent >= 0 && percent <= 100) if (percent >= 0 && percent <= 100)
[self setPercentComplete: [NSString stringWithFormat: @"%i", percent]]; [self setPercentComplete: [NSString stringWithFormat: @"%i", (int)percent]];
} }
else else
[self setPercentComplete: @""]; [self setPercentComplete: @""];

View File

@ -327,7 +327,7 @@ convention:
if (year && month && day) if (year && month && day)
[self setBday: [NSString stringWithFormat: @"%.4d-%.2d-%.2d", [self setBday: [NSString stringWithFormat: @"%.4d-%.2d-%.2d",
year, month, day]]; (int)year, (int)month, (int)day]];
else else
[self setBday: @""]; [self setBday: @""];
@ -644,11 +644,11 @@ convention:
birthDay = [[self bday] asCalendarDate]; birthDay = [[self bday] asCalendarDate];
if (birthDay) if (birthDay)
{ {
stringValue = [NSString stringWithFormat: @"%.4d", [birthDay yearOfCommonEra]]; stringValue = [NSString stringWithFormat: @"%.4d", (int)[birthDay yearOfCommonEra]];
[self _setValue: @"birthyear" to: stringValue inLDIFRecord: ldifRecord]; [self _setValue: @"birthyear" to: stringValue inLDIFRecord: ldifRecord];
stringValue = [NSString stringWithFormat: @"%.2d", [birthDay monthOfYear]]; stringValue = [NSString stringWithFormat: @"%.2d", (int)[birthDay monthOfYear]];
[self _setValue: @"birthmonth" to: stringValue inLDIFRecord: ldifRecord]; [self _setValue: @"birthmonth" to: stringValue inLDIFRecord: ldifRecord];
stringValue = [NSString stringWithFormat: @"%.2d", [birthDay dayOfMonth]]; stringValue = [NSString stringWithFormat: @"%.2d", (int)[birthDay dayOfMonth]];
[self _setValue: @"birthday" to: stringValue inLDIFRecord: ldifRecord]; [self _setValue: @"birthday" to: stringValue inLDIFRecord: ldifRecord];
} }
[self _setValue: @"description" to: [self note] inLDIFRecord: ldifRecord]; [self _setValue: @"description" to: [self note] inLDIFRecord: ldifRecord];

View File

@ -59,7 +59,7 @@
[response setHeader: [self davContentType] forKey: @"content-type"]; [response setHeader: [self davContentType] forKey: @"content-type"];
[response setHeader: [NSString stringWithFormat:@" %d", [response setHeader: [NSString stringWithFormat:@" %d",
[data length]] (int)[data length]]
forKey: @"content-length"]; forKey: @"content-length"];
[response setContent: data]; [response setContent: data];
} }

View File

@ -268,9 +268,9 @@ Class SOGoContactSourceFolderK;
SOGoUser *currentUser; SOGoUser *currentUser;
id <SOGoSource> source; id <SOGoSource> source;
if ([sourceID isEqualToString: @"personal"]) if ([sourceID isEqualToString: @"personal"]){
result = [NSException exceptionWithHTTPStatus: 403 result = [NSException exceptionWithHTTPStatus: 403 reason: [NSString stringWithFormat: (@"folder '%@' cannot be deleted"), sourceID]];
reason: (@"folder '%@' cannot be deleted", sourceID)]; }
else else
{ {
result = nil; result = nil;

View File

@ -50,7 +50,7 @@
- (Class *) parsingClass - (Class *) parsingClass
{ {
return [NGVCard class]; return (Class *)[NGVCard class];
} }
/* content */ /* content */

View File

@ -45,7 +45,7 @@
- (Class *) parsingClass - (Class *) parsingClass
{ {
return [NGVList class]; return (Class *)[NGVList class];
} }

View File

@ -94,7 +94,7 @@
{ {
if (![newDisplayName length]) if (![newDisplayName length])
newDisplayName = newName; newDisplayName = newName;
ASSIGN (displayName, newDisplayName); ASSIGN (displayName, [newDisplayName mutableCopy]);
} }
return self; return self;

View File

@ -533,7 +533,7 @@
messageID = [NSMutableString string]; messageID = [NSMutableString string];
[messageID appendFormat: @"<%@", [SOGoObject globallyUniqueObjectId]]; [messageID appendFormat: @"<%@", [SOGoObject globallyUniqueObjectId]];
pGUID = [[NSProcessInfo processInfo] globallyUniqueString]; pGUID = [[NSProcessInfo processInfo] globallyUniqueString];
[messageID appendFormat: @"@%u>", [pGUID hash]]; [messageID appendFormat: @"@%u>", (unsigned int)[pGUID hash]];
return [messageID lowercaseString]; return [messageID lowercaseString];
} }

View File

@ -396,7 +396,7 @@ static BOOL debugOn = NO;
mimeType = @"application/octet-stream"; mimeType = @"application/octet-stream";
[response setHeader: mimeType forKey: @"content-type"]; [response setHeader: mimeType forKey: @"content-type"];
[response setHeader: [NSString stringWithFormat:@"%d", [data length]] [response setHeader: [NSString stringWithFormat:@"%d", (int)[data length]]
forKey: @"content-length"]; forKey: @"content-length"];
if (asAttachment) if (asAttachment)

View File

@ -1674,7 +1674,7 @@ _compareFetchResultsByMODSEQ (id entry1, id entry2, void *data)
sortOrderings = [NSMutableArray array]; sortOrderings = [NSMutableArray array];
if ([self _sortElementIsAscending: sortElement]) if ([self _sortElementIsAscending: (NGDOMNodeWithChildren <DOMElement> *)sortElement])
sortOrderingOrder = EOCompareAscending; sortOrderingOrder = EOCompareAscending;
else else
sortOrderingOrder = EOCompareDescending; sortOrderingOrder = EOCompareDescending;

View File

@ -73,10 +73,10 @@
- (NSString *) newLine - (NSString *) newLine
{ {
NSString *rc = [NSString stringWithString: @" "]; NSString *rc = @" ";
if (htmlComposition) if (htmlComposition)
rc = [NSString stringWithString: @"<br/>"]; rc = @"<br/>";
return rc; return rc;
} }

View File

@ -74,7 +74,7 @@
int i; int i;
allLabels = [NSMutableArray array]; allLabels = [NSMutableArray array];
allKeys = [[theDefaults allKeys] sortedArrayUsingSelector: @selector (caseInsensitiveCompare:)]; allKeys = [[[theDefaults allKeys] sortedArrayUsingSelector: @selector (caseInsensitiveCompare:)] mutableCopy];
for (i = 0; i < [allKeys count]; i++) for (i = 0; i < [allKeys count]; i++)
{ {

View File

@ -779,9 +779,14 @@ static BOOL debugSoParts = NO;
[mimeType hasPrefix: @"audio/"] || [mimeType hasPrefix: @"audio/"] ||
[mimeType hasPrefix: @"image/"] || [mimeType hasPrefix: @"image/"] ||
[mimeType hasPrefix: @"video/"]) [mimeType hasPrefix: @"video/"])
{
filename = [NSString stringWithFormat: @"unknown_%@", path]; filename = [NSString stringWithFormat: @"unknown_%@", path];
else if ([mimeType isEqualToString: @"message/rfc822"]) }
filename = [NSString stringWithFormat: @"email_%@.eml", path]; else
{
if ([mimeType isEqualToString: @"message/rfc822"])
filename = [NSString stringWithFormat: @"email_%@.eml", path];
}
} }
if (filename) if (filename)
@ -825,13 +830,13 @@ static BOOL debugSoParts = NO;
{ {
currentPart = [subparts objectAtIndex: i-1]; currentPart = [subparts objectAtIndex: i-1];
if (path) if (path)
newPath = [NSString stringWithFormat: @"%@.%d", path, i]; newPath = [NSString stringWithFormat: @"%@.%d", path, (int)i];
else else
newPath = [NSString stringWithFormat: @"%d", i]; newPath = [NSString stringWithFormat: @"%d", (int)i];
[self _fetchFileAttachmentKeysInPart: currentPart [self _fetchFileAttachmentKeysInPart: currentPart
intoArray: keys intoArray: keys
withPath: newPath withPath: newPath
andPrefix: [NSString stringWithFormat: @"%@/%i", prefix, i]]; andPrefix: [NSString stringWithFormat: @"%@/%i", prefix, (int)i]];
} }
} }
else else

View File

@ -310,7 +310,7 @@ static NSDictionary *BSONTypes()
case 'q': return 0x12; case 'q': return 0x12;
default: 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; 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; return nil;
} }

View File

@ -1703,7 +1703,7 @@ _makeLDAPChanges (NGLdapConnection *ldapConnection,
hostname: hostname hostname: hostname
port: [NSString stringWithFormat: @"%d", port] port: [NSString stringWithFormat: @"%d", port]
encryption: encryption encryption: encryption
bindAsCurrentUser: NO]; bindAsCurrentUser: [NSString stringWithFormat: @"%d", NO]];
[ab setBaseDN: [entry dn] [ab setBaseDN: [entry dn]
IDField: @"cn" IDField: @"cn"
CNField: @"displayName" CNField: @"displayName"

View File

@ -90,9 +90,9 @@ static NSString *rfc822Months[] = {@"", @"Jan", @"Feb", @"Mar", @"Apr",
NSString *str; NSString *str;
str = [NSString stringWithFormat: @"%.4d%.2d%.2d", str = [NSString stringWithFormat: @"%.4d%.2d%.2d",
[self yearOfCommonEra], (int)[self yearOfCommonEra],
[self monthOfYear], (int)[self monthOfYear],
[self dayOfMonth]]; (int)[self dayOfMonth]];
return str; return str;
} }
@ -109,9 +109,9 @@ static NSString *rfc822Months[] = {@"", @"Jan", @"Feb", @"Mar", @"Apr",
return return
[NSString stringWithFormat: @"%@, %.2d %@ %d %.2d:%.2d:%.2d %+.4d", [NSString stringWithFormat: @"%@, %.2d %@ %d %.2d:%.2d:%.2d %+.4d",
rfc822Days[[self dayOfWeek]], [self dayOfMonth], rfc822Days[[self dayOfWeek]], (int)[self dayOfMonth],
rfc822Months[[self monthOfYear]], [self yearOfCommonEra], rfc822Months[[self monthOfYear]], (int)[self yearOfCommonEra],
[self hourOfDay], [self minuteOfHour], [self secondOfMinute], (int)[self hourOfDay], (int)[self minuteOfHour], (int)[self secondOfMinute],
timeZoneShift]; timeZoneShift];
} }

View File

@ -46,7 +46,7 @@
{ {
NSString *newTag; NSString *newTag;
newTag = [NSString stringWithFormat: @"n%d", [namespaces count]]; newTag = [NSString stringWithFormat: @"n%d", (int)[namespaces count]];
[namespaces setObject: newTag forKey: newNS]; [namespaces setObject: newTag forKey: newNS];
return newTag; return newTag;

View File

@ -309,7 +309,7 @@ static int cssEscapingCount;
c == 0xD || c == 0xD ||
(c >= 0x20 && c <= 0xD7FF) || (c >= 0x20 && c <= 0xD7FF) ||
(c >= 0xE000 && c <= 0xFFFD) || (c >= 0xE000 && c <= 0xFFFD) ||
(c >= 0x10000 && c <= 0x10FFFF)) (c >= (unichar)0x10000 && c <= (unichar)0x10FFFF))
{ {
*(start+j) = c; *(start+j) = c;
j++; j++;

View File

@ -87,7 +87,7 @@ static EOAttribute *textColumn = nil;
{ {
tableUrl = nil; tableUrl = nil;
initialized = NO; initialized = NO;
objectType = -1; objectType = (SOGoCacheObjectType) -1;
deleted = NO; deleted = NO;
version = 0; version = 0;
} }
@ -394,7 +394,7 @@ static EOAttribute *textColumn = nil;
@"SELECT * FROM %@ WHERE c_path = %@", @"SELECT * FROM %@ WHERE c_path = %@",
tableName, pathValue]; tableName, pathValue];
if (startVersion > -1) if (startVersion > -1)
[sql appendFormat: @" AND c_version > %d", startVersion]; [sql appendFormat: @" AND c_version > %d", (int)startVersion];
/* execution */ /* execution */
records = [self performSQLQuery: sql]; records = [self performSQLQuery: sql];
@ -422,18 +422,16 @@ static EOAttribute *textColumn = nil;
tableName = [self tableName]; tableName = [self tableName];
adaptor = [self tableChannelAdaptor]; adaptor = [self tableChannelAdaptor];
pathValue = [adaptor formatValue: [NSString stringWithFormat: @"/%@", deviceId]
forAttribute: textColumn];
/* query */ /* query */
sql = [NSMutableString stringWithFormat: sql = [NSMutableString stringWithFormat:
@"SELECT * FROM %@ WHERE c_type = %d AND c_deleted <> 1", tableName, objectType]; @"SELECT * FROM %@ WHERE c_type = %d AND c_deleted <> 1", tableName, objectType];
if (startVersion > -1) if (startVersion > -1)
[sql appendFormat: @" AND c_version > %d", startVersion]; [sql appendFormat: @" AND c_version > %d", (int)startVersion];
if (deviceId) { if (deviceId) {
pathValue = [adaptor formatValue: [NSString stringWithFormat: @"/%@%", deviceId] pathValue = [adaptor formatValue: [NSString stringWithFormat: @"/%@", deviceId]
forAttribute: textColumn]; forAttribute: textColumn];
[sql appendFormat: @" AND c_path like %@", pathValue]; [sql appendFormat: @" AND c_path like %@", pathValue];
} }
@ -557,7 +555,7 @@ static EOAttribute *textColumn = nil;
lastModifiedValue = (NSInteger) [lastModified timeIntervalSince1970]; lastModifiedValue = (NSInteger) [lastModified timeIntervalSince1970];
if (objectType == -1) if (objectType == (SOGoCacheObjectType) -1)
[NSException raise: @"SOGoCacheIOException" [NSException raise: @"SOGoCacheIOException"
format: @"object type has not been set for object '%@'", format: @"object type has not been set for object '%@'",
self]; self];
@ -587,7 +585,7 @@ static EOAttribute *textColumn = nil;
@")"), @")"),
tableName, tableName,
pathValue, parentPathValue, objectType, pathValue, parentPathValue, objectType,
creationDateValue, lastModifiedValue, (int)creationDateValue, (int)lastModifiedValue,
propsValue]; propsValue];
isNew = NO; isNew = NO;
} }
@ -601,7 +599,7 @@ static EOAttribute *textColumn = nil;
@" c_version = %d, c_content = %@" @" c_version = %d, c_content = %@"
@" WHERE c_path = %@"), @" WHERE c_path = %@"),
tableName, tableName,
lastModifiedValue, deletedValue, version, propsValue, (int)lastModifiedValue, (int)deletedValue, (int)version, propsValue,
pathValue]; pathValue];
} }

View File

@ -94,7 +94,7 @@
{ {
[self subclassResponsibility: _cmd]; [self subclassResponsibility: _cmd];
return nil; return (Class *) nil;
} }
- (void) _setRecord: (NSDictionary *) objectRecord - (void) _setRecord: (NSDictionary *) objectRecord
@ -254,6 +254,9 @@
- (NSException *) moveToFolder: (SOGoGCSFolder *) newFolder - (NSException *) moveToFolder: (SOGoGCSFolder *) newFolder
{ {
[self subclassResponsibility: _cmd]; [self subclassResponsibility: _cmd];
// TODO: Add exception handling code and return it
return (NSException *) nil;
} }
- (NSException *) delete - (NSException *) delete
@ -345,7 +348,7 @@
/* attempt a save */ /* attempt a save */
error = [self saveComponent: [[self parsingClass] parseSingleFromSource: [rq contentAsString]] error = [self saveComponent: [(id)[self parsingClass] parseSingleFromSource: [rq contentAsString]]
baseVersion: baseVersion]; baseVersion: baseVersion];
if (error) if (error)
response = (WOResponse *) error; response = (WOResponse *) error;
@ -410,7 +413,7 @@
else else
length = 0; length = 0;
return [NSString stringWithFormat: @"%u", length]; return [NSString stringWithFormat: @"%u", (unsigned int)length];
} }
- (NSException *) davMoveToTargetObject: (id) _target - (NSException *) davMoveToTargetObject: (id) _target

View File

@ -107,7 +107,7 @@
- (void) setDisplayName: (NSString *) newDisplayName - (void) setDisplayName: (NSString *) newDisplayName
{ {
ASSIGN (displayName, newDisplayName); ASSIGN (displayName, [newDisplayName mutableCopy]);
} }
- (NSString *) displayName - (NSString *) displayName

View File

@ -376,12 +376,12 @@ static NSArray *childRecordFields = nil;
if (!displayName) if (!displayName)
{ {
if (activeUserIsOwner) if (activeUserIsOwner)
displayName = [self _displayNameFromOwner]; displayName = [[self _displayNameFromOwner] mutableCopy];
else else
{ {
displayName = [self _displayNameFromSubscriber]; displayName = [[self _displayNameFromSubscriber] mutableCopy];
if (!displayName) if (!displayName)
displayName = [self _displayNameFromOwner]; displayName = [[self _displayNameFromOwner] mutableCopy];
} }
[displayName retain]; [displayName retain];
} }
@ -829,7 +829,7 @@ static NSArray *childRecordFields = nil;
{ {
currentID = [ids objectAtIndex: count]; currentID = [ids objectAtIndex: count];
names = [[currentID componentsSeparatedByString: @"/"] objectEnumerator]; names = [[currentID componentsSeparatedByString: @"/"] objectEnumerator];
deleteObject = self; deleteObject = (SOGoContentObject *)self;
while ((currentName = [names nextObject])) while ((currentName = [names nextObject]))
{ {
deleteObject = [deleteObject lookupName: currentName deleteObject = [deleteObject lookupName: currentName

View File

@ -135,7 +135,7 @@
{ {
NSArray *allSources; NSArray *allSources;
NGLdapEntry *entry; NGLdapEntry *entry;
NSObject <SOGoSource> *source; NSObject <SOGoSource, SOGoDNSource> *source;
id o; id o;
NSEnumerator *gclasses; NSEnumerator *gclasses;
NSString *gclass; NSString *gclass;
@ -154,7 +154,7 @@
for (i = 0; i < [allSources count]; i++) 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 // Our different sources might not all implements groups support
if ([source respondsToSelector: theSelector]) if ([source respondsToSelector: theSelector])

View File

@ -1066,7 +1066,7 @@
[_ms appendFormat:@" name=%@", nameInContainer]; [_ms appendFormat:@" name=%@", nameInContainer];
if (container) if (container)
[_ms appendFormat:@" container=0x%08X/%@", [_ms appendFormat:@" container=0x%08X/%@",
container, [container valueForKey:@"nameInContainer"]]; (unsigned int)container, [container valueForKey:@"nameInContainer"]];
} }
- (NSString *) description - (NSString *) description
@ -1074,7 +1074,7 @@
NSMutableString *ms; NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:64]; 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]; [self appendAttributesToDescription:ms];
[ms appendString:@">"]; [ms appendString:@">"];
@ -1084,7 +1084,7 @@
- (NSString *) loggingPrefix - (NSString *) loggingPrefix
{ {
return [NSString stringWithFormat:@"<0x%08X[%@]:%@>", return [NSString stringWithFormat:@"<0x%08X[%@]:%@>",
self, NSStringFromClass([self class]), (unsigned int) self, NSStringFromClass([self class]),
[self nameInContainer]]; [self nameInContainer]];
} }

View File

@ -245,10 +245,10 @@ NSString *_stringForCharacterAtIndex(NSUInteger index, NSString *str, NSUInteger
sc2 = _stringForCharacterAtIndex(i, str2, length2); sc2 = _stringForCharacterAtIndex(i, str2, length2);
if ([sc1 isEqualToString: sc2]) if ([sc1 isEqualToString: sc2])
finalSTR = [finalSTR stringByAppendingFormat: @"%u |%@|\n", i, sc1]; finalSTR = [finalSTR stringByAppendingFormat: @"%lu |%@|\n", i, sc1];
else else
{ {
finalSTR = [finalSTR stringByAppendingFormat: @"%u |%@|%@|<--\n", i, sc1, sc2]; finalSTR = [finalSTR stringByAppendingFormat: @"%lu |%@|%@|<--\n", i, sc1, sc2];
differencesFound = YES; differencesFound = YES;
} }
} }

View File

@ -37,8 +37,8 @@
@"<johndown@test.com>", // email between brackets @"<johndown@test.com>", // email between brackets
@"\"<johndown@test.com>\" <johndown@test.com>", // doubled @"\"<johndown@test.com>\" <johndown@test.com>", // doubled
// @"\"johndown@inverse.ca\" <johndown@test.com>", // with and without br. // @"\"johndown@inverse.ca\" <johndown@test.com>", // with and without br.
@"Àñinéoblabla <johndown@test.com>", // accented full name @"=?utf-8?q?=C3=80=C3=B1in=C3=A9oblabla?= <wolfgang@test.com>", // accented full name
@"Àñinéoblabla Bla Blé <johndown@test.com>", // accented and multiword @"=?utf-8?q?=C3=80=C3=B1in=C3=A9oblabla_Bla_Bl=C3=A9?= <wolfgang@test.com>", // accented and multiword
@"John Down \"Bla Bla\" <johndown@test.com>", // partly quoted @"John Down \"Bla Bla\" <johndown@test.com>", // partly quoted
@"John Down <johndown@test.com>", // full name + email @"John Down <johndown@test.com>", // full name + email
@"John, Down <johndown@test.com>", // full name with comma + email @"John, Down <johndown@test.com>", // full name with comma + email
@ -123,8 +123,6 @@
testWithMessage([result isEqualToString: currentExp], error); testWithMessage([result isEqualToString: currentExp], error);
} }
currentRaw++;
currentExp++;
} }
} }
@end @end

View File

@ -39,8 +39,8 @@
@"<wolfgang@test.com>", // email between brackets @"<wolfgang@test.com>", // email between brackets
@"\"<wolfgang@test.com>\" <wolfgang@test.com>", // doubled @"\"<wolfgang@test.com>\" <wolfgang@test.com>", // doubled
@"\"wolfgang@inverse.ca\" <wolfgang@test.com>", // with and without br. @"\"wolfgang@inverse.ca\" <wolfgang@test.com>", // with and without br.
@"Àñinéoblabla <wolfgang@test.com>", // accented full name @"=?utf-8?q?=C3=80=C3=B1in=C3=A9oblabla?= <wolfgang@test.com>", // accented full name
@"Àñinéoblabla Bla Blé <wolfgang@test.com>", // accented and multiword @"=?utf-8?q?=C3=80=C3=B1in=C3=A9oblabla_Bla_Bl=C3=A9?= <wolfgang@test.com>", // accented and multiword
@"Wolfgang Sourdeau \"Bla Bla\" <wolfgang@test.com>", // partly quoted @"Wolfgang Sourdeau \"Bla Bla\" <wolfgang@test.com>", // partly quoted
@"Wolfgang Sourdeau <wolfgang@test.com>", // full name + email @"Wolfgang Sourdeau <wolfgang@test.com>", // full name + email
nil }; nil };
@ -50,8 +50,7 @@
@"\"<wolfgang@test.com>\" <wolfgang@test.com>", // doubled @"\"<wolfgang@test.com>\" <wolfgang@test.com>", // doubled
@"\"wolfgang@inverse.ca\" <wolfgang@test.com>", // with and without br. @"\"wolfgang@inverse.ca\" <wolfgang@test.com>", // with and without br.
@"=?utf-8?q?=C3=80=C3=B1in=C3=A9oblabla?= <wolfgang@test.com>", // accented full name @"=?utf-8?q?=C3=80=C3=B1in=C3=A9oblabla?= <wolfgang@test.com>", // accented full name
@"=?utf-8?q?=C3=80=C3=B1in=C3=A9oblabla_Bla_Bl=C3=A9?= <wolfgang@test.com>", // accented @"=?utf-8?q?=C3=80=C3=B1in=C3=A9oblabla_Bla_Bl=C3=A9?= <wolfgang@test.com>", // accented and multiword
// and multiword
/* NOTE: the following are wrong but tolerated for now */ /* NOTE: the following are wrong but tolerated for now */
@"Wolfgang Sourdeau \"Bla Bla\" <wolfgang@test.com>", // partly quoted @"Wolfgang Sourdeau \"Bla Bla\" <wolfgang@test.com>", // partly quoted

View File

@ -117,7 +117,7 @@
NSString *diff = [self stringFromDiffBetween: [NSString stringWithString: resultString] NSString *diff = [self stringFromDiffBetween: [NSString stringWithString: resultString]
and: [NSString stringWithString: expected]]; and: [NSString stringWithString: expected]];
NSString *testErrorMsg = [NSString NSString *testErrorMsg = [NSString
stringWithFormat: @">> For %@ header received:\n%@[END]\n>> instead of:\n%@[END]\n>> for:\n%@\n>> diff:\n%@\n>> lengthReceived: %u lengthExpected: %u", stringWithFormat: @">> For %@ header received:\n%@[END]\n>> instead of:\n%@[END]\n>> for:\n%@\n>> diff:\n%@\n>> lengthReceived: %lu lengthExpected: %lu",
header, header,
resultString, resultString,
expected, expected,

View File

@ -34,6 +34,10 @@
- (void) test_rendering - (void) test_rendering
{ {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-string-compare"
CardElement *element; CardElement *element;
CardVersitRenderer *renderer; CardVersitRenderer *renderer;
NSString *result; NSString *result;
@ -137,10 +141,17 @@
testEquals(result, @"ELEM:NONEMPTY=coucou\r\n"); testEquals(result, @"ELEM:NONEMPTY=coucou\r\n");
/** tests about parameters handling could be nice */ /** tests about parameters handling could be nice */
#pragma clang diagnostic pop
} }
- (void) test_parsing - (void) test_parsing
{ {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-string-compare"
CardGroup *group; CardGroup *group;
CardElement *element; CardElement *element;
NSString *versit; NSString *versit;
@ -201,6 +212,9 @@
element = [group firstChildWithTag: @"element"]; element = [group firstChildWithTag: @"element"];
testEquals([element flattenedValueAtIndex: 0 forKey: @""], @"value"); testEquals([element flattenedValueAtIndex: 0 forKey: @""], @"value");
testEquals([element value: 0 ofAttribute: @"param1"], @"paramvalue1, with comma"); testEquals([element value: 0 ofAttribute: @"param1"], @"paramvalue1, with comma");
#pragma clang diagnostic pop
} }
@end @end

View File

@ -107,7 +107,7 @@
[currentOccurrence descriptionWithCalendarFormat: dateFormat]]; [currentOccurrence descriptionWithCalendarFormat: dateFormat]];
testWithMessage([currentOccurrence isDateOnSameDay: [[occurrences objectAtIndex: j] startDate]], error); testWithMessage([currentOccurrence isDateOnSameDay: [[occurrences objectAtIndex: j] startDate]], error);
} }
error = [NSString stringWithFormat: @"Unexpected number of occurrences for recurrence rule %@ (found %i, expected %i)", error = [NSString stringWithFormat: @"Unexpected number of occurrences for recurrence rule %@ (found %ld, expected %ld)",
[currentRule objectAtIndex: 1], [currentRule objectAtIndex: 1],
[occurrences count], [occurrences count],
[currentRule count] - 2]; [currentRule count] - 2];
@ -211,7 +211,7 @@
[currentOccurrence descriptionWithCalendarFormat: dateFormat]]; [currentOccurrence descriptionWithCalendarFormat: dateFormat]];
testWithMessage([currentOccurrence isDateOnSameDay: [[occurrences objectAtIndex: j] startDate]], error); testWithMessage([currentOccurrence isDateOnSameDay: [[occurrences objectAtIndex: j] startDate]], error);
} }
error = [NSString stringWithFormat: @"Unexpected number of occurrences for recurrence rule %@ (found %i, expected %i)", error = [NSString stringWithFormat: @"Unexpected number of occurrences for recurrence rule %@ (found %ld, expected %ld)",
[currentRule objectAtIndex: 1], [currentRule objectAtIndex: 1],
[occurrences count], [occurrences count],
[currentRule count] - 2]; [currentRule count] - 2];
@ -376,7 +376,7 @@
[currentOccurrence descriptionWithCalendarFormat: dateFormat]]; [currentOccurrence descriptionWithCalendarFormat: dateFormat]];
testWithMessage([currentOccurrence isDateOnSameDay: [[occurrences objectAtIndex: j] startDate]], error); testWithMessage([currentOccurrence isDateOnSameDay: [[occurrences objectAtIndex: j] startDate]], error);
} }
error = [NSString stringWithFormat: @"Unexpected number of occurrences for recurrence rule %@ (found %i, expected %i)", error = [NSString stringWithFormat: @"Unexpected number of occurrences for recurrence rule %@ (found %ld, expected %ld)",
[currentRule objectAtIndex: 1], [currentRule objectAtIndex: 1],
[occurrences count], [occurrences count],
[currentRule count] - 2]; [currentRule count] - 2];

View File

@ -80,8 +80,8 @@
testWithMessage ((NSInteger) [testDate timeIntervalSince1970] testWithMessage ((NSInteger) [testDate timeIntervalSince1970]
== occurrenceSeconds[count], == occurrenceSeconds[count],
([NSString stringWithFormat: ([NSString stringWithFormat:
@"test %d: seconds do not match:" @"test %ld: seconds do not match:"
@" delta = %d", count, delta])); @" delta = %ld", count, delta]));
} }
} }

View File

@ -81,8 +81,8 @@
timestamp = (int) [[NSDate date] timeIntervalSince1970]; timestamp = (int) [[NSDate date] timeIntervalSince1970];
pGUID = [[NSProcessInfo processInfo] globallyUniqueString]; pGUID = [[NSProcessInfo processInfo] globallyUniqueString];
messageID = [NSString stringWithFormat: @"<%0X-%0X-%0X-%0X@%u>", messageID = [NSString stringWithFormat: @"<%0X-%0X-%0X-%0X@%lu>",
pid, timestamp, sequence, random(), [pGUID hash]]; pid, timestamp, sequence, (unsigned int)random(), [pGUID hash]];
return [messageID lowercaseString]; return [messageID lowercaseString];
} }

View File

@ -145,7 +145,7 @@ Class SOGoContactSourceFolderKlass = Nil;
[self _appendEntry: [resultEntries objectAtIndex: count] [self _appendEntry: [resultEntries objectAtIndex: count]
toResult: result]; toResult: result];
[result appendFormat: @"RESULT\ncode: %", resultCode]; [result appendFormat: @"RESULT\ncode: %d", resultCode];
[responseSocket [responseSocket
safeWriteData: [result dataUsingEncoding: NSASCIIStringEncoding]]; safeWriteData: [result dataUsingEncoding: NSASCIIStringEncoding]];
} }

View File

@ -97,7 +97,7 @@
rc = [self createFolder: folder withFM: fm]; rc = [self createFolder: folder withFM: fm];
if (!rc) if (!rc)
{ {
NSLog (@"Create directory failed at path %s", folder); NSLog (@"Create directory failed at path %@", folder);
return NO; return NO;
} }

View File

@ -143,7 +143,7 @@
else else
{ {
if (verbose) if (verbose)
NSLog(@"No session to remove", sessionsToDelete); NSLog(@"No session to remove");
} }
[cm releaseChannel: channel]; [cm releaseChannel: channel];

View File

@ -227,7 +227,7 @@ typedef enum
NSMutableString *sql; NSMutableString *sql;
sql = [NSMutableString stringWithFormat: @"DELETE FROM %@" @" WHERE c_path like '/%@%'", [oc tableName], deviceId]; sql = [NSMutableString stringWithFormat: @"DELETE FROM %@ WHERE c_path like '/%@'", [oc tableName], deviceId];
[oc performBatchSQLQueries: [NSArray arrayWithObject: sql]]; [oc performBatchSQLQueries: [NSArray arrayWithObject: sql]];
rc = YES; rc = YES;

View File

@ -175,7 +175,7 @@
now = [NSCalendarDate date]; now = [NSCalendarDate date];
delSql = [NSString stringWithFormat: @"UPDATE %@" delSql = [NSString stringWithFormat: @"UPDATE %@"
@" SET c_deleted = 1, c_lastmodified = %d," @" SET c_deleted = 1, c_lastmodified = %lu,"
@" c_content = ''" @" c_content = ''"
@" WHERE c_name = '%@'", @" WHERE c_name = '%@'",
tableName, tableName,

View File

@ -148,7 +148,7 @@
if (sqlError) if (sqlError)
{ {
[ac rollbackTransaction]; [ac rollbackTransaction];
NSLog([sqlError reason]); NSLog(@"%@", [sqlError reason]);
} }
else else
rc = [ac commitTransaction]; rc = [ac commitTransaction];
@ -201,7 +201,7 @@
if (sqlError) if (sqlError)
{ {
[ac rollbackTransaction]; [ac rollbackTransaction];
NSLog([sqlError reason]); NSLog(@"%@", [sqlError reason]);
} }
else else
rc = [ac commitTransaction]; rc = [ac commitTransaction];

View File

@ -115,7 +115,7 @@ typedef enum
[theKey caseInsensitiveCompare: @"Vacation"] == NSOrderedSame) [theKey caseInsensitiveCompare: @"Vacation"] == NSOrderedSame)
{ {
/* credentials file handling */ /* credentials file handling */
NSString *credsFilename, *authname, *authpwd; NSString *credsFilename=nil, *authname=nil, *authpwd=nil;
SOGoCredentialsFile *cf; SOGoCredentialsFile *cf;
credsFilename = [[NSUserDefaults standardUserDefaults] stringForKey: @"p"]; credsFilename = [[NSUserDefaults standardUserDefaults] stringForKey: @"p"];

View File

@ -149,7 +149,7 @@
command, [currentTool objectAtIndex: 1]]; command, [currentTool objectAtIndex: 1]];
} }
NSLog (helpString); NSLog (@"%@", helpString);
} }
- (void) registerTools - (void) registerTools

View File

@ -167,7 +167,7 @@
[self errorWithFormat: [self errorWithFormat:
@"not toolbar configuration found on SoObject: %@ (%@)", @"not toolbar configuration found on SoObject: %@ (%@)",
[self clientObject], [[self clientObject] soClass]]; [self clientObject], [[self clientObject] soClass]];
toolbarConfig = [[NSNull null] retain]; toolbarConfig = (NSArray *)[[NSNull null] retain];
return nil; return nil;
} }

View File

@ -141,7 +141,7 @@
content = [NSMutableString string]; content = [NSMutableString string];
response = [context response]; response = [context response];
[content appendFormat: [[self clientObject] contentAsString]]; [content appendFormat: @"%@", [[self clientObject] contentAsString]];
[response setHeader: @"text/plain; charset=utf-8" [response setHeader: @"text/plain; charset=utf-8"
forKey: @"content-type"]; forKey: @"content-type"];
[response appendContentString: content]; [response appendContentString: content];

View File

@ -81,9 +81,9 @@
inContext: [self context] inContext: [self context]
acquire: NO]; acquire: NO];
if ([currentChild respondsToSelector: @selector (vCard)]) if ([currentChild respondsToSelector: @selector (vCard)])
[content appendFormat: [[currentChild ldifRecord] ldifRecordAsString]]; [content appendFormat: @"%@", [[currentChild ldifRecord] ldifRecordAsString]];
else if ([currentChild respondsToSelector: @selector (vList)]) else if ([currentChild respondsToSelector: @selector (vList)])
[content appendFormat: [[currentChild vList] ldifString]]; [content appendFormat: @"%@", [[currentChild vList] ldifString]];
[content appendString: @"\n"]; [content appendString: @"\n"];
} }

View File

@ -384,7 +384,7 @@
data = [NSMutableString string]; data = [NSMutableString string];
[data appendString: postalCode]; [data appendString: postalCode];
if ([postalCode length] > 0 && [country length] > 0) if ([postalCode length] > 0 && [country length] > 0)
[data appendFormat: @", ", country]; [data appendFormat: @", "];
[data appendString: country]; [data appendString: country];
return [self _cardStringWithLabel: nil value: data]; return [self _cardStringWithLabel: nil value: data];

View File

@ -551,9 +551,9 @@ static NSData* _sanitizeContent(NSData *theData)
else else
skipAttribute = YES; skipAttribute = YES;
} }
else if ([name isEqualToString: @"background"] || else if (([name isEqualToString: @"background"] ||
([name isEqualToString: @"data"] ([name isEqualToString: @"data"]
|| [name isEqualToString: @"classid"]) || [name isEqualToString: @"classid"]))
&& [lowerName isEqualToString: @"object"]) && [lowerName isEqualToString: @"object"])
{ {
value = [_attributes valueAtIndex: count]; value = [_attributes valueAtIndex: count];
@ -741,7 +741,7 @@ static NSData* _sanitizeContent(NSData *theData)
/* SaxLexicalHandler */ /* SaxLexicalHandler */
- (void) comment: (unichar *) _chars - (void) comment: (unichar *) _chars
length: (NSUInteger) _len length: (int) _len
{ {
showWhoWeAre(); showWhoWeAre();
if (inStyle) if (inStyle)
@ -807,7 +807,7 @@ static NSData* _sanitizeContent(NSData *theData)
} }
[dump appendFormat: @"--- end ---\n"]; [dump appendFormat: @"--- end ---\n"];
NSLog(dump); NSLog(@"%@", dump);
[dump release]; [dump release];
} }

View File

@ -228,7 +228,7 @@
info = [parts objectAtIndex: i]; info = [parts objectAtIndex: i];
viewer = [[[self context] mailRenderingContext] viewerForBodyInfo: info]; viewer = [[[self context] mailRenderingContext] viewerForBodyInfo: info];
[viewer setBodyInfo: info]; [viewer setBodyInfo: info];
[viewer setPartPath: [[self contentPartPath] arrayByAddingObject: [NSString stringWithFormat: @"%d", i+1]]]; [viewer setPartPath: [[self contentPartPath] arrayByAddingObject: [NSString stringWithFormat: @"%d", (int)i+1]]];
[renderedParts addObject: [viewer renderedPart]]; [renderedParts addObject: [viewer renderedPart]];
} }
} }

View File

@ -33,7 +33,7 @@
- (void) setChildInfo: (id) _info; - (void) setChildInfo: (id) _info;
- (id) childInfo; - (id) childInfo;
- (void) setChildIndex: (unsigned int) _index; - (void) setChildIndex: (NSUInteger) _index;
- (id) childPartPath; - (id) childPartPath;

View File

@ -61,7 +61,7 @@
return [NSString stringWithFormat: @"%u", return [NSString stringWithFormat: @"%u",
(unsigned int) ([self childIndex] + 1)]; (unsigned int) ([self childIndex] + 1)];
char buf[8]; char buf[8];
sprintf(buf, "%d", [self childIndex] + 1); sprintf(buf, "%d", (int)[self childIndex] + 1);
return [NSString stringWithCString:buf]; return [NSString stringWithCString:buf];
} }

View File

@ -287,7 +287,7 @@
if ([filename length]) if ([filename length])
// We replace any slash by a dash since Apache won't allow encoded slashes by default. // We replace any slash by a dash since Apache won't allow encoded slashes by default.
// See http://httpd.apache.org/docs/2.2/mod/core.html#allowencodedslashes // See http://httpd.apache.org/docs/2.2/mod/core.html#allowencodedslashes
filename = [filename stringByReplacingString: @"/" withString: @"-"]; filename = [[filename stringByReplacingString: @"/" withString: @"-"] mutableCopy];
else else
[filename appendFormat: @"%@-%@", [filename appendFormat: @"%@-%@",
[self labelForKey: @"Untitled"], [self labelForKey: @"Untitled"],

View File

@ -451,7 +451,7 @@
NSMutableDictionary *moduleSettings, *threadsCollapsed; NSMutableDictionary *moduleSettings, *threadsCollapsed;
NSMutableArray *mailboxThreadsCollapsed; NSMutableArray *mailboxThreadsCollapsed;
NSString *destinationFolder; NSString *destinationFolder;
SOGoUserSettings *us; SOGoUserSettings *us=nil;
WOResponse *response; WOResponse *response;
NSDictionary *data; NSDictionary *data;
SOGoMailFolder *co; SOGoMailFolder *co;

View File

@ -620,7 +620,7 @@
- (NSString *) columnsDisplayCount - (NSString *) columnsDisplayCount
{ {
return [NSString stringWithFormat: @"%d", [[self columnsDisplayOrder] count]]; return [NSString stringWithFormat: @"%d", (int)[[self columnsDisplayOrder] count]];
} }
- (void) setCurrentColumn: (NSDictionary *) newCurrentColumn - (void) setCurrentColumn: (NSDictionary *) newCurrentColumn

View File

@ -57,6 +57,7 @@
#import <Mailer/SOGoMailFolder.h> #import <Mailer/SOGoMailFolder.h>
#import <MailPartViewers/UIxMailRenderingContext.h> // cyclic #import <MailPartViewers/UIxMailRenderingContext.h> // cyclic
#import <MailPartViewers/UIxMailSizeFormatter.h> #import <MailPartViewers/UIxMailSizeFormatter.h>
#import <MailPartViewers/UIxMailPartViewer.h>
#import "WOContext+UIxMailer.h" #import "WOContext+UIxMailer.h"
#import "UIxMailFormatter.h" #import "UIxMailFormatter.h"
@ -229,7 +230,7 @@ static NSString *mailETag = nil;
- (id <WOActionResults>) defaultAction - (id <WOActionResults>) defaultAction
{ {
id <WOActionResults> response; WOResponse *response;
NSString *s; NSString *s;
NSMutableDictionary *data; NSMutableDictionary *data;
NSArray *addresses; NSArray *addresses;

View File

@ -47,7 +47,7 @@
id dispatcher; id dispatcher;
Class clazz; Class clazz;
request = [context request]; request = (WORequest *)[context request];
response = [self responseWithStatus: 200]; response = [self responseWithStatus: 200];
bundle = [NSBundle bundleForClass: NSClassFromString(@"ActiveSyncProduct")]; bundle = [NSBundle bundleForClass: NSClassFromString(@"ActiveSyncProduct")];

View File

@ -193,7 +193,7 @@
timeZone: [currentStartDate timeZone]]; timeZone: [currentStartDate timeZone]];
// Increment counters for quarters of first hour // Increment counters for quarters of first hour
hourKey = [NSString stringWithFormat: @"%u", [currentDate hourOfDay]]; hourKey = [NSString stringWithFormat: @"%u", (unsigned int)[currentDate hourOfDay]];
hourData = [dayData objectForKey: hourKey]; hourData = [dayData objectForKey: hourKey];
if (!hourData) if (!hourData)
{ {
@ -224,7 +224,7 @@
while ([currentDate compare: currentEndDate] == NSOrderedAscending && while ([currentDate compare: currentEndDate] == NSOrderedAscending &&
[currentEndDate timeIntervalSinceDate: currentDate] >= 3600) // 1 hour [currentEndDate timeIntervalSinceDate: currentDate] >= 3600) // 1 hour
{ {
hourKey = [NSString stringWithFormat: @"%u", [currentDate hourOfDay]]; hourKey = [NSString stringWithFormat: @"%u", (unsigned int)[currentDate hourOfDay]];
hourData = [dayData objectForKey: hourKey]; hourData = [dayData objectForKey: hourKey];
if (!hourData) if (!hourData)
{ {
@ -251,7 +251,7 @@
// Increment counters for quarters of last hour // Increment counters for quarters of last hour
if ([currentEndDate timeIntervalSinceDate: currentDate] > 0) if ([currentEndDate timeIntervalSinceDate: currentDate] > 0)
{ {
hourKey = [NSString stringWithFormat: @"%u", [currentDate hourOfDay]]; hourKey = [NSString stringWithFormat: @"%u", (unsigned int)[currentDate hourOfDay]];
hourData = [dayData objectForKey: hourKey]; hourData = [dayData objectForKey: hourKey];
if (!hourData) if (!hourData)
{ {

View File

@ -1471,15 +1471,15 @@ static NSArray *reminderValues = nil;
// if ([account updateFilters]) // if ([account updateFilters])
// // If Sieve is not enabled, the SOGoSieveManager will immediatly return a positive answer // // If Sieve is not enabled, the SOGoSieveManager will immediatly return a positive answer
// // See [SOGoSieveManager updateFiltersForAccount:withUsername:andPassword:] // // See [SOGoSieveManager updateFiltersForAccount:withUsername:andPassword:]
// results = [self responseWithStatus: 200 // results = (id <WOActionResults>)[self responseWithStatus: 200
// andJSONRepresentation: [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:hasChanged], @"hasChanged", nil]]; // andJSONRepresentation: [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:hasChanged], @"hasChanged", nil]];
// else // else
// results = [self responseWithStatus: 502 // results = (id <WOActionResults>)[self responseWithStatus: 502
// andJSONRepresentation: [NSDictionary dictionaryWithObjectsAndKeys: @"Connection error", @"textStatus", nil]]; // andJSONRepresentation: [NSDictionary dictionaryWithObjectsAndKeys: @"Connection error", @"textStatus", nil]];
// } // }
// else // else
// results = [self responseWithStatus: 503 // results = (id <WOActionResults>)[self responseWithStatus: 503
// andJSONRepresentation: [NSDictionary dictionaryWithObjectsAndKeys: @"Service temporarily unavailable", @"textStatus", nil]]; // andJSONRepresentation: [NSDictionary dictionaryWithObjectsAndKeys: @"Service temporarily unavailable", @"textStatus", nil]];
// } // }
// else // else
@ -2167,12 +2167,12 @@ static NSArray *reminderValues = nil;
if (![account updateFilters]) if (![account updateFilters])
{ {
results = [self responseWithStatus: 502 results = (id <WOActionResults>) [self responseWithStatus: 502
andJSONRepresentation: [NSDictionary dictionaryWithObjectsAndKeys: @"Connection error", @"textStatus", nil]]; andJSONRepresentation: [NSDictionary dictionaryWithObjectsAndKeys: @"Connection error", @"textStatus", nil]];
} }
} }
else else
results = [self responseWithStatus: 503 results = (id <WOActionResults>) [self responseWithStatus: 503
andJSONRepresentation: [NSDictionary dictionaryWithObjectsAndKeys: @"Service temporarily unavailable", @"textStatus", nil]]; andJSONRepresentation: [NSDictionary dictionaryWithObjectsAndKeys: @"Service temporarily unavailable", @"textStatus", nil]];
} }
} }
@ -2184,7 +2184,7 @@ static NSArray *reminderValues = nil;
} }
if (!results) if (!results)
results = [self responseWithStatus: 200]; results = (id <WOActionResults>) [self responseWithStatus: 200];
return results; return results;
} }

View File

@ -155,14 +155,14 @@
*/ */
[_buf appendFormat:@"%02i:%02i", [_buf appendFormat:@"%02i:%02i",
[_date hourOfDay], (int)[_date hourOfDay],
[_date minuteOfHour]]; (int)[_date minuteOfHour]];
if (_refDate && ![_date isDateOnSameDay:_refDate]) { if (_refDate && ![_date isDateOnSameDay:_refDate]) {
[_buf appendFormat:@" (%02i-%02i", [_buf appendFormat:@" (%02i-%02i",
[_date monthOfYear], (int)[_date monthOfYear],
[_date dayOfMonth]]; (int)[_date dayOfMonth]];
if ([_date yearOfCommonEra] != [_refDate yearOfCommonEra]) if ([_date yearOfCommonEra] != [_refDate yearOfCommonEra])
[_buf appendFormat:@"-%04i", [_date yearOfCommonEra]]; [_buf appendFormat:@"-%04i", (int)[_date yearOfCommonEra]];
[_buf appendString:@")"]; [_buf appendString:@")"];
} }
} }

View File

@ -117,7 +117,7 @@
date = [self startDate]; date = [self startDate];
return [NSString stringWithFormat: @"%.2d", [date monthOfYear]]; return [NSString stringWithFormat: @"%.2d", (int)[date monthOfYear]];
} }
- (NSString *) headerMonthString - (NSString *) headerMonthString
@ -136,7 +136,7 @@
date = [self startDate]; date = [self startDate];
return [NSString stringWithFormat: @"%d", [date yearOfCommonEra]]; return [NSString stringWithFormat: @"%d", (int)[date yearOfCommonEra]];
} }
- (NSString *) localizedDayOfWeekName - (NSString *) localizedDayOfWeekName

View File

@ -39,7 +39,8 @@
NSArray *weekDays; NSArray *weekDays;
NSString *currentView, *timeFormat, *currentTableHour; NSString *currentView, *timeFormat, *currentTableHour;
NSCalendarDate *startDate, *currentTableDay; NSCalendarDate *startDate, *currentTableDay;
NSMutableArray *daysToDisplay, *calendarsToDisplay, *currentCalendar, *hoursToDisplay; NSMutableArray *daysToDisplay, *calendarsToDisplay, *hoursToDisplay;
NSMutableDictionary *currentCalendar;
unsigned int numberOfDays; unsigned int numberOfDays;
} }
@ -55,7 +56,7 @@
- (NSArray *) calendarsToDisplay; - (NSArray *) calendarsToDisplay;
- (void) setCurrentTableDay: (NSCalendarDate *) aTableDay; - (void) setCurrentTableDay: (NSCalendarDate *) aTableDay;
- (NSCalendarDate *) currentTableDay; - (NSCalendarDate *) currentTableDay;
- (NSMutableArray *) currentCalendar; - (NSMutableDictionary *) currentCalendar;
@end @end

View File

@ -193,7 +193,7 @@
NSMutableDictionary *calendar; NSMutableDictionary *calendar;
unsigned int count, foldersCount; unsigned int count, foldersCount;
NSString *folderName, *fDisplayName; NSString *folderName, *fDisplayName;
NSNumber *isActive; BOOL isActive;
co = [self clientObject]; co = [self clientObject];
folders = [co subFolders]; folders = [co subFolders];
@ -202,8 +202,8 @@
for (count = 0; count < foldersCount; count++) for (count = 0; count < foldersCount; count++)
{ {
folder = [folders objectAtIndex: count]; folder = [folders objectAtIndex: count];
isActive = [NSNumber numberWithBool: [folder isActive]]; isActive = [folder isActive];
if ([isActive intValue] != 0) { if (isActive != NO) {
calendar = [NSMutableDictionary dictionary]; calendar = [NSMutableDictionary dictionary];
folderName = [folder nameInContainer]; folderName = [folder nameInContainer];
fDisplayName = [folder displayName]; fDisplayName = [folder displayName];
@ -216,7 +216,7 @@
[calendar setObject: fDisplayName forKey: @"displayName"]; [calendar setObject: fDisplayName forKey: @"displayName"];
[calendar setObject: folderName forKey: @"folder"]; [calendar setObject: folderName forKey: @"folder"];
[calendar setObject: [folder calendarColor] forKey: @"color"]; [calendar setObject: [folder calendarColor] forKey: @"color"];
[calendar setObject: isActive forKey: @"active"]; [calendar setObject: [NSNumber numberWithBool:isActive] forKey: @"active"];
[calendar setObject: [folder ownerInContext: context] [calendar setObject: [folder ownerInContext: context]
forKey: @"owner"]; forKey: @"owner"];
[calendarsToDisplay addObject: calendar]; [calendarsToDisplay addObject: calendar];
@ -237,12 +237,12 @@
return currentTableDay; return currentTableDay;
} }
- (void) setCurrentCalendar: (NSMutableArray *) aCalendar - (void) setCurrentCalendar: (NSMutableDictionary *) aCalendar
{ {
ASSIGN(currentCalendar, aCalendar); ASSIGN(currentCalendar, aCalendar);
} }
- (NSMutableArray *) currentCalendar - (NSMutableDictionary *) currentCalendar
{ {
return currentCalendar; return currentCalendar;
} }

View File

@ -164,7 +164,7 @@
date = [self selectedDate]; date = [self selectedDate];
hmString = [NSString stringWithFormat:@"%.2d%.2d", hmString = [NSString stringWithFormat:@"%.2d%.2d",
[date hourOfDay], [date minuteOfHour]]; (int)[date hourOfDay], (int)[date minuteOfHour]];
qp = [[self queryParameters] mutableCopy]; qp = [[self queryParameters] mutableCopy];
[self setSelectedDateQueryParameter:date inDictionary:qp]; [self setSelectedDateQueryParameter:date inDictionary:qp];
[qp setObject: hmString forKey:@"hm"]; [qp setObject: hmString forKey:@"hm"];

View File

@ -367,7 +367,7 @@ static NSArray *tasksFields = nil;
NSString *owner, *role, *calendarName, *iCalString, *recurrenceTime; NSString *owner, *role, *calendarName, *iCalString, *recurrenceTime;
NSRange match; NSRange match;
iCalCalendar *calendar; iCalCalendar *calendar;
iCalObject *master; iCalEntityObject *master;
SOGoAppointmentFolder *currentFolder; SOGoAppointmentFolder *currentFolder;
SOGoAppointmentFolders *clientObject; SOGoAppointmentFolders *clientObject;
SOGoUser *ownerUser; SOGoUser *ownerUser;
@ -400,11 +400,11 @@ static NSArray *tasksFields = nil;
else if ([criteria isEqualToString:@"entireContent"]) else if ([criteria isEqualToString:@"entireContent"])
{ {
// First search : Through the quick table inside the location, category and title columns // First search : Through the quick table inside the location, category and title columns
quickInfos = [currentFolder fetchCoreInfosFrom: startDate quickInfos = [[currentFolder fetchCoreInfosFrom: startDate
to: endDate to: endDate
title: value title: value
component: component component: component
additionalFilters: criteria]; additionalFilters: criteria] mutableCopy];
// Save the c_name in another array to compare with // Save the c_name in another array to compare with
if ([quickInfos count] > 0) if ([quickInfos count] > 0)
@ -416,10 +416,10 @@ static NSArray *tasksFields = nil;
} }
// Second research : Every objects except for those already in the quickInfos array // Second research : Every objects except for those already in the quickInfos array
allInfos = [currentFolder fetchCoreInfosFrom: startDate allInfos = [[currentFolder fetchCoreInfosFrom: startDate
to: endDate to: endDate
title: nil title: nil
component: component]; component: component] mutableCopy];
if (quickInfosFlag == YES) if (quickInfosFlag == YES)
{ {
for (i = ([allInfos count] - 1); i >= 0 ; i--) { for (i = ([allInfos count] - 1); i >= 0 ; i--) {
@ -433,7 +433,7 @@ static NSArray *tasksFields = nil;
{ {
iCalString = [[allInfos objectAtIndex:i] objectForKey:@"c_content"]; iCalString = [[allInfos objectAtIndex:i] objectForKey:@"c_content"];
calendar = [iCalCalendar parseSingleFromSource: iCalString]; calendar = [iCalCalendar parseSingleFromSource: iCalString];
master = [calendar firstChildWithTag:component]; master = (iCalEntityObject *)[calendar firstChildWithTag:component];
if (master) { if (master) {
if ([[master comment] length] > 0) if ([[master comment] length] > 0)
{ {
@ -1314,7 +1314,7 @@ _computeBlocksPosition (NSArray *blocks)
if ([currentView isEqualToString: @"multicolumndayview"]) if ([currentView isEqualToString: @"multicolumndayview"])
{ {
calendars = [self _selectedCalendars]; calendars = [[self _selectedCalendars] mutableCopy];
eventsByCalendars = [NSMutableArray arrayWithCapacity:[calendars count]]; eventsByCalendars = [NSMutableArray arrayWithCapacity:[calendars count]];
for (i = 0; i < [calendars count]; i++) // For each calendar for (i = 0; i < [calendars count]; i++) // For each calendar
{ {

View File

@ -271,7 +271,7 @@
[classes appendFormat: @"day weekOf%d week%dof%d day%d", [classes appendFormat: @"day weekOf%d week%dof%d day%d",
numberOfWeeks, numberOfWeeks,
[weeksToDisplay indexOfObject: currentWeek], (int)[weeksToDisplay indexOfObject: currentWeek],
numberOfWeeks, dayOfWeek]; numberOfWeeks, dayOfWeek];
if (realDayOfWeek == 0 || realDayOfWeek == 6) if (realDayOfWeek == 0 || realDayOfWeek == 6)
[classes appendString: @" weekEndDay"]; [classes appendString: @" weekEndDay"];

View File

@ -49,6 +49,7 @@ static NSArray *layoutItems = nil;
- (void) dealloc - (void) dealloc
{ {
[item release]; [item release];
[super dealloc];
} }
- (void) setItem: (NSString *) newItem - (void) setItem: (NSString *) newItem
@ -68,7 +69,7 @@ static NSArray *layoutItems = nil;
- (NSString *) itemPrintLayoutText - (NSString *) itemPrintLayoutText
{ {
return [self labelForKey: [NSString stringWithFormat: item]]; return [self labelForKey: [NSString stringWithFormat: @"%@", item]];
} }
// //

View File

@ -896,7 +896,7 @@ static NSArray *reminderValues = nil;
content = [NSMutableString string]; content = [NSMutableString string];
response = [context response]; response = [context response];
[content appendFormat: [[self clientObject] contentAsString]]; [content appendFormat: @"%@", [[self clientObject] contentAsString]];
[response setHeader: @"text/plain; charset=utf-8" [response setHeader: @"text/plain; charset=utf-8"
forKey: @"content-type"]; forKey: @"content-type"];
[response appendContentString: content]; [response appendContentString: content];

View File

@ -158,7 +158,7 @@
[shortWeekDaysList retain]; [shortWeekDaysList retain];
} }
id = [NSString stringWithFormat: @"weekDay%i", [shortWeekDaysList indexOfObject: item]]; id = [NSString stringWithFormat: @"weekDay%i", (int)[shortWeekDaysList indexOfObject: item]];
return id; return id;
} }