mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 13:10:59 +00:00
Fix clang compiler warnings as reported by Sebastian Reitenbach
<sebastia@l00-bugdead-prods.de>. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34608 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d55752b22c
commit
d570812401
15 changed files with 87 additions and 41 deletions
21
ChangeLog
21
ChangeLog
|
@ -1,4 +1,23 @@
|
|||
2012-01-21 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
2012-01-23 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSToolbarFrameworkPrivate.h,
|
||||
* Headers/AppKit/NSMatrix.h: Remove duplicated method declarations.
|
||||
* TextConverters/RTF/RTFProducer.h: Change docDict to NSDictionary.
|
||||
* Source/GSTheme.m,
|
||||
* Source/GSWindowDecorationView.m: Add missing type cast.
|
||||
* Headers/AppKit/NSCell.h,
|
||||
* Source/NSCell.m,
|
||||
* Source/NSButtonCell.m: Change _contents to id.
|
||||
* Source/GSNibLoading.m: Add missing import.
|
||||
* Source/NSPasteboard.m: Declare release as oneway.
|
||||
* Source/GSNibLoader.m: Change class to NSKeyedUnarchiver.
|
||||
* Source/GSXibLoader.m: Use correct printf type specifier.
|
||||
* Headers/AppKit/NSBitmapImageRep.h,
|
||||
* Source/NSBitmapImageRep.m: Change _imageData to NSData.
|
||||
Fix clang compiler warnings as reported by Sebastian Reitenbach
|
||||
<sebastia@l00-bugdead-prods.de>.
|
||||
|
||||
2012-01-21 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* Source/NSView.m (-setBounds:, -setBoundsOrigin:, -setBoundsSize:):
|
||||
Revert a portion of r32955 which I committed last april but I now
|
||||
|
|
|
@ -133,7 +133,7 @@ APPKIT_EXPORT NSString *NSImageEXIFData; // No GNUstep support yet; for reading
|
|||
NSMutableDictionary *_properties;
|
||||
BOOL _isPlanar;
|
||||
unsigned char **_imagePlanes;
|
||||
NSMutableData *_imageData;
|
||||
NSData *_imageData;
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
|
||||
NSBitmapFormat _format;
|
||||
#else
|
||||
|
|
|
@ -144,7 +144,7 @@ typedef enum {
|
|||
@interface NSCell : NSObject <NSCopying, NSCoding>
|
||||
{
|
||||
// Attributes
|
||||
NSString *_contents;
|
||||
id _contents;
|
||||
NSImage *_cell_image;
|
||||
NSFont *_font;
|
||||
id _object_value;
|
||||
|
|
|
@ -290,7 +290,6 @@ typedef enum _NSMatrixMode {
|
|||
to: (id)anObject
|
||||
forAllCells: (BOOL)flag;
|
||||
- (void) sendDoubleAction;
|
||||
- (void) setErrorAction: (SEL)aSelector;
|
||||
|
||||
/*
|
||||
* Handling Event and Action Messages
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
{
|
||||
if (data != nil)
|
||||
{
|
||||
NSUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc]
|
||||
NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc]
|
||||
initForReadingWithData: data];
|
||||
if (unarchiver != nil)
|
||||
{
|
||||
|
|
|
@ -66,6 +66,7 @@
|
|||
#import "AppKit/NSNib.h"
|
||||
#import "AppKit/NSScreen.h"
|
||||
#import "AppKit/NSSound.h"
|
||||
#import "AppKit/NSToolbar.h"
|
||||
#import "GNUstepGUI/GSInstantiator.h"
|
||||
#import "GSGuiPrivate.h"
|
||||
|
||||
|
|
|
@ -670,7 +670,7 @@ typedef struct {
|
|||
}
|
||||
if (_extraColors[elementState] == nil)
|
||||
{
|
||||
_extraColors[elementState] = [null retain];
|
||||
_extraColors[elementState] = (id)[null retain];
|
||||
}
|
||||
}
|
||||
if (_extraColors[elementState] != (id)null)
|
||||
|
|
|
@ -558,7 +558,7 @@ static inline NSRect RectWithSizeScaledByFactor(NSRect aRect, CGFloat factor)
|
|||
[RETAIN(v) removeFromSuperviewWithoutNeedingDisplay];
|
||||
|
||||
[self changeWindowHeight: -(menubarHeight)];
|
||||
return AUTORELEASE(v);
|
||||
return (NSMenuView *)AUTORELEASE(v);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -714,7 +714,7 @@
|
|||
}
|
||||
|
||||
properties = [self propertiesForObjectID: [obj objectID]];
|
||||
NSDebugLLog(@"XIB", @"object %d props %@", [obj objectID], properties);
|
||||
NSDebugLLog(@"XIB", @"object %ld props %@", (long)[obj objectID], properties);
|
||||
|
||||
//value = [properties objectForKey: @"windowTemplate.maxSize"];
|
||||
//value = [properties objectForKey: @"CustomClassName"];
|
||||
|
|
|
@ -519,26 +519,27 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
unsigned char* bits;
|
||||
long length;
|
||||
unsigned char *bits;
|
||||
NSUInteger length;
|
||||
unsigned int i;
|
||||
|
||||
// No image data was given, allocate it.
|
||||
length = (long)((_isPlanar) ? _numColors : 1) * _bytesPerRow *
|
||||
length = (NSUInteger)((_isPlanar) ? _numColors : 1) * _bytesPerRow *
|
||||
_pixelsHigh * sizeof(unsigned char);
|
||||
// Create a mutable data object although we never use it as such
|
||||
_imageData = [[NSMutableData alloc] initWithLength: length];
|
||||
bits = [_imageData mutableBytes];
|
||||
bits = (unsigned char *)[_imageData bytes];
|
||||
_imagePlanes[0] = bits;
|
||||
if (_isPlanar)
|
||||
{
|
||||
for (i=1; i < _numColors; i++)
|
||||
_imagePlanes[i] = bits + i*_bytesPerRow * _pixelsHigh;
|
||||
for (i= _numColors; i < MAX_PLANES; i++)
|
||||
for (i = 1; i < _numColors; i++)
|
||||
_imagePlanes[i] = bits + i * _bytesPerRow * _pixelsHigh;
|
||||
for (i = _numColors; i < MAX_PLANES; i++)
|
||||
_imagePlanes[i] = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i= 1; i < MAX_PLANES; i++)
|
||||
for (i = 1; i < MAX_PLANES; i++)
|
||||
_imagePlanes[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -1766,21 +1767,21 @@ _set_bit_value(unsigned char *base, long msb_off, int bit_width,
|
|||
}
|
||||
else
|
||||
{
|
||||
unsigned char* bits;
|
||||
unsigned char *bits;
|
||||
unsigned int i;
|
||||
|
||||
bits = [copy->_imageData mutableBytes];
|
||||
bits = (unsigned char *)[copy->_imageData bytes];
|
||||
copy->_imagePlanes[0] = bits;
|
||||
if (_isPlanar)
|
||||
{
|
||||
for (i=1; i < _numColors; i++)
|
||||
copy->_imagePlanes[i] = bits + i*_bytesPerRow * _pixelsHigh;
|
||||
for (i= _numColors; i < MAX_PLANES; i++)
|
||||
for (i = 1; i < _numColors; i++)
|
||||
copy->_imagePlanes[i] = bits + i * _bytesPerRow * _pixelsHigh;
|
||||
for (i = _numColors; i < MAX_PLANES; i++)
|
||||
copy->_imagePlanes[i] = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i= 1; i < MAX_PLANES; i++)
|
||||
for (i = 1; i < MAX_PLANES; i++)
|
||||
copy->_imagePlanes[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -215,7 +215,7 @@ typedef struct _GSButtonCellFlags
|
|||
if (_cell.contents_is_attributed_string == NO)
|
||||
{
|
||||
// If we have a formatter this is also the string of the _object_value
|
||||
return _contents;
|
||||
return (NSString *)_contents;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -324,7 +324,7 @@ static NSColor *dtxtCol;
|
|||
if (_cell.contents_is_attributed_string == NO)
|
||||
{
|
||||
// If we have a formatter this is also the string of the _object_value
|
||||
return _contents;
|
||||
return (NSString *)_contents;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2991,26 +2991,55 @@ static NSColor *dtxtCol;
|
|||
contents = [_formatter editingStringForObjectValue: _object_value];
|
||||
if (contents == nil)
|
||||
{
|
||||
contents = _contents;
|
||||
// We cannot call the stringValue method as this will call
|
||||
// validateEditing in NSActionCell subclasses
|
||||
if (nil == _contents)
|
||||
{
|
||||
contents = @"";
|
||||
}
|
||||
|
||||
if (_cell.contents_is_attributed_string == NO)
|
||||
{
|
||||
contents = (NSString *)_contents;
|
||||
}
|
||||
else
|
||||
{
|
||||
contents = [(NSAttributedString *)_contents string];
|
||||
}
|
||||
}
|
||||
if (![contents isEqualToString: [textObject string]])
|
||||
[textObject setText: contents];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSString *contents;
|
||||
|
||||
if (nil == _contents)
|
||||
{
|
||||
contents = @"";
|
||||
}
|
||||
|
||||
if (_cell.contents_is_attributed_string == NO)
|
||||
{
|
||||
if (![_contents isEqualToString:[textObject string]])
|
||||
[textObject setText: _contents];
|
||||
contents = (NSString *)_contents;
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME what about attribute changes?
|
||||
NSRange range = NSMakeRange(0, [[textObject string] length]);
|
||||
if (![[(NSAttributedString *)_contents string] isEqualToString:
|
||||
[textObject string]])
|
||||
[textObject replaceCharactersInRange: range
|
||||
withAttributedString: (NSAttributedString *)_contents];
|
||||
contents = [(NSAttributedString *)_contents string];
|
||||
}
|
||||
if (![contents isEqualToString: [textObject string]])
|
||||
{
|
||||
if (_cell.contents_is_attributed_string == NO)
|
||||
{
|
||||
[textObject setText: contents];
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME what about attribute changes?
|
||||
NSRange range = NSMakeRange(0, [[textObject string] length]);
|
||||
[textObject replaceCharactersInRange: range
|
||||
withAttributedString: (NSAttributedString *)_contents];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -638,7 +638,7 @@ static NSString *namePrefix = @"NSTypedFilenamesPboardType:";
|
|||
|
||||
- (id) initWithCoder: (NSCoder*)aCoder
|
||||
{
|
||||
NSPasteboard *p;
|
||||
NSPasteboard *p = nil;
|
||||
id val = [aCoder decodeObject];
|
||||
|
||||
if ([val isKindOfClass: [NSData class]] == YES)
|
||||
|
@ -656,8 +656,8 @@ static NSString *namePrefix = @"NSTypedFilenamesPboardType:";
|
|||
p = [NSPasteboard pasteboardByFilteringTypesInPasteboard: val];
|
||||
}
|
||||
|
||||
ASSIGN(self, p);
|
||||
return self;
|
||||
RELEASE(self);
|
||||
return RETAIN(p);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1499,7 +1499,7 @@ static NSMapTable *mimeMap = NULL;
|
|||
* is the pasteboards dictionary, remove us from that dictionary
|
||||
* as well.
|
||||
*/
|
||||
- (void) release
|
||||
- (oneway void) release
|
||||
{
|
||||
if ([self retainCount] == 2)
|
||||
{
|
||||
|
|
|
@ -90,9 +90,6 @@
|
|||
atIndex: (int)index
|
||||
broadcast: (BOOL)broadcast;
|
||||
- (void) _insertPassivelyItem: (NSToolbarItem *)item atIndex: (int)newIndex;
|
||||
- (void) _moveItemFromIndex: (int)index
|
||||
toIndex: (int)newIndex
|
||||
broadcast: (BOOL)broacast;
|
||||
- (void) _performRemoveItem: (NSToolbarItem *)item; // Used by drag setup
|
||||
- (NSToolbar *) _toolbarModel;
|
||||
- (void) _validate: (NSWindow *)observedWindow;
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
NSAttributedString *text;
|
||||
NSMutableDictionary *fontDict;
|
||||
NSMutableDictionary *colorDict;
|
||||
NSMutableDictionary *docDict;
|
||||
NSDictionary *docDict;
|
||||
NSMutableArray *attachments;
|
||||
|
||||
NSColor *fgColor;
|
||||
|
|
Loading…
Reference in a new issue