diff --git a/ChangeLog b/ChangeLog index bd16c68a..191eeb6e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2012-04-20 12:03-EDT Gregory John Casamento + + * GormCore/GormCustomView.m + * GormCore/GormFilesOwner.m + * GormCore/GormFunctions.m + * GormObjCHeaderParser/OCHeaderParser.m + * Palettes/2Controls/ControlsPalette.m + * Palettes/2Controls/GNUmakefile + * Palettes/2Controls/GormPopUpButtonEditor.m + * Palettes/3Containers/GormNSBrowser.m + * Palettes/4Data/GormImageViewAttributesInspector.m: Correct + compiler warnings found by clang. + 2012-04-20 10:34-EDT Gregory John Casamento * GormLib/IBObjectAdditions.m diff --git a/GormCore/GormCustomView.m b/GormCore/GormCustomView.m index 35db270a..e2fa9adc 100644 --- a/GormCore/GormCustomView.m +++ b/GormCore/GormCustomView.m @@ -45,7 +45,7 @@ if((self = [super initWithFrame: frame]) != nil) { // Replace the CustomView with an NSView of the same dimensions. - self = [[NSView alloc] initWithFrame: frame]; + self = (id)[[NSView alloc] initWithFrame: frame]; } return self; } diff --git a/GormCore/GormFilesOwner.m b/GormCore/GormFilesOwner.m index 6f9c31f9..52afe24a 100644 --- a/GormCore/GormFilesOwner.m +++ b/GormCore/GormFilesOwner.m @@ -25,8 +25,9 @@ #include #include "GormPrivate.h" +#include "GormCustomView.h" -@class GormCustomView; +// @class GormCustomView; @implementation GormFilesOwner - (NSString*) className diff --git a/GormCore/GormFunctions.m b/GormCore/GormFunctions.m index 548becb5..92bc5af9 100644 --- a/GormCore/GormFunctions.m +++ b/GormCore/GormFunctions.m @@ -321,7 +321,7 @@ NSString *identifierString(NSString *str) // check the result's length. if([result length] == 0) { - result = [NSString stringWithString: @"dummyIdentifier"]; + result = [@"dummyIdentifier" mutableCopy]; } return result; diff --git a/GormObjCHeaderParser/OCHeaderParser.m b/GormObjCHeaderParser/OCHeaderParser.m index 36cca8f4..2130c74f 100644 --- a/GormObjCHeaderParser/OCHeaderParser.m +++ b/GormObjCHeaderParser/OCHeaderParser.m @@ -95,7 +95,7 @@ - (void) _stripPreProcessor { NSScanner *scanner = [NSScanner scannerWithString: fileData]; - NSString *resultString = [NSString stringWithString: @""]; + NSString *resultString = @""; // [NSString stringWithString: @""]; // strip all of the one line comments out... [scanner setCharactersToBeSkipped: nil]; diff --git a/Palettes/2Controls/ControlsPalette.m b/Palettes/2Controls/ControlsPalette.m index 2a94761c..1dffc70a 100644 --- a/Palettes/2Controls/ControlsPalette.m +++ b/Palettes/2Controls/ControlsPalette.m @@ -30,8 +30,7 @@ #include #include #include - -@class GormNSPopUpButton; +#include "GormNSPopUpButton.h" @interface ControlsPalette: IBPalette @end diff --git a/Palettes/2Controls/GNUmakefile b/Palettes/2Controls/GNUmakefile index c7f21fcf..e9b57405 100644 --- a/Palettes/2Controls/GNUmakefile +++ b/Palettes/2Controls/GNUmakefile @@ -27,21 +27,23 @@ include $(GNUSTEP_MAKEFILES)/common.make PALETTE_NAME = 2Controls 2Controls_PALETTE_ICON = ControlsPalette -2Controls_OBJC_FILES = GormButtonAttributesInspector.m \ - GormBoxAttributesInspector.m \ - GormCellAttributesInspector.m \ - GormColorWellAttributesInspector.m \ - GormFormAttributesInspector.m \ - GormPopUpButtonAttributesInspector.m \ - GormSliderAttributesInspector.m \ - GormStepperAttributesInspector.m \ - GormProgressIndicatorAttributesInspector.m \ - GormTextFieldAttributesInspector.m \ - GormMatrixAttributesInspector.m \ - ControlsPalette.m \ - GormPopUpButtonEditor.m \ - GormButtonEditor.m \ - inspectors.m +2Controls_OBJC_FILES = \ + GormButtonAttributesInspector.m \ + GormBoxAttributesInspector.m \ + GormCellAttributesInspector.m \ + GormColorWellAttributesInspector.m \ + GormFormAttributesInspector.m \ + GormPopUpButtonAttributesInspector.m \ + GormSliderAttributesInspector.m \ + GormStepperAttributesInspector.m \ + GormProgressIndicatorAttributesInspector.m \ + GormTextFieldAttributesInspector.m \ + GormMatrixAttributesInspector.m \ + ControlsPalette.m \ + GormPopUpButtonEditor.m \ + GormNSPopUpButton.m \ + GormButtonEditor.m \ + inspectors.m 2Controls_PRINCIPAL_CLASS = ControlsPalette diff --git a/Palettes/2Controls/GormPopUpButtonEditor.m b/Palettes/2Controls/GormPopUpButtonEditor.m index 0fe8fac6..76650352 100644 --- a/Palettes/2Controls/GormPopUpButtonEditor.m +++ b/Palettes/2Controls/GormPopUpButtonEditor.m @@ -2,149 +2,10 @@ #include #include #include +#include "GormNSPopUpButton.h" #define _EO ((NSPopUpButton *)_editedObject) -@class GormNSPopUpButtonCell; - -Class _gormnspopupbuttonCellClass = 0; -@interface GormNSPopUpButton : NSPopUpButton -@end - -@implementation GormNSPopUpButton -/* - * Class methods - */ -+ (void) initialize -{ - if (self == [GormNSPopUpButton class]) - { - // Initial version - [self setVersion: 1]; - [self setCellClass: [GormNSPopUpButtonCell class]]; - } -} - -+ (Class) cellClass -{ - return _gormnspopupbuttonCellClass; -} - -+ (void) setCellClass: (Class)classId -{ - _gormnspopupbuttonCellClass = classId; -} - -- (NSString*) editorClassName -{ - return @"GormPopUpButtonEditor"; -} - -- (NSString *) className -{ - return @"NSPopUpButton"; -} -@end - -@interface GormNSPopUpButtonCell : NSPopUpButtonCell -{ -} -@end - -@interface NSPopUpButtonCell (DirtyHack) -- (id) _gormInitTextCell: (NSString *) string; -@end - -@implementation NSPopUpButtonCell (DirtyHack) -- (id) _gormInitTextCell: (NSString *) string -{ - return [super initTextCell: string]; -} -@end - -@implementation GormNSPopUpButtonCell - -/* Overriden helper method */ -- (void) _initMenu -{ - NSMenu *menu = [[NSMenu allocSubstitute] initWithTitle: @""]; - [self setMenu: menu]; - RELEASE(menu); -} - -- (NSString *) className -{ - return @"NSPopUpButtonCell"; -} - -/** - * Override this here, since themes may override it. - * Always want to show the menu view since it's editable. - */ -- (void) attachPopUpWithFrame: (NSRect)cellFrame - inView: (NSView *)controlView -{ - NSRectEdge preferredEdge = _pbcFlags.preferredEdge; - NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; - NSWindow *cvWin = [controlView window]; - NSMenuView *mr = [[self menu] menuRepresentation]; - int selectedItem; - - [nc postNotificationName: NSPopUpButtonCellWillPopUpNotification - object: self]; - - [nc postNotificationName: NSPopUpButtonWillPopUpNotification - object: controlView]; - - // Convert to Screen Coordinates - cellFrame = [controlView convertRect: cellFrame toView: nil]; - cellFrame.origin = [cvWin convertBaseToScreen: cellFrame.origin]; - - if (_pbcFlags.pullsDown) - selectedItem = -1; - else - { - selectedItem = [self indexOfSelectedItem]; - if (selectedItem = -1) - selectedItem = 0; - } - - if (selectedItem > 0) - { - [mr setHighlightedItemIndex: selectedItem]; - } - - if ([controlView isFlipped]) - { - if (preferredEdge == NSMinYEdge) - { - preferredEdge = NSMaxYEdge; - } - else if (preferredEdge == NSMaxYEdge) - { - preferredEdge = NSMinYEdge; - } - } - - // Ask the MenuView to attach the menu to this rect - [mr setWindowFrameForAttachingToRect: cellFrame - onScreen: [cvWin screen] - preferredEdge: preferredEdge - popUpSelectedItem: selectedItem]; - - // Set to be above the main window - [cvWin addChildWindow: [mr window] ordered: NSWindowAbove]; - - // Last, display the window - [[mr window] orderFrontRegardless]; - - [nc addObserver: self - selector: @selector(_handleNotification:) - name: NSMenuDidSendActionNotification - object: _menu]; -} -@end - @interface GormPopUpButtonEditor : GormControlEditor { } diff --git a/Palettes/3Containers/GormNSBrowser.m b/Palettes/3Containers/GormNSBrowser.m index 64c96a41..2b432517 100644 --- a/Palettes/3Containers/GormNSBrowser.m +++ b/Palettes/3Containers/GormNSBrowser.m @@ -59,7 +59,7 @@ atRow: (int)row column: (int)column { - NSDebugLog(@"<%@ %x>: browser %x will display %@ %x at %d,%d",[self class],self,sender,[cell class],cell,row,column); + // NSDebugLog(@"%@: browser %@ will display %@ %@ at %d,%d",self,sender,[cell class],cell,row,column); // This code should never be called because there is no row // in our browser. But just in case... [cell setLeaf:YES]; diff --git a/Palettes/4Data/GormImageViewAttributesInspector.m b/Palettes/4Data/GormImageViewAttributesInspector.m index 5795df54..74f7e298 100644 --- a/Palettes/4Data/GormImageViewAttributesInspector.m +++ b/Palettes/4Data/GormImageViewAttributesInspector.m @@ -38,6 +38,7 @@ #include #include #include +#include /* This macro makes sure that the string contains a value, even if @"" */ #define VSTR(str) ({id _str = (id)str; (_str) ? (id)_str : (id)(@"");})