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
+1 -1
View File
@@ -167,7 +167,7 @@
[self errorWithFormat:
@"not toolbar configuration found on SoObject: %@ (%@)",
[self clientObject], [[self clientObject] soClass]];
toolbarConfig = [[NSNull null] retain];
toolbarConfig = (NSArray *)[[NSNull null] retain];
return nil;
}
+1 -1
View File
@@ -141,7 +141,7 @@
content = [NSMutableString string];
response = [context response];
[content appendFormat: [[self clientObject] contentAsString]];
[content appendFormat: @"%@", [[self clientObject] contentAsString]];
[response setHeader: @"text/plain; charset=utf-8"
forKey: @"content-type"];
[response appendContentString: content];
+2 -2
View File
@@ -81,9 +81,9 @@
inContext: [self context]
acquire: NO];
if ([currentChild respondsToSelector: @selector (vCard)])
[content appendFormat: [[currentChild ldifRecord] ldifRecordAsString]];
[content appendFormat: @"%@", [[currentChild ldifRecord] ldifRecordAsString]];
else if ([currentChild respondsToSelector: @selector (vList)])
[content appendFormat: [[currentChild vList] ldifString]];
[content appendFormat: @"%@", [[currentChild vList] ldifString]];
[content appendString: @"\n"];
}
+1 -1
View File
@@ -384,7 +384,7 @@
data = [NSMutableString string];
[data appendString: postalCode];
if ([postalCode length] > 0 && [country length] > 0)
[data appendFormat: @", ", country];
[data appendFormat: @", "];
[data appendString: country];
return [self _cardStringWithLabel: nil value: data];
+4 -4
View File
@@ -551,9 +551,9 @@ static NSData* _sanitizeContent(NSData *theData)
else
skipAttribute = YES;
}
else if ([name isEqualToString: @"background"] ||
else if (([name isEqualToString: @"background"] ||
([name isEqualToString: @"data"]
|| [name isEqualToString: @"classid"])
|| [name isEqualToString: @"classid"]))
&& [lowerName isEqualToString: @"object"])
{
value = [_attributes valueAtIndex: count];
@@ -741,7 +741,7 @@ static NSData* _sanitizeContent(NSData *theData)
/* SaxLexicalHandler */
- (void) comment: (unichar *) _chars
length: (NSUInteger) _len
length: (int) _len
{
showWhoWeAre();
if (inStyle)
@@ -807,7 +807,7 @@ static NSData* _sanitizeContent(NSData *theData)
}
[dump appendFormat: @"--- end ---\n"];
NSLog(dump);
NSLog(@"%@", dump);
[dump release];
}
@@ -228,7 +228,7 @@
info = [parts objectAtIndex: i];
viewer = [[[self context] mailRenderingContext] viewerForBodyInfo: 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]];
}
}
+1 -1
View File
@@ -33,7 +33,7 @@
- (void) setChildInfo: (id) _info;
- (id) childInfo;
- (void) setChildIndex: (unsigned int) _index;
- (void) setChildIndex: (NSUInteger) _index;
- (id) childPartPath;
+1 -1
View File
@@ -61,7 +61,7 @@
return [NSString stringWithFormat: @"%u",
(unsigned int) ([self childIndex] + 1)];
char buf[8];
sprintf(buf, "%d", [self childIndex] + 1);
sprintf(buf, "%d", (int)[self childIndex] + 1);
return [NSString stringWithCString:buf];
}
+1 -1
View File
@@ -287,7 +287,7 @@
if ([filename length])
// 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
filename = [filename stringByReplacingString: @"/" withString: @"-"];
filename = [[filename stringByReplacingString: @"/" withString: @"-"] mutableCopy];
else
[filename appendFormat: @"%@-%@",
[self labelForKey: @"Untitled"],
+1 -1
View File
@@ -451,7 +451,7 @@
NSMutableDictionary *moduleSettings, *threadsCollapsed;
NSMutableArray *mailboxThreadsCollapsed;
NSString *destinationFolder;
SOGoUserSettings *us;
SOGoUserSettings *us=nil;
WOResponse *response;
NSDictionary *data;
SOGoMailFolder *co;
+1 -1
View File
@@ -620,7 +620,7 @@
- (NSString *) columnsDisplayCount
{
return [NSString stringWithFormat: @"%d", [[self columnsDisplayOrder] count]];
return [NSString stringWithFormat: @"%d", (int)[[self columnsDisplayOrder] count]];
}
- (void) setCurrentColumn: (NSDictionary *) newCurrentColumn
+2 -1
View File
@@ -57,6 +57,7 @@
#import <Mailer/SOGoMailFolder.h>
#import <MailPartViewers/UIxMailRenderingContext.h> // cyclic
#import <MailPartViewers/UIxMailSizeFormatter.h>
#import <MailPartViewers/UIxMailPartViewer.h>
#import "WOContext+UIxMailer.h"
#import "UIxMailFormatter.h"
@@ -229,7 +230,7 @@ static NSString *mailETag = nil;
- (id <WOActionResults>) defaultAction
{
id <WOActionResults> response;
WOResponse *response;
NSString *s;
NSMutableDictionary *data;
NSArray *addresses;
+1 -1
View File
@@ -47,7 +47,7 @@
id dispatcher;
Class clazz;
request = [context request];
request = (WORequest *)[context request];
response = [self responseWithStatus: 200];
bundle = [NSBundle bundleForClass: NSClassFromString(@"ActiveSyncProduct")];
+3 -3
View File
@@ -193,7 +193,7 @@
timeZone: [currentStartDate timeZone]];
// 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];
if (!hourData)
{
@@ -224,7 +224,7 @@
while ([currentDate compare: currentEndDate] == NSOrderedAscending &&
[currentEndDate timeIntervalSinceDate: currentDate] >= 3600) // 1 hour
{
hourKey = [NSString stringWithFormat: @"%u", [currentDate hourOfDay]];
hourKey = [NSString stringWithFormat: @"%u", (unsigned int)[currentDate hourOfDay]];
hourData = [dayData objectForKey: hourKey];
if (!hourData)
{
@@ -251,7 +251,7 @@
// Increment counters for quarters of last hour
if ([currentEndDate timeIntervalSinceDate: currentDate] > 0)
{
hourKey = [NSString stringWithFormat: @"%u", [currentDate hourOfDay]];
hourKey = [NSString stringWithFormat: @"%u", (unsigned int)[currentDate hourOfDay]];
hourData = [dayData objectForKey: hourKey];
if (!hourData)
{
+6 -6
View File
@@ -1471,15 +1471,15 @@ static NSArray *reminderValues = nil;
// if ([account updateFilters])
// // If Sieve is not enabled, the SOGoSieveManager will immediatly return a positive answer
// // See [SOGoSieveManager updateFiltersForAccount:withUsername:andPassword:]
// results = [self responseWithStatus: 200
// results = (id <WOActionResults>)[self responseWithStatus: 200
// andJSONRepresentation: [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:hasChanged], @"hasChanged", nil]];
// else
// results = [self responseWithStatus: 502
// results = (id <WOActionResults>)[self responseWithStatus: 502
// andJSONRepresentation: [NSDictionary dictionaryWithObjectsAndKeys: @"Connection error", @"textStatus", nil]];
// }
// else
// results = [self responseWithStatus: 503
// results = (id <WOActionResults>)[self responseWithStatus: 503
// andJSONRepresentation: [NSDictionary dictionaryWithObjectsAndKeys: @"Service temporarily unavailable", @"textStatus", nil]];
// }
// else
@@ -2167,12 +2167,12 @@ static NSArray *reminderValues = nil;
if (![account updateFilters])
{
results = [self responseWithStatus: 502
results = (id <WOActionResults>) [self responseWithStatus: 502
andJSONRepresentation: [NSDictionary dictionaryWithObjectsAndKeys: @"Connection error", @"textStatus", nil]];
}
}
else
results = [self responseWithStatus: 503
results = (id <WOActionResults>) [self responseWithStatus: 503
andJSONRepresentation: [NSDictionary dictionaryWithObjectsAndKeys: @"Service temporarily unavailable", @"textStatus", nil]];
}
}
@@ -2184,7 +2184,7 @@ static NSArray *reminderValues = nil;
}
if (!results)
results = [self responseWithStatus: 200];
results = (id <WOActionResults>) [self responseWithStatus: 200];
return results;
}
+5 -5
View File
@@ -155,14 +155,14 @@
*/
[_buf appendFormat:@"%02i:%02i",
[_date hourOfDay],
[_date minuteOfHour]];
(int)[_date hourOfDay],
(int)[_date minuteOfHour]];
if (_refDate && ![_date isDateOnSameDay:_refDate]) {
[_buf appendFormat:@" (%02i-%02i",
[_date monthOfYear],
[_date dayOfMonth]];
(int)[_date monthOfYear],
(int)[_date dayOfMonth]];
if ([_date yearOfCommonEra] != [_refDate yearOfCommonEra])
[_buf appendFormat:@"-%04i", [_date yearOfCommonEra]];
[_buf appendFormat:@"-%04i", (int)[_date yearOfCommonEra]];
[_buf appendString:@")"];
}
}
+2 -2
View File
@@ -117,7 +117,7 @@
date = [self startDate];
return [NSString stringWithFormat: @"%.2d", [date monthOfYear]];
return [NSString stringWithFormat: @"%.2d", (int)[date monthOfYear]];
}
- (NSString *) headerMonthString
@@ -136,7 +136,7 @@
date = [self startDate];
return [NSString stringWithFormat: @"%d", [date yearOfCommonEra]];
return [NSString stringWithFormat: @"%d", (int)[date yearOfCommonEra]];
}
- (NSString *) localizedDayOfWeekName
+3 -2
View File
@@ -39,7 +39,8 @@
NSArray *weekDays;
NSString *currentView, *timeFormat, *currentTableHour;
NSCalendarDate *startDate, *currentTableDay;
NSMutableArray *daysToDisplay, *calendarsToDisplay, *currentCalendar, *hoursToDisplay;
NSMutableArray *daysToDisplay, *calendarsToDisplay, *hoursToDisplay;
NSMutableDictionary *currentCalendar;
unsigned int numberOfDays;
}
@@ -55,7 +56,7 @@
- (NSArray *) calendarsToDisplay;
- (void) setCurrentTableDay: (NSCalendarDate *) aTableDay;
- (NSCalendarDate *) currentTableDay;
- (NSMutableArray *) currentCalendar;
- (NSMutableDictionary *) currentCalendar;
@end
+6 -6
View File
@@ -193,7 +193,7 @@
NSMutableDictionary *calendar;
unsigned int count, foldersCount;
NSString *folderName, *fDisplayName;
NSNumber *isActive;
BOOL isActive;
co = [self clientObject];
folders = [co subFolders];
@@ -202,8 +202,8 @@
for (count = 0; count < foldersCount; count++)
{
folder = [folders objectAtIndex: count];
isActive = [NSNumber numberWithBool: [folder isActive]];
if ([isActive intValue] != 0) {
isActive = [folder isActive];
if (isActive != NO) {
calendar = [NSMutableDictionary dictionary];
folderName = [folder nameInContainer];
fDisplayName = [folder displayName];
@@ -216,7 +216,7 @@
[calendar setObject: fDisplayName forKey: @"displayName"];
[calendar setObject: folderName forKey: @"folder"];
[calendar setObject: [folder calendarColor] forKey: @"color"];
[calendar setObject: isActive forKey: @"active"];
[calendar setObject: [NSNumber numberWithBool:isActive] forKey: @"active"];
[calendar setObject: [folder ownerInContext: context]
forKey: @"owner"];
[calendarsToDisplay addObject: calendar];
@@ -237,12 +237,12 @@
return currentTableDay;
}
- (void) setCurrentCalendar: (NSMutableArray *) aCalendar
- (void) setCurrentCalendar: (NSMutableDictionary *) aCalendar
{
ASSIGN(currentCalendar, aCalendar);
}
- (NSMutableArray *) currentCalendar
- (NSMutableDictionary *) currentCalendar
{
return currentCalendar;
}
+1 -1
View File
@@ -164,7 +164,7 @@
date = [self selectedDate];
hmString = [NSString stringWithFormat:@"%.2d%.2d",
[date hourOfDay], [date minuteOfHour]];
(int)[date hourOfDay], (int)[date minuteOfHour]];
qp = [[self queryParameters] mutableCopy];
[self setSelectedDateQueryParameter:date inDictionary:qp];
[qp setObject: hmString forKey:@"hm"];
+7 -7
View File
@@ -367,7 +367,7 @@ static NSArray *tasksFields = nil;
NSString *owner, *role, *calendarName, *iCalString, *recurrenceTime;
NSRange match;
iCalCalendar *calendar;
iCalObject *master;
iCalEntityObject *master;
SOGoAppointmentFolder *currentFolder;
SOGoAppointmentFolders *clientObject;
SOGoUser *ownerUser;
@@ -400,11 +400,11 @@ static NSArray *tasksFields = nil;
else if ([criteria isEqualToString:@"entireContent"])
{
// First search : Through the quick table inside the location, category and title columns
quickInfos = [currentFolder fetchCoreInfosFrom: startDate
quickInfos = [[currentFolder fetchCoreInfosFrom: startDate
to: endDate
title: value
component: component
additionalFilters: criteria];
additionalFilters: criteria] mutableCopy];
// Save the c_name in another array to compare with
if ([quickInfos count] > 0)
@@ -416,10 +416,10 @@ static NSArray *tasksFields = nil;
}
// Second research : Every objects except for those already in the quickInfos array
allInfos = [currentFolder fetchCoreInfosFrom: startDate
allInfos = [[currentFolder fetchCoreInfosFrom: startDate
to: endDate
title: nil
component: component];
component: component] mutableCopy];
if (quickInfosFlag == YES)
{
for (i = ([allInfos count] - 1); i >= 0 ; i--) {
@@ -433,7 +433,7 @@ static NSArray *tasksFields = nil;
{
iCalString = [[allInfos objectAtIndex:i] objectForKey:@"c_content"];
calendar = [iCalCalendar parseSingleFromSource: iCalString];
master = [calendar firstChildWithTag:component];
master = (iCalEntityObject *)[calendar firstChildWithTag:component];
if (master) {
if ([[master comment] length] > 0)
{
@@ -1314,7 +1314,7 @@ _computeBlocksPosition (NSArray *blocks)
if ([currentView isEqualToString: @"multicolumndayview"])
{
calendars = [self _selectedCalendars];
calendars = [[self _selectedCalendars] mutableCopy];
eventsByCalendars = [NSMutableArray arrayWithCapacity:[calendars count]];
for (i = 0; i < [calendars count]; i++) // For each calendar
{
+1 -1
View File
@@ -271,7 +271,7 @@
[classes appendFormat: @"day weekOf%d week%dof%d day%d",
numberOfWeeks,
[weeksToDisplay indexOfObject: currentWeek],
(int)[weeksToDisplay indexOfObject: currentWeek],
numberOfWeeks, dayOfWeek];
if (realDayOfWeek == 0 || realDayOfWeek == 6)
[classes appendString: @" weekEndDay"];
+2 -1
View File
@@ -49,6 +49,7 @@ static NSArray *layoutItems = nil;
- (void) dealloc
{
[item release];
[super dealloc];
}
- (void) setItem: (NSString *) newItem
@@ -68,7 +69,7 @@ static NSArray *layoutItems = nil;
- (NSString *) itemPrintLayoutText
{
return [self labelForKey: [NSString stringWithFormat: item]];
return [self labelForKey: [NSString stringWithFormat: @"%@", item]];
}
//
+1 -1
View File
@@ -896,7 +896,7 @@ static NSArray *reminderValues = nil;
content = [NSMutableString string];
response = [context response];
[content appendFormat: [[self clientObject] contentAsString]];
[content appendFormat: @"%@", [[self clientObject] contentAsString]];
[response setHeader: @"text/plain; charset=utf-8"
forKey: @"content-type"];
[response appendContentString: content];
+1 -1
View File
@@ -158,7 +158,7 @@
[shortWeekDaysList retain];
}
id = [NSString stringWithFormat: @"weekDay%i", [shortWeekDaysList indexOfObject: item]];
id = [NSString stringWithFormat: @"weekDay%i", (int)[shortWeekDaysList indexOfObject: item]];
return id;
}