mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 14:31:55 +00:00
A bunch of format string fixes and some casts to force formats
No objections from Fred Kiefer ;) git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38569 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e38458a7ba
commit
d1ea80ed71
11 changed files with 64 additions and 52 deletions
11
ChangeLog
11
ChangeLog
|
@ -8,6 +8,17 @@
|
||||||
return value for NSMenu itemAtIndex change from
|
return value for NSMenu itemAtIndex change from
|
||||||
id<NSMenuItem> to NSMenuitem* as it is done by Apple too
|
id<NSMenuItem> to NSMenuitem* as it is done by Apple too
|
||||||
fixes warnings in NSApplication.m and NSTextView.m
|
fixes warnings in NSApplication.m and NSTextView.m
|
||||||
|
* Source/NSAnimation.m
|
||||||
|
* Source/NSCachedImageRep.m
|
||||||
|
* Source/NSEvent.m
|
||||||
|
* Source/NSPrintPanel.m
|
||||||
|
* Source/NSTextBlock.m
|
||||||
|
* Source/NSToolbarItem.m
|
||||||
|
* Source/GSDisplayServer.m
|
||||||
|
* Source/GSXibLoader.m
|
||||||
|
* Source/NSSplitView.m
|
||||||
|
* Model/GMArchiver.m
|
||||||
|
Format string fixes and casts
|
||||||
|
|
||||||
2015-05-22 Fred Kiefer <FredKiefer@gmx.de>
|
2015-05-22 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
|
|
@ -475,7 +475,7 @@
|
||||||
- (void) encodeShort: (short)value withName: (NSString*)name
|
- (void) encodeShort: (short)value withName: (NSString*)name
|
||||||
{
|
{
|
||||||
if (!findingConditionals && name) {
|
if (!findingConditionals && name) {
|
||||||
id valueString = [NSString stringWithFormat: @"%s", value];
|
id valueString = [NSString stringWithFormat: @"%hd", value];
|
||||||
|
|
||||||
[lastObjectRepresentation setObject: valueString forKey: name];
|
[lastObjectRepresentation setObject: valueString forKey: name];
|
||||||
}
|
}
|
||||||
|
@ -511,7 +511,7 @@
|
||||||
- (void) encodeLong: (long)value withName: (NSString*)name
|
- (void) encodeLong: (long)value withName: (NSString*)name
|
||||||
{
|
{
|
||||||
if (!findingConditionals && name) {
|
if (!findingConditionals && name) {
|
||||||
id valueString = [NSString stringWithFormat: @"%l", value];
|
id valueString = [NSString stringWithFormat: @"%ld", value];
|
||||||
|
|
||||||
[lastObjectRepresentation setObject: valueString forKey: name];
|
[lastObjectRepresentation setObject: valueString forKey: name];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1112,7 +1112,7 @@ GSCurrentServer(void)
|
||||||
{
|
{
|
||||||
NSEvent *event = events[i];
|
NSEvent *event = events[i];
|
||||||
|
|
||||||
NSLog(@"index %d %@", i, event);
|
NSLog(@"index %lu %@", (unsigned long) i, event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -410,7 +410,7 @@
|
||||||
__PRETTY_FUNCTION__,
|
__PRETTY_FUNCTION__,
|
||||||
NSStringFromClass([self class])];
|
NSStringFromClass([self class])];
|
||||||
[NSException raise: NSInvalidArgumentException
|
[NSException raise: NSInvalidArgumentException
|
||||||
format: format];
|
format: @"%@", format];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load the connection ID....
|
// Load the connection ID....
|
||||||
|
@ -433,7 +433,7 @@
|
||||||
NSString *format = [NSString stringWithFormat:@"%s:class: %@ - connection ID is missing or zero!",
|
NSString *format = [NSString stringWithFormat:@"%s:class: %@ - connection ID is missing or zero!",
|
||||||
__PRETTY_FUNCTION__, NSStringFromClass([self class])];
|
__PRETTY_FUNCTION__, NSStringFromClass([self class])];
|
||||||
[NSException raise: NSInvalidArgumentException
|
[NSException raise: NSInvalidArgumentException
|
||||||
format: format];
|
format: @"%@", format];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -442,7 +442,7 @@
|
||||||
__PRETTY_FUNCTION__,
|
__PRETTY_FUNCTION__,
|
||||||
NSStringFromClass([self class])];
|
NSStringFromClass([self class])];
|
||||||
[NSException raise: NSInvalidArgumentException
|
[NSException raise: NSInvalidArgumentException
|
||||||
format: format];
|
format: @"%@", format];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -582,7 +582,7 @@
|
||||||
__PRETTY_FUNCTION__,
|
__PRETTY_FUNCTION__,
|
||||||
NSStringFromClass([self class])];
|
NSStringFromClass([self class])];
|
||||||
[NSException raise: NSInvalidArgumentException
|
[NSException raise: NSInvalidArgumentException
|
||||||
format: format];
|
format: @"%@", format];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([coder containsValueForKey: @"object"])
|
if ([coder containsValueForKey: @"object"])
|
||||||
|
@ -632,7 +632,7 @@
|
||||||
|
|
||||||
- (NSString *) description
|
- (NSString *) description
|
||||||
{
|
{
|
||||||
return [NSString stringWithFormat: @"<%@, %@, %@, %d>",
|
return [NSString stringWithFormat: @"<%@, %@, %@, %p>",
|
||||||
[self className],
|
[self className],
|
||||||
object,
|
object,
|
||||||
parent,
|
parent,
|
||||||
|
|
|
@ -797,7 +797,7 @@ nsanimation_progressMarkSorter(NSAnimationProgress first, NSAnimationProgress se
|
||||||
[delegate methodForSelector: @selector (animationShouldStart:)]
|
[delegate methodForSelector: @selector (animationShouldStart:)]
|
||||||
: NULL;
|
: NULL;
|
||||||
NSDebugMLLog(@"NSAnimationDelegate",
|
NSDebugMLLog(@"NSAnimationDelegate",
|
||||||
@"Delegation methods : %x %x %x %x %x",
|
@"Delegation methods : %p %p %p %p %p",
|
||||||
_delegate_animationDidReachProgressMark,
|
_delegate_animationDidReachProgressMark,
|
||||||
_delegate_animationValueForProgress,
|
_delegate_animationValueForProgress,
|
||||||
_delegate_animationDidEnd,
|
_delegate_animationDidEnd,
|
||||||
|
|
|
@ -93,8 +93,8 @@
|
||||||
pixelsWide <= 0 || pixelsHigh <= 0)
|
pixelsWide <= 0 || pixelsHigh <= 0)
|
||||||
{
|
{
|
||||||
[NSException raise: NSInvalidArgumentException
|
[NSException raise: NSInvalidArgumentException
|
||||||
format: @"NSCachedImageRep created with size %@ pixelsWide %d pixelsHigh %d",
|
format: @"NSCachedImageRep created with size %@ pixelsWide %li pixelsHigh %li",
|
||||||
NSStringFromSize(aSize), pixelsWide, pixelsHigh];
|
NSStringFromSize(aSize), (long int) pixelsWide, (long int) pixelsHigh];
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: Only create new window when separate is YES
|
// FIXME: Only create new window when separate is YES
|
||||||
|
|
|
@ -289,7 +289,7 @@ static Class eventClass;
|
||||||
if ([dict objectForKey: timerKey])
|
if ([dict objectForKey: timerKey])
|
||||||
[NSException raise: NSInternalInconsistencyException
|
[NSException raise: NSInternalInconsistencyException
|
||||||
format: @"Periodic events are already being generated for "
|
format: @"Periodic events are already being generated for "
|
||||||
@"this thread %x", GSCurrentThread()];
|
@"this thread %p", GSCurrentThread()];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Register a timer that will fire in delaySeconds.
|
* Register a timer that will fire in delaySeconds.
|
||||||
|
@ -609,25 +609,26 @@ static const char *eventTypes[] = {
|
||||||
case NSRightMouseDown:
|
case NSRightMouseDown:
|
||||||
case NSRightMouseUp:
|
case NSRightMouseUp:
|
||||||
return [NSString stringWithFormat:
|
return [NSString stringWithFormat:
|
||||||
@"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %u,"
|
@"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %lu,"
|
||||||
@" time = %f, window = %d, dpsContext = %p,"
|
@" time = %f, window = %ld, dpsContext = %p,"
|
||||||
@" event number = %d, click = %d, pressure = %f",
|
@" event number = %ld, click = %ld, pressure = %f",
|
||||||
eventTypes[event_type], location_point.x, location_point.y,
|
eventTypes[event_type], location_point.x, location_point.y,
|
||||||
modifier_flags, event_time, window_num, event_context,
|
(unsigned long) modifier_flags, event_time, (long) window_num,
|
||||||
event_data.mouse.event_num, event_data.mouse.click,
|
event_context, (long int) event_data.mouse.event_num,
|
||||||
|
(long int) event_data.mouse.click,
|
||||||
event_data.mouse.pressure];
|
event_data.mouse.pressure];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NSMouseEntered:
|
case NSMouseEntered:
|
||||||
case NSMouseExited:
|
case NSMouseExited:
|
||||||
return [NSString stringWithFormat:
|
return [NSString stringWithFormat:
|
||||||
@"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %u,"
|
@"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %lu,"
|
||||||
@" time = %f, window = %d, dpsContext = %p, "
|
@" time = %f, window = %ld, dpsContext = %p, "
|
||||||
@" event number = %d, tracking number = %d, user data = %p",
|
@" event number = %ld, tracking number = %ld, user data = %p",
|
||||||
eventTypes[event_type], location_point.x, location_point.y,
|
eventTypes[event_type], location_point.x, location_point.y,
|
||||||
modifier_flags, event_time, window_num, event_context,
|
(unsigned long) modifier_flags, event_time, (long) window_num, event_context,
|
||||||
event_data.tracking.event_num,
|
(long) event_data.tracking.event_num,
|
||||||
event_data.tracking.tracking_num,
|
(long) event_data.tracking.tracking_num,
|
||||||
event_data.tracking.user_data];
|
event_data.tracking.user_data];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -635,11 +636,11 @@ static const char *eventTypes[] = {
|
||||||
case NSKeyUp:
|
case NSKeyUp:
|
||||||
case NSFlagsChanged:
|
case NSFlagsChanged:
|
||||||
return [NSString stringWithFormat:
|
return [NSString stringWithFormat:
|
||||||
@"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %u,"
|
@"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %lu,"
|
||||||
@" time = %f, window = %d, dpsContext = %p, "
|
@" time = %f, window = %ld, dpsContext = %p, "
|
||||||
@" repeat = %s, keys = %@, ukeys = %@, keyCode = 0x%x",
|
@" repeat = %s, keys = %@, ukeys = %@, keyCode = 0x%x",
|
||||||
eventTypes[event_type], location_point.x, location_point.y,
|
eventTypes[event_type], location_point.x, location_point.y,
|
||||||
modifier_flags, event_time, window_num, event_context,
|
(unsigned long) modifier_flags, event_time, (long) window_num, event_context,
|
||||||
(event_data.key.repeat ? "YES" : "NO"),
|
(event_data.key.repeat ? "YES" : "NO"),
|
||||||
event_data.key.char_keys, event_data.key.unmodified_keys,
|
event_data.key.char_keys, event_data.key.unmodified_keys,
|
||||||
event_data.key.key_code];
|
event_data.key.key_code];
|
||||||
|
@ -651,13 +652,13 @@ static const char *eventTypes[] = {
|
||||||
case NSSystemDefined:
|
case NSSystemDefined:
|
||||||
case NSApplicationDefined:
|
case NSApplicationDefined:
|
||||||
return [NSString stringWithFormat:
|
return [NSString stringWithFormat:
|
||||||
@"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %u,"
|
@"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %lu,"
|
||||||
@" time = %f, window = %d, dpsContext = %p, "
|
@" time = %f, window = %ld, dpsContext = %p, "
|
||||||
@" subtype = %d, data1 = %p, data2 = %p",
|
@" subtype = %d, data1 = %lx, data2 = %lx",
|
||||||
eventTypes[event_type], location_point.x, location_point.y,
|
eventTypes[event_type], location_point.x, location_point.y,
|
||||||
modifier_flags, event_time, window_num, event_context,
|
(unsigned long) modifier_flags, event_time, (long) window_num, event_context,
|
||||||
event_data.misc.sub_type, event_data.misc.data1,
|
event_data.misc.sub_type, (long) event_data.misc.data1,
|
||||||
event_data.misc.data2];
|
(long) event_data.misc.data2];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NSScrollWheel:
|
case NSScrollWheel:
|
||||||
|
@ -666,14 +667,14 @@ static const char *eventTypes[] = {
|
||||||
case NSOtherMouseDragged:
|
case NSOtherMouseDragged:
|
||||||
case NSRightMouseDragged:
|
case NSRightMouseDragged:
|
||||||
return [NSString stringWithFormat:
|
return [NSString stringWithFormat:
|
||||||
@"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %u,"
|
@"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %lu,"
|
||||||
@" time = %f, window = %d, dpsContext = %p,"
|
@" time = %f, window = %ld, dpsContext = %p,"
|
||||||
@" event number = %d, click = %d, pressure = %f"
|
@" event number = %ld, click = %ld, pressure = %f"
|
||||||
@" button = %d, deltaX = %f, deltaY = %f, deltaZ = %f",
|
@" button = %ld, deltaX = %f, deltaY = %f, deltaZ = %f",
|
||||||
eventTypes[event_type], location_point.x, location_point.y,
|
eventTypes[event_type], location_point.x, location_point.y,
|
||||||
modifier_flags, event_time, window_num, event_context,
|
(unsigned long) modifier_flags, event_time, (long) window_num, event_context,
|
||||||
event_data.mouse.event_num, event_data.mouse.click,
|
(long ) event_data.mouse.event_num, (long) event_data.mouse.click,
|
||||||
event_data.mouse.pressure, event_data.mouse.button,
|
event_data.mouse.pressure, (long) event_data.mouse.button,
|
||||||
event_data.mouse.deltaX,
|
event_data.mouse.deltaX,
|
||||||
event_data.mouse.deltaY,
|
event_data.mouse.deltaY,
|
||||||
event_data.mouse.deltaZ];
|
event_data.mouse.deltaZ];
|
||||||
|
@ -686,10 +687,10 @@ static const char *eventTypes[] = {
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return [NSString stringWithFormat:
|
return [NSString stringWithFormat:
|
||||||
@"NSEvent: eventType = UNKNOWN!, point = { %f, %f }, modifiers = %u,"
|
@"NSEvent: eventType = UNKNOWN!, point = { %f, %f }, modifiers = %lu,"
|
||||||
@" time = %f, window = %d",
|
@" time = %f, window = %ld",
|
||||||
location_point.x, location_point.y,
|
location_point.x, location_point.y,
|
||||||
modifier_flags, event_time, window_num];
|
(unsigned long) modifier_flags, event_time, (long) window_num];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -462,9 +462,9 @@ static NSPrintPanel *shared_instance = nil;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSString *str;
|
NSString *str;
|
||||||
str = [NSString stringWithFormat: @"%d", _pages.location];
|
str = [NSString stringWithFormat: @"%lu", (unsigned long) _pages.location];
|
||||||
[[fromRangeForm cellAtIndex: 0] setStringValue: str];
|
[[fromRangeForm cellAtIndex: 0] setStringValue: str];
|
||||||
str = [NSString stringWithFormat: @"%d", NSMaxRange(_pages)-1];
|
str = [NSString stringWithFormat: @"%lu", (unsigned long) NSMaxRange(_pages)-1];
|
||||||
[[toRangeForm cellAtIndex: 0] setStringValue: str];
|
[[toRangeForm cellAtIndex: 0] setStringValue: str];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,7 +150,7 @@ static NSNotificationCenter *nc = nil;
|
||||||
{
|
{
|
||||||
proportion = (NSWidth(frames[i]))/oldTotal;
|
proportion = (NSWidth(frames[i]))/oldTotal;
|
||||||
}
|
}
|
||||||
key = [NSString stringWithFormat: @"%u", i];
|
key = [NSString stringWithFormat: @"%lu", (unsigned long) i];
|
||||||
[config setObject: [NSNumber numberWithDouble: proportion]
|
[config setObject: [NSNumber numberWithDouble: proportion]
|
||||||
forKey: key];
|
forKey: key];
|
||||||
}
|
}
|
||||||
|
@ -829,7 +829,7 @@ static NSNotificationCenter *nc = nil;
|
||||||
NSNumber *proportion;
|
NSNumber *proportion;
|
||||||
NSString *key;
|
NSString *key;
|
||||||
|
|
||||||
key = [NSString stringWithFormat: @"%u", i];
|
key = [NSString stringWithFormat: @"%lu", (unsigned long) i];
|
||||||
proportion = [config objectForKey: key];
|
proportion = [config objectForKey: key];
|
||||||
if (proportion == nil)
|
if (proportion == nil)
|
||||||
{
|
{
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
{
|
{
|
||||||
if (edge >= sizeof(_borderColorForEdge) / sizeof(_borderColorForEdge[0]))
|
if (edge >= sizeof(_borderColorForEdge) / sizeof(_borderColorForEdge[0]))
|
||||||
[NSException raise: NSInvalidArgumentException
|
[NSException raise: NSInvalidArgumentException
|
||||||
format: @"invalid edge %d", edge];
|
format: @"invalid edge %lu", (unsigned long) edge];
|
||||||
ASSIGN(_borderColorForEdge[edge], color);
|
ASSIGN(_borderColorForEdge[edge], color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@
|
||||||
format: @"invalid layer %d", layer];
|
format: @"invalid layer %d", layer];
|
||||||
if (edge >= sizeof(_width[0]) / sizeof(_width[0][0]))
|
if (edge >= sizeof(_width[0]) / sizeof(_width[0][0]))
|
||||||
[NSException raise: NSInvalidArgumentException
|
[NSException raise: NSInvalidArgumentException
|
||||||
format: @"invalid edge %d", edge];
|
format: @"invalid edge %lu", (unsigned long) edge];
|
||||||
return _width[layer][edge];
|
return _width[layer][edge];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@
|
||||||
format: @"invalid layer %d", layer];
|
format: @"invalid layer %d", layer];
|
||||||
if (edge >= sizeof(_width[0]) / sizeof(_width[0][0]))
|
if (edge >= sizeof(_width[0]) / sizeof(_width[0][0]))
|
||||||
[NSException raise: NSInvalidArgumentException
|
[NSException raise: NSInvalidArgumentException
|
||||||
format: @"invalid edge %d", edge];
|
format: @"invalid edge %lu", (unsigned long) edge];
|
||||||
return _widthType[layer][edge];
|
return _widthType[layer][edge];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@
|
||||||
format: @"invalid layer %d", layer];
|
format: @"invalid layer %d", layer];
|
||||||
if (edge >= sizeof(_width[0]) / sizeof(_width[0][0]))
|
if (edge >= sizeof(_width[0]) / sizeof(_width[0][0]))
|
||||||
[NSException raise: NSInvalidArgumentException
|
[NSException raise: NSInvalidArgumentException
|
||||||
format: @"invalid edge %d", edge];
|
format: @"invalid edge %lu", (unsigned long) edge];
|
||||||
_width[layer][edge] = val;
|
_width[layer][edge] = val;
|
||||||
_widthType[layer][edge] = type;
|
_widthType[layer][edge] = type;
|
||||||
}
|
}
|
||||||
|
|
|
@ -287,7 +287,7 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
|
||||||
index = [toolbar _indexOfItem: _toolbarItem];
|
index = [toolbar _indexOfItem: _toolbarItem];
|
||||||
}
|
}
|
||||||
[GSToolbarView setDraggedItemIndex:index];
|
[GSToolbarView setDraggedItemIndex:index];
|
||||||
[pboard setString: [NSString stringWithFormat:@"%d", index]
|
[pboard setString: [NSString stringWithFormat:@"%ld", (long) index]
|
||||||
forType: GSMovableToolbarItemPboardType];
|
forType: GSMovableToolbarItemPboardType];
|
||||||
|
|
||||||
[self dragImage: image
|
[self dragImage: image
|
||||||
|
@ -777,7 +777,7 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
|
||||||
index = [toolbar _indexOfItem: _toolbarItem];
|
index = [toolbar _indexOfItem: _toolbarItem];
|
||||||
}
|
}
|
||||||
[GSToolbarView setDraggedItemIndex:index];
|
[GSToolbarView setDraggedItemIndex:index];
|
||||||
[pboard setString: [NSString stringWithFormat:@"%d", index]
|
[pboard setString: [NSString stringWithFormat:@"%ld", (long) index]
|
||||||
forType: GSMovableToolbarItemPboardType];
|
forType: GSMovableToolbarItemPboardType];
|
||||||
|
|
||||||
[self dragImage: image
|
[self dragImage: image
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue