adium 2779:2da7f802de6e: Turning on a bunch of warnings—most s...

commits at adium.im commits at adium.im
Wed Oct 28 02:18:52 UTC 2009


details:	http://hg.adium.im/adium/rev/2da7f802de6e
revision:	2779:2da7f802de6e
author:		Peter Hosey <hg at boredzo.org>
date:		Tue Oct 27 18:17:27 2009 -0700

Turning on a bunch of warnings—most significantly, the 64-to-32 warning.
Subject: adium 2780:25eb9c078e5c: Set kMDItemDurationSeconds to a double, not an int. Fixes a warning.

details:	http://hg.adium.im/adium/rev/25eb9c078e5c
revision:	2780:25eb9c078e5c
author:		Peter Hosey <hg at boredzo.org>
date:		Tue Oct 27 18:21:10 2009 -0700

Set kMDItemDurationSeconds to a double, not an int. Fixes a warning.

The documentation explicitly says that non-integral values are supported: http://developer.apple.com/mac/library/documentation/Carbon/Reference/MDItemRef/Reference/reference.html#//apple_ref/doc/c_ref/kMDItemDurationSeconds
Subject: adium 2781:7ec5d0164293: Suppress built-in functions in the Spotlight importer.

details:	http://hg.adium.im/adium/rev/7ec5d0164293
revision:	2781:7ec5d0164293
author:		Peter Hosey <hg at boredzo.org>
date:		Tue Oct 27 18:31:37 2009 -0700

Suppress built-in functions in the Spotlight importer.

Fixes a warning of our strndup shadowing a built-in function (which I couldn't figure out how to use—the linker kept complaining that it didn't exist).
Subject: adium 2782:b96cccd8e18c: Fixed sign-comparison warnings by unifying variables on size_t instead of int.

details:	http://hg.adium.im/adium/rev/b96cccd8e18c
revision:	2782:b96cccd8e18c
author:		Peter Hosey <hg at boredzo.org>
date:		Tue Oct 27 18:40:52 2009 -0700

Fixed sign-comparison warnings by unifying variables on size_t instead of int.
Subject: adium 2783:255d85217b31: Renaming this variable to fix a shadowed-declaration warning.

details:	http://hg.adium.im/adium/rev/255d85217b31
revision:	2783:255d85217b31
author:		Peter Hosey <hg at boredzo.org>
date:		Tue Oct 27 18:42:26 2009 -0700

Renaming this variable to fix a shadowed-declaration warning.
Subject: adium 2784:be8506d2765d: Added explicit casts to suppress the last 64-to-32 warnings.

details:	http://hg.adium.im/adium/rev/be8506d2765d
revision:	2784:be8506d2765d
author:		Peter Hosey <hg at boredzo.org>
date:		Tue Oct 27 18:46:12 2009 -0700

Added explicit casts to suppress the last 64-to-32 warnings.

We are now back to zero warnings in the Spotlight importer.
Subject: adium 2785:7926f7ad8266: Turning on static analysis while building. No flags.

details:	http://hg.adium.im/adium/rev/7926f7ad8266
revision:	2785:7926f7ad8266
author:		Peter Hosey <hg at boredzo.org>
date:		Tue Oct 27 18:46:27 2009 -0700

Turning on static analysis while building. No flags.
Subject: adium 2786:6c9869fec62c: Turning on hardass mode for the Spotlight Importer.

details:	http://hg.adium.im/adium/rev/6c9869fec62c
revision:	2786:6c9869fec62c
author:		Peter Hosey <hg at boredzo.org>
date:		Tue Oct 27 18:47:03 2009 -0700

Turning on hardass mode for the Spotlight Importer.

diffs (164 lines):

diff -r dbc1dde294bd -r 6c9869fec62c Frameworks/AIUtilities Framework/Source/NSCalendarDate+ISO8601Parsing.m
--- a/Frameworks/AIUtilities Framework/Source/NSCalendarDate+ISO8601Parsing.m	Tue Oct 27 13:19:26 2009 -0400
+++ b/Frameworks/AIUtilities Framework/Source/NSCalendarDate+ISO8601Parsing.m	Tue Oct 27 18:47:03 2009 -0700
@@ -439,10 +439,10 @@
 						case 1:; //-YY; -YY-MM (implicit century)
 							NSLog(@"(%@) found %u digits and one hyphen, so this is either -YY or -YY-MM; segment (year) is %u", str, num_digits, segment);
 							unsigned current_year = [now yearOfCommonEra];
-							unsigned century = (current_year % 100U);
+							unsigned current_century = (current_year % 100U);
 							year = segment + (current_year - century);
 							if(num_digits == 1U) //implied decade
-								year += century - (current_year % 10U);
+								year += current_century - (current_year % 10U);
 
 							if(*ch == '-') {
 								++ch;
@@ -578,8 +578,8 @@
 												  month:month_or_week
 													day:day
 												   hour:hour
-												 minute:minute
-												 second:second
+												 minute:(NSUInteger)minute
+												 second:(NSUInteger)second
 											   timeZone:timeZone];
 					break;
 
@@ -600,8 +600,8 @@
 												  month:1
 													day:1
 												   hour:hour
-												 minute:minute
-												 second:second
+												 minute:(NSUInteger)minute
+												 second:(NSUInteger)second
 											   timeZone:timeZone];
 					date = [date dateByAddingYears:0
 											months:0
diff -r dbc1dde294bd -r 6c9869fec62c Other/Adium Spotlight Importer/AdiumSpotlightImporter.xcodeproj/project.pbxproj
--- a/Other/Adium Spotlight Importer/AdiumSpotlightImporter.xcodeproj/project.pbxproj	Tue Oct 27 13:19:26 2009 -0400
+++ b/Other/Adium Spotlight Importer/AdiumSpotlightImporter.xcodeproj/project.pbxproj	Tue Oct 27 18:47:03 2009 -0700
@@ -486,10 +486,26 @@
 				APPLY_RULES_IN_COPY_FILES = YES;
 				ARCHS = "$(NATIVE_ARCH)";
 				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_TREAT_WARNINGS_AS_ERRORS = YES;
 				GCC_VERSION = 4.2;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
+				GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
+				GCC_WARN_MISSING_PARENTHESES = YES;
+				GCC_WARN_SHADOW = YES;
+				GCC_WARN_SIGN_COMPARE = YES;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_LABEL = YES;
+				GCC_WARN_UNUSED_VALUE = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
 				INFOPLIST_OUTPUT_FORMAT = xml;
 				ONLY_ACTIVE_ARCH = YES;
+				OTHER_CFLAGS = "-fno-builtin";
 				PLIST_FILE_OUTPUT_FORMAT = xml;
+				RUN_CLANG_STATIC_ANALYZER = YES;
 				SDKROOT = macosx10.5;
 				SYMROOT = ../../build;
 				VALID_ARCHS = "i386 ppc ppc64 ppc7400 ppc970 x86_64";
@@ -644,9 +660,26 @@
 				APPLY_RULES_IN_COPY_FILES = YES;
 				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_TREAT_WARNINGS_AS_ERRORS = YES;
 				GCC_VERSION = 4.2;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
+				GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
+				GCC_WARN_MISSING_PARENTHESES = YES;
+				GCC_WARN_SHADOW = YES;
+				GCC_WARN_SIGN_COMPARE = YES;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_LABEL = YES;
+				GCC_WARN_UNUSED_VALUE = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
 				INFOPLIST_OUTPUT_FORMAT = binary;
+				OTHER_CFLAGS = "-fno-builtin";
 				PLIST_FILE_OUTPUT_FORMAT = binary;
+				RUN_CLANG_STATIC_ANALYZER = YES;
 				SDKROOT = macosx10.5;
 				SYMROOT = ../../build;
 			};
@@ -671,9 +704,26 @@
 				APPLY_RULES_IN_COPY_FILES = YES;
 				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
 				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_TREAT_WARNINGS_AS_ERRORS = YES;
 				GCC_VERSION = 4.2;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_CHECK_SWITCH_STATEMENTS = YES;
+				GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
+				GCC_WARN_MISSING_PARENTHESES = YES;
+				GCC_WARN_SHADOW = YES;
+				GCC_WARN_SIGN_COMPARE = YES;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_LABEL = YES;
+				GCC_WARN_UNUSED_VALUE = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
 				INFOPLIST_OUTPUT_FORMAT = binary;
+				OTHER_CFLAGS = "-fno-builtin";
 				PLIST_FILE_OUTPUT_FORMAT = binary;
+				RUN_CLANG_STATIC_ANALYZER = YES;
 				SDKROOT = macosx10.5;
 				SYMROOT = ../../build;
 			};
diff -r dbc1dde294bd -r 6c9869fec62c Other/Adium Spotlight Importer/GetMetadataForFile.m
--- a/Other/Adium Spotlight Importer/GetMetadataForFile.m	Tue Oct 27 13:19:26 2009 -0400
+++ b/Other/Adium Spotlight Importer/GetMetadataForFile.m	Tue Oct 27 18:47:03 2009 -0700
@@ -182,7 +182,7 @@
 			dateStr = [[(NSXMLElement *)[children lastObject] attributeForName:@"time"] objectValue];
 			endDate = (dateStr ? [NSCalendarDate calendarDateWithString:dateStr] : nil);
 			if (endDate)
-				[(NSMutableDictionary *)attributes setObject:[NSNumber numberWithInt:[endDate timeIntervalSinceDate:startDate]]
+				[(NSMutableDictionary *)attributes setObject:[NSNumber numberWithDouble:[endDate timeIntervalSinceDate:startDate]]
 													  forKey:(NSString *)kMDItemDurationSeconds];
 		}
 
diff -r dbc1dde294bd -r 6c9869fec62c Other/Adium Spotlight Importer/GetMetadataForHTMLLog.m
--- a/Other/Adium Spotlight Importer/GetMetadataForHTMLLog.m	Tue Oct 27 13:19:26 2009 -0400
+++ b/Other/Adium Spotlight Importer/GetMetadataForHTMLLog.m	Tue Oct 27 18:47:03 2009 -0700
@@ -249,13 +249,13 @@
 static char *
 gaim_markup_strip_html(const char *str)
 {
-	int i, j, k;
+	size_t i, j, k;
 	BOOL visible = TRUE;
 	BOOL closing_td_p = FALSE;
 	char *str2;
 	const char *cdata_close_tag = NULL;
 	char *href = NULL;
-	int href_st = 0;
+	size_t href_st = 0;
 	
 	if(!str)
 		return NULL;
@@ -314,8 +314,8 @@
 				if (strncasecmp(str2 + i, "<a", 2) == 0 &&
 				    g_ascii_isspace(str2[i+2]))
 				{
-					int st; /* start of href, inclusive [ */
-					int end; /* end of href, exclusive ) */
+					size_t st; /* start of href, inclusive [ */
+					size_t end; /* end of href, exclusive ) */
 					char delim = ' ';
 					/* Find start of href */
 					for (st = i + 3; st < k; st++)


More information about the commits mailing list