diff --git a/Source/GSFormat.m b/Source/GSFormat.m index 3f1190553..58aecb879 100644 --- a/Source/GSFormat.m +++ b/Source/GSFormat.m @@ -1564,7 +1564,7 @@ NSDictionary *locale) /* The string argument could in fact be `char *' or `wchar_t *'. But this should not make a difference here. */ - string = (unichar *) args_value[specs[nspecs_done].data_arg].pa_wstring; + string = (unichar *) args_value[specs[nspecs_done].data_arg].pa_wstring; /* Entry point for printing other strings. */ LABEL (print_string): @@ -1616,6 +1616,7 @@ NSDictionary *locale) int prc; unichar *sp; wchar_t *wsp; + len = 0; prc = prec; wsp = (wchar_t *)string; diff --git a/Source/GSHTTPURLHandle.m b/Source/GSHTTPURLHandle.m index af1df472e..ff2941276 100644 --- a/Source/GSHTTPURLHandle.m +++ b/Source/GSHTTPURLHandle.m @@ -331,7 +331,7 @@ static NSLock *urlLock = nil; name = GSFileHandleConnectCompletionNotification; else if (connectionState == writing) name = GSFileHandleWriteCompletionNotification; - else if (connectionState == reading) + else name = NSFileHandleReadCompletionNotification; [nc removeObserver: self name: name object: sock]; diff --git a/Source/GSMime.m b/Source/GSMime.m index a6e721d09..ca4a2be07 100644 --- a/Source/GSMime.m +++ b/Source/GSMime.m @@ -1755,7 +1755,7 @@ parseCharacterSet(NSString *token) - (BOOL) _unfoldHeader { - char c; + char c = 0; BOOL unwrappingComplete = NO; lineStart = lineEnd; diff --git a/Source/GSString.m b/Source/GSString.m index 3ae690d0c..fdc09fc9e 100644 --- a/Source/GSString.m +++ b/Source/GSString.m @@ -2577,23 +2577,21 @@ transmute(ivars self, NSString *aString) withString: (NSString*)aString { int offset; - unsigned length; + unsigned length = 0; GS_RANGE_CHECK(aRange, _count); - if (aString == nil) + if (aString != nil) { - length = 0; + if (GSObjCIsInstance(aString) == NO) + { + [NSException raise: NSInvalidArgumentException + format: @"replace characters with non-string"]; + } + else + { + length = (aString == nil) ? 0 : [aString length]; + } } - else if (GSObjCIsInstance(aString) == NO) - { - [NSException raise: NSInvalidArgumentException - format: @"replace characters with non-string"]; - } - else - { - length = (aString == nil) ? 0 : [aString length]; - } - offset = length - aRange.length; if (offset < 0) diff --git a/Source/NSDictionary.m b/Source/NSDictionary.m index b8b88b50c..0cf39c43c 100644 --- a/Source/NSDictionary.m +++ b/Source/NSDictionary.m @@ -790,7 +790,7 @@ static NSString *indentStrings[] = { #define STRIDE_FACTOR 3 unsigned c,d, stride; BOOL found; - NSComparisonResult (*comp)(id, SEL, id); + NSComparisonResult (*comp)(id, SEL, id) = 0; int count = numKeys; #ifdef GSWARN BOOL badComparison = NO; diff --git a/Source/NSPortNameServer.m b/Source/NSPortNameServer.m index bce7ba29e..e437ff20b 100644 --- a/Source/NSPortNameServer.m +++ b/Source/NSPortNameServer.m @@ -580,7 +580,7 @@ typedef enum { NSRunLoop *loop = [NSRunLoop currentRunLoop]; struct in_addr singleServer; struct in_addr *svrs = &singleServer; - unsigned numSvrs; + unsigned numSvrs = 1; unsigned count; unsigned portNum = 0; unsigned len; @@ -616,7 +616,6 @@ typedef enum { /* * Query a single nameserver - on the local host. */ - numSvrs = 1; #ifndef HAVE_INET_ATON svrs->s_addr = inet_addr("127.0.0.1"); #else @@ -938,7 +937,7 @@ typedef enum { - (void) removePortForName: (NSString*)name { NSRunLoop *loop = [NSRunLoop currentRunLoop]; - GSPortCom *com; + GSPortCom *com = nil; unsigned len; NSDate *limit = [NSDate dateWithTimeIntervalSinceNow: timeout]; diff --git a/Source/NSSerializer.m b/Source/NSSerializer.m index ee29ca94b..2e6d81e86 100644 --- a/Source/NSSerializer.m +++ b/Source/NSSerializer.m @@ -159,7 +159,7 @@ serializeToInfo(id object, _NSSerializerInfo* info) { [NSException raise: NSInvalidArgumentException format: @"Class (%@) in property list - expected instance", - [c description]]; + [object description]]; } c = GSObjCClass(object); if (GSObjCIsKindOf(c, CStringClass) diff --git a/Source/NSURLHandle.m b/Source/NSURLHandle.m index 8b3d5240c..74c629fcb 100644 --- a/Source/NSURLHandle.m +++ b/Source/NSURLHandle.m @@ -492,6 +492,7 @@ static NSLock *fileLock = nil; } NS_HANDLER { + obj = nil; [fileLock unlock]; [localException raise]; } diff --git a/Source/NSUnarchiver.m b/Source/NSUnarchiver.m index da0d3da1b..18cafd3f7 100644 --- a/Source/NSUnarchiver.m +++ b/Source/NSUnarchiver.m @@ -319,6 +319,7 @@ static Class NSDataMallocClass; } NS_HANDLER { + obj = nil; RELEASE(unarchiver); [localException raise]; }