avoid some compiler warnings

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31107 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2010-08-10 10:38:50 +00:00
parent bffeaa25d7
commit e1a528b485
8 changed files with 36 additions and 15 deletions

View file

@ -1,3 +1,14 @@
2010-08-10 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSRunLoop.m:
* Source/NSURLProtocol.m:
* Source/GSAttributedString.m:
* Source/ObjectiveC2/properties.m:
* Source/NSProtocolChecker.m:
* Source/NSDistantObject.m:
* Tools/gdomap.c:
Functionless changes to avoid compiler warnings reported by Fred.
2010-08-07 Richard Frith-Macdonald <rfm@gnu.org> 2010-08-07 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSCalendarDate.m: Fix for %p AM/PM parsing to implicitly set * Source/NSCalendarDate.m: Fix for %p AM/PM parsing to implicitly set

View file

@ -625,8 +625,10 @@ SANITY();
- (void) setAttributes: (NSDictionary*)attributes - (void) setAttributes: (NSDictionary*)attributes
range: (NSRange)range range: (NSRange)range
{ {
unsigned tmpLength, arrayIndex, arraySize; unsigned tmpLength;
NSRange effectiveRange; unsigned arrayIndex = 0;
unsigned arraySize;
NSRange effectiveRange = NSMakeRange(0, NSNotFound);
unsigned afterRangeLoc, beginRangeLoc; unsigned afterRangeLoc, beginRangeLoc;
NSDictionary *attrs; NSDictionary *attrs;
NSZone *z = [self zone]; NSZone *z = [self zone];
@ -751,8 +753,10 @@ SANITY();
- (void) replaceCharactersInRange: (NSRange)range - (void) replaceCharactersInRange: (NSRange)range
withString: (NSString*)aString withString: (NSString*)aString
{ {
unsigned tmpLength, arrayIndex, arraySize; unsigned tmpLength;
NSRange effectiveRange; unsigned arrayIndex = 0;
unsigned arraySize;
NSRange effectiveRange = NSMakeRange(0, NSNotFound);
NSDictionary *attrs; NSDictionary *attrs;
GSAttrInfo *info; GSAttrInfo *info;
int moveLocations; int moveLocations;

View file

@ -717,7 +717,7 @@ enum proxyLocation
if ((uintptr_t)object_getClass(_protocol) == 0x2) if ((uintptr_t)object_getClass(_protocol) == 0x2)
{ {
extern struct objc_method_description* extern struct objc_method_description*
GSDescriptionForInstanceMethod(); GSDescriptionForInstanceMethod(Protocol *self, SEL aSel);
mth = GSDescriptionForInstanceMethod(_protocol, aSelector); mth = GSDescriptionForInstanceMethod(_protocol, aSelector);
} }
else else
@ -729,7 +729,7 @@ enum proxyLocation
if ((uintptr_t)object_getClass(_protocol) == 0x2) if ((uintptr_t)object_getClass(_protocol) == 0x2)
{ {
extern struct objc_method_description* extern struct objc_method_description*
GSDescriptionForClassMethod(); GSDescriptionForClassMethod(Protocol *self, SEL aSel);
mth = GSDescriptionForClassMethod(_protocol, aSelector); mth = GSDescriptionForClassMethod(_protocol, aSelector);
} }
else else

View file

@ -74,8 +74,10 @@
- (struct objc_method_description*) _methodDescription: (SEL)aSelector - (struct objc_method_description*) _methodDescription: (SEL)aSelector
{ {
extern struct objc_method_description *GSDescriptionForInstanceMethod(); extern struct objc_method_description
extern struct objc_method_description *GSDescriptionForClassMethod(); *GSDescriptionForInstanceMethod(Protocol *self, SEL aSel);
extern struct objc_method_description
*GSDescriptionForClassMethod(Protocol *self, SEL aSel);
if (_myProtocol != nil && _myTarget != nil) if (_myProtocol != nil && _myTarget != nil)
{ {

View file

@ -958,6 +958,8 @@ updateTimer(NSTimer *t, NSDate *d, NSTimeInterval now)
unsigned c; unsigned c;
unsigned i; unsigned i;
ei = 0.0; // Only needed to avoid compiler warning
/* /*
* Save current time so we don't keep redoing system call to * Save current time so we don't keep redoing system call to
* get it and so that we check timer fire dates against a known * get it and so that we check timer fire dates against a known
@ -1005,7 +1007,7 @@ updateTimer(NSTimer *t, NSDate *d, NSTimeInterval now)
{ {
GSIArrayRemoveItemAtIndexNoRelease(timers, i); GSIArrayRemoveItemAtIndexNoRelease(timers, i);
[t fire]; [t fire];
GSPrivateNotifyASAP(_currentMode); /* Post notifications. */ GSPrivateNotifyASAP(_currentMode);
IF_NO_GC([arp emptyPool]); IF_NO_GC([arp emptyPool]);
if (updateTimer(t, d, now) == YES) if (updateTimer(t, d, now) == YES)
{ {

View file

@ -916,7 +916,8 @@ static NSURLProtocol *placeholder = nil;
* it should be cached. * it should be cached.
*/ */
policy = [this->request cachePolicy]; policy = [this->request cachePolicy];
if (policy == NSURLRequestUseProtocolCachePolicy) if (policy
== (NSURLCacheStoragePolicy)NSURLRequestUseProtocolCachePolicy)
{ {
if ([self isKindOfClass: [_NSHTTPSURLProtocol class]] == YES) if ([self isKindOfClass: [_NSHTTPSURLProtocol class]] == YES)
{ {
@ -1074,7 +1075,8 @@ static NSURLProtocol *placeholder = nil;
* it should be cached. * it should be cached.
*/ */
policy = [this->request cachePolicy]; policy = [this->request cachePolicy];
if (policy == NSURLRequestUseProtocolCachePolicy) if (policy == (NSURLCacheStoragePolicy)
NSURLRequestUseProtocolCachePolicy)
{ {
if ([self isKindOfClass: [_NSHTTPSURLProtocol class]]) if ([self isKindOfClass: [_NSHTTPSURLProtocol class]])
{ {

View file

@ -51,7 +51,7 @@ objc_getProperty(id obj, SEL _cmd, ptrdiff_t offset, BOOL isAtomic)
if (isAtomic) if (isAtomic)
{ {
id result; id result = nil;
SYNCBEG(obj) SYNCBEG(obj)
result = objc_getProperty(obj, _cmd, offset, NO); result = objc_getProperty(obj, _cmd, offset, NO);

View file

@ -2067,9 +2067,9 @@ init_probe()
int elen = 0; int elen = 0;
struct in_addr *other; struct in_addr *other;
struct in_addr sin; struct in_addr sin;
int high; int high = 0;
int low; int low = 0;
unsigned long net; unsigned long net = 0;
int j; int j;
struct in_addr b; struct in_addr b;