From 3da9ac45b790876fef67cbef92faf698b8083ded Mon Sep 17 00:00:00 2001 From: theraven Date: Sat, 10 Apr 2010 20:33:30 +0000 Subject: [PATCH] Lots of small tweaks to make -gui compile without warnings with clang. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30119 72102866-910b-0410-8b05-ffd578937521 --- Source/NSAnimation.m | 12 ++++++++---- Source/NSBitmapImageRep+GIF.m | 2 +- Source/NSBitmapImageRep+JPEG.m | 4 ++-- Source/NSBrowserCell.m | 2 +- Source/NSButtonCell.m | 10 +++++----- Source/NSCell.m | 12 ++++++------ Source/NSGraphicsContext.m | 2 +- Source/NSRulerMarker.m | 2 +- Source/NSSpellChecker.m | 2 +- Source/NSTextBlock.m | 14 +++++++++----- Source/NSTextList.m | 2 +- Source/NSTextTableBlock.m | 2 +- Source/NSView.m | 3 +-- 13 files changed, 38 insertions(+), 31 deletions(-) diff --git a/Source/NSAnimation.m b/Source/NSAnimation.m index ef8d323a1..2057ddd67 100644 --- a/Source/NSAnimation.m +++ b/Source/NSAnimation.m @@ -1300,9 +1300,13 @@ nsanimation_progressMarkSorter(NSAnimationProgress first, NSAnimationProgress se [self setTargetFrame: r]; if (_effect == NSViewAnimationFadeOutEffect) - /* subclassResponsibility */; + { + [self subclassResponsibility: _cmd]; + } if (_effect == NSViewAnimationFadeInEffect) - /* subclassResponsibility */; + { + [self subclassResponsibility: _cmd]; + } } else { @@ -1334,9 +1338,9 @@ nsanimation_progressMarkSorter(NSAnimationProgress first, NSAnimationProgress se - (void) setCurrentProgress: (float)progress { [super setCurrentProgress: progress]; - if (_effect == NSViewAnimationFadeOutEffect) + if (_effect == NSViewAnimationFadeOutEffect) {} /* ??? TODO */; - if (_effect == NSViewAnimationFadeInEffect) + if (_effect == NSViewAnimationFadeInEffect) {} /* ??? TODO */; if (progress>=1.0f) diff --git a/Source/NSBitmapImageRep+GIF.m b/Source/NSBitmapImageRep+GIF.m index 0bedfacec..3a3a534ed 100644 --- a/Source/NSBitmapImageRep+GIF.m +++ b/Source/NSBitmapImageRep+GIF.m @@ -162,7 +162,7 @@ static int gs_gif_output(GifFileType *file, const GifByteType *buffer, int len) }\ else \ {\ - NSLog(msg);\ + NSLog(@"%@", msg);\ } #define GIF_CREATE_ERROR(msg) \ diff --git a/Source/NSBitmapImageRep+JPEG.m b/Source/NSBitmapImageRep+JPEG.m index cef3e4d7c..68a006214 100644 --- a/Source/NSBitmapImageRep+JPEG.m +++ b/Source/NSBitmapImageRep+JPEG.m @@ -491,7 +491,7 @@ static void gs_jpeg_memory_dest_destroy (j_compress_ptr cinfo) if (jerrMgr.parent.num_warnings) { - NSLog(@"NSBitmapImageRep+JPEG: %d warnings during jpeg decompression, " + NSLog(@"NSBitmapImageRep+JPEG: %ld warnings during jpeg decompression, " @"image may be corrupted", jerrMgr.parent.num_warnings); } @@ -549,7 +549,7 @@ static void gs_jpeg_memory_dest_destroy (j_compress_ptr cinfo) if (errorMsg != NULL) *errorMsg = em; else - NSLog (em); + NSLog (@"JPEG image rep: Planar Image, not handled yet !"); return nil; } diff --git a/Source/NSBrowserCell.m b/Source/NSBrowserCell.m index 5eafa4364..f6248abae 100644 --- a/Source/NSBrowserCell.m +++ b/Source/NSBrowserCell.m @@ -144,7 +144,7 @@ static NSFont *_leafFont; { NSBrowserCell *c = [super copyWithZone: zone]; - TEST_RETAIN (_alternateImage); + _alternateImage = TEST_RETAIN (_alternateImage); //c->_browsercell_is_leaf = _browsercell_is_leaf; //c->_browsercell_is_loaded = _browsercell_is_loaded; diff --git a/Source/NSButtonCell.m b/Source/NSButtonCell.m index 7979729ac..0624210d0 100644 --- a/Source/NSButtonCell.m +++ b/Source/NSButtonCell.m @@ -1477,11 +1477,11 @@ typedef struct _GSButtonCellFlags NSButtonCell *c = [super copyWithZone: zone]; c->_altContents = [_altContents copyWithZone: zone]; - TEST_RETAIN(_altImage); - TEST_RETAIN(_keyEquivalent); - TEST_RETAIN(_keyEquivalentFont); - TEST_RETAIN(_sound); - TEST_RETAIN(_backgroundColor); + _altImage = TEST_RETAIN(_altImage); + _keyEquivalent = TEST_RETAIN(_keyEquivalent); + _keyEquivalentFont = TEST_RETAIN(_keyEquivalentFont); + _sound = TEST_RETAIN(_sound); + _backgroundColor = TEST_RETAIN(_backgroundColor); return c; } diff --git a/Source/NSCell.m b/Source/NSCell.m index e589fd311..36f4e4589 100644 --- a/Source/NSCell.m +++ b/Source/NSCell.m @@ -2326,12 +2326,12 @@ static NSColor *dtxtCol; /* Because of performance issues (and because so the doc says) only pointers to the objects are copied. We need to RETAIN them all though. */ - TEST_RETAIN (_font); - TEST_RETAIN (_object_value); - TEST_RETAIN (_menu); - TEST_RETAIN (_cell_image); - TEST_RETAIN (_formatter); - TEST_RETAIN (_represented_object); + _font = TEST_RETAIN (_font); + _object_value = TEST_RETAIN (_object_value); + _menu = TEST_RETAIN (_menu); + _cell_image = TEST_RETAIN (_cell_image); + _formatter = TEST_RETAIN (_formatter); + _formatter = TEST_RETAIN (_represented_object); return c; } diff --git a/Source/NSGraphicsContext.m b/Source/NSGraphicsContext.m index abb1238d6..501a5b904 100644 --- a/Source/NSGraphicsContext.m +++ b/Source/NSGraphicsContext.m @@ -376,7 +376,7 @@ NSGraphicsContext *GSCurrentContext(void) - (void) setFocusStack: (void *)stack { - ASSIGN(focus_stack, stack); + ASSIGN(focus_stack, (id)stack); } - (void) setImageInterpolation: (NSImageInterpolation)interpolation diff --git a/Source/NSRulerMarker.m b/Source/NSRulerMarker.m index 22b910379..b94248e95 100644 --- a/Source/NSRulerMarker.m +++ b/Source/NSRulerMarker.m @@ -186,7 +186,7 @@ - (void)setRepresentedObject:(id )anObject { - ASSIGN(_representedObject, anObject); + ASSIGN(_representedObject, (id)anObject); } - (id )representedObject diff --git a/Source/NSSpellChecker.m b/Source/NSSpellChecker.m index 307204bae..3f970e564 100644 --- a/Source/NSSpellChecker.m +++ b/Source/NSSpellChecker.m @@ -650,7 +650,7 @@ inSpellDocumentWithTag:(int)tag if (proxy != nil) { ASSIGN(_language, language); - ASSIGN(_serverProxy, proxy); + ASSIGN(_serverProxy, (id)proxy); } else { diff --git a/Source/NSTextBlock.m b/Source/NSTextBlock.m index f8ff42b51..fa234476c 100644 --- a/Source/NSTextBlock.m +++ b/Source/NSTextBlock.m @@ -338,11 +338,15 @@ { NSTextBlock *t = (NSTextBlock*)NSCopyObject(self, 0, zone); - TEST_RETAIN(_backgroundColor); - TEST_RETAIN(_borderColorForEdge[NSMinXEdge]); - TEST_RETAIN(_borderColorForEdge[NSMinYEdge]); - TEST_RETAIN(_borderColorForEdge[NSMaxXEdge]); - TEST_RETAIN(_borderColorForEdge[NSMaxYEdge]); + _backgroundColor = TEST_RETAIN(_backgroundColor); + _borderColorForEdge[NSMinXEdge] = + TEST_RETAIN(_borderColorForEdge[NSMinXEdge]); + _borderColorForEdge[NSMinYEdge] = + TEST_RETAIN(_borderColorForEdge[NSMinYEdge]); + _borderColorForEdge[NSMaxXEdge] = + TEST_RETAIN(_borderColorForEdge[NSMaxXEdge]); + _borderColorForEdge[NSMaxYEdge] = + TEST_RETAIN(_borderColorForEdge[NSMaxYEdge]); return t; } diff --git a/Source/NSTextList.m b/Source/NSTextList.m index 4825bf85f..7c31639e6 100644 --- a/Source/NSTextList.m +++ b/Source/NSTextList.m @@ -154,7 +154,7 @@ { NSTextList *l = (NSTextList*)NSCopyObject(self, 0, zone); - TEST_RETAIN(_markerFormat); + _markerFormat = TEST_RETAIN(_markerFormat); return l; } diff --git a/Source/NSTextTableBlock.m b/Source/NSTextTableBlock.m index 0e14def1a..694f8e8fc 100644 --- a/Source/NSTextTableBlock.m +++ b/Source/NSTextTableBlock.m @@ -87,7 +87,7 @@ { NSTextTableBlock *t = [super copyWithZone: zone]; - TEST_RETAIN(_table); + _table = TEST_RETAIN(_table); return t; } diff --git a/Source/NSView.m b/Source/NSView.m index a051de5c8..e55aa31f6 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -3787,8 +3787,7 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level) */ if (_rFlags.has_draginfo == 1 && _window != nil) { - o = GSGetDragTypes(self); - TEST_RETAIN(o); + o = TEST_RETAIN(GSGetDragTypes(self)); } else {