tags 749553 + patch
thanks
Here's a patch, tested on i386 and amd64.
Description: Fix FTBFS with gnustep-base/1.24.6 / gnustep-gui/0.24.
Fixes the following compiler errors and important warnings that are
very likely to lead to serious runtime issues:
.
error: pointer value used where a floating point value was expected
error: invalid operands to binary / (have 'id' and 'double')
warning: cast to pointer from integer of different size
warning: passing argument N of 'foo' from incompatible pointer type
warning: large integer implicitly truncated to unsigned type
warning: conflicting types for '-(BOOL)selectItemWithTag:(int)tag'
Author: Yavor Doganov <[email protected]>
Bug-Debian: http://bugs.debian.org/749553
Forwarded: no
Last-Update: 2014-05-28
---
--- cenon.app-3.93.orig/dvUndo.m
+++ cenon.app-3.93/dvUndo.m
@@ -149,7 +149,7 @@
*/
- (void)takeFillFrom:sender
{ id change;
- int filled = [sender indexOfSelectedItem];
+ NSInteger filled = [sender indexOfSelectedItem];
change = [[FillGraphicsChange alloc] initGraphicView:self fill:filled];
[change startChange];
--- cenon.app-3.93.orig/TileScrollView.m
+++ cenon.app-3.93/TileScrollView.m
@@ -91,14 +91,14 @@
NSRect bRect;
for (row=0; row<[resPopupListButton numberOfItems]; row++)
- if (Diff((float)[[resPopupListButton itemAtIndex:row] tag] / 100.0,
oldScaleFactor) < 0.001)
+ if (Diff((float)[(TileScrollView*)[resPopupListButton itemAtIndex:row]
tag] / 100.0, oldScaleFactor) < 0.001)
break;
row++;
if (row >= [resPopupListButton numberOfItems])
return;
[resPopupListButton setTitle:[resPopupListButton itemTitleAtIndex:row]];
- scaleFactor = [[resPopupListButton itemAtIndex:row] tag] / 100.0;
+ scaleFactor = [(TileScrollView*)[resPopupListButton itemAtIndex:row] tag]
/ 100.0;
bRect = [[self documentView] visibleRect];
center.x = bRect.origin.x+bRect.size.width/2.0;
@@ -117,13 +117,13 @@
NSRect bRect;
for (row=0; row<[resPopupListButton numberOfItems]; row++)
- if (Diff((float)[[resPopupListButton itemAtIndex:row] tag] / 100.0,
oldScaleFactor) < 0.001)
+ if (Diff((float)[(TileScrollView*)[resPopupListButton itemAtIndex:row]
tag] / 100.0, oldScaleFactor) < 0.001)
break;
row--;
if (row < 0)
return;
- scaleFactor = (float)[[resPopupListButton itemAtIndex:row] tag] / 100.0;
+ scaleFactor = (float)[(TileScrollView*)[resPopupListButton
itemAtIndex:row] tag] / 100.0;
#if !defined(GNUSTEP_BASE_VERSION) && !defined(__APPLE__) // OpenStep 4.2
bRect = [[self documentView] bounds];
@@ -169,7 +169,7 @@
/* get row of popup relating to current scale */
for (row=0; row<[resPopupListButton numberOfItems]; row++)
- if (Diff((float)[[resPopupListButton itemAtIndex:row] tag] / 100.0,
oldScaleFactor) < 0.001)
+ if (Diff((float)[(TileScrollView*)[resPopupListButton itemAtIndex:row]
tag] / 100.0, oldScaleFactor) < 0.001)
break;
row++;
if (row >= [resPopupListButton numberOfItems])
@@ -178,13 +178,13 @@
/* climb up the popup entries and get the new row */
for ( ; scale > 0.0 && row<[resPopupListButton numberOfItems]-1; row++ )
{
- scaleFactor = [[resPopupListButton itemAtIndex:row] tag] / 100.0;
+ scaleFactor = [(TileScrollView*)[resPopupListButton itemAtIndex:row]
tag] / 100.0;
if (scaleFactor / oldScaleFactor >= scale)
break;
}
[resPopupListButton setTitle:[resPopupListButton itemTitleAtIndex:row]];
- scaleFactor = [[resPopupListButton itemAtIndex:row] tag] / 100.0;
+ scaleFactor = [(TileScrollView*)[resPopupListButton itemAtIndex:row] tag]
/ 100.0;
[document scale:scaleFactor / oldScaleFactor :scaleFactor / oldScaleFactor
withCenter:center];
oldScaleFactor = scaleFactor;
--- cenon.app-3.93.orig/DocView.m
+++ cenon.app-3.93/DocView.m
@@ -4036,7 +4036,7 @@
[change noteGroup:group layer:layer];
for (i=0, iCnt = [llist count]; i<iCnt; i++)
{ id obj = [llist objectAtIndex:i];
- unsigned int index = NSNotFound;
+ NSUInteger index = NSNotFound;
if ((index=[slist indexOfObject:obj]) != NSNotFound)
[group addObject:obj];
--- cenon.app-3.93.orig/VHFShared/VHFPopUpButtonAdditions.m
+++ cenon.app-3.93/VHFShared/VHFPopUpButtonAdditions.m
@@ -51,7 +51,7 @@
/* created: 1997-10-24
* modified: 2006-02-06 (BOOL to be compatible, Apple followed with this
method in 10.4)
*/
-- (BOOL)selectItemWithTag:(int)tag
+- (BOOL)selectItemWithTag:(NSInteger)tag
{ int row;
for ( row=0; row<[self numberOfItems]; row++ )
--- cenon.app-3.93.orig/VHFImport/HPGLImport.m
+++ cenon.app-3.93/VHFImport/HPGLImport.m
@@ -456,14 +456,20 @@
*/
- (BOOL)getLabelSize:(NSScanner*)scanner
{
+ double sc;
+
[scanner scanString:ops.labelSize intoString:NULL];
- if ( ![scanner scanFloat:&state.labelSize.width] )
- state.labelSize.width = state.labelSize.height = 0.0;
- else if ( ![scanner scanFloat:&state.labelSize.height] )
- { NSLog(@"%@ (height) expected at location:%d", ops.labelSize, [scanner
scanLocation]);
- state.labelSize.height = 0.0;
- }
+ if ( ![scanner scanDouble:&sc] )
+ state.labelSize = NSZeroSize;
+ else
+ {
+ state.labelSize.width = sc;
+ if ( ![scanner scanDouble:&sc] )
+ NSLog(@"%@ (height) expected at location:%d", ops.labelSize, [scanner
scanLocation]);
+ else
+ state.labelSize.height = sc;
+ }
if ( state.labelSize.width == 0.0 ) /* default size */
state.labelSize.width = 11.5 * PT;
--- cenon.app-3.93.orig/GraphicObjects.subproj/VText.m
+++ cenon.app-3.93/GraphicObjects.subproj/VText.m
@@ -1040,7 +1040,7 @@
if (!colorAtt)
colorAtt = fillColor;
if ([principal mustDrawPale])
- { float h, s, b, a;
+ { CGFloat h, s, b, a;
[[colorAtt colorUsingColorSpaceName:NSDeviceRGBColorSpace]
getHue:&h
saturation:&s
--- cenon.app-3.93.orig/GraphicObjects.subproj/VPolyLine.m
+++ cenon.app-3.93/GraphicObjects.subproj/VPolyLine.m
@@ -1221,7 +1221,7 @@
col = [self separationColor:col]; // get individual separation
color
if ( [principal mustDrawPale] )
- { float h, s, b, a;
+ { CGFloat h, s, b, a;
[[col colorUsingColorSpaceName:NSDeviceRGBColorSpace] getHue:&h
saturation:&s brightness:&b alpha:&a];
[[NSColor colorWithCalibratedHue:h saturation:s brightness:(b<0.5)
? 0.5 : b alpha:a] set];
@@ -3152,8 +3152,14 @@
ptslist = [ptsData mutableBytes];
while ( ![scanner isAtEnd] )
- { [scanner scanFloat:&(ptslist[i].x)];
- [scanner scanFloat:&(ptslist[i++].y)];
+ {
+ double d;
+
+ [scanner scanDouble:&d];
+ ptslist[i].x = d;
+ [scanner scanDouble:&d];
+ ptslist[i].y = d;
+ i++;
}
}
else
--- cenon.app-3.93.orig/GraphicObjects.subproj/VGraphic.m
+++ cenon.app-3.93/GraphicObjects.subproj/VGraphic.m
@@ -519,7 +519,7 @@
- (void)drawColorPale:(BOOL)drawPale
{
if ( drawPale )
- { float h, s, b, a;
+ { CGFloat h, s, b, a;
[[color colorUsingColorSpaceName:NSDeviceRGBColorSpace] getHue:&h
saturation:&s brightness:&b alpha:&a];
[[NSColor colorWithCalibratedHue:h saturation:s brightness:(b<0.5) ?
0.5 : b alpha:a] set];
--- cenon.app-3.93.orig/GraphicObjects.subproj/VPath.m
+++ cenon.app-3.93/GraphicObjects.subproj/VPath.m
@@ -2568,7 +2568,7 @@
col = [self separationColor:col]; // get individual separation
color
if ( [principal mustDrawPale] )
- { float h, s, b, a;
+ { CGFloat h, s, b, a;
[[col colorUsingColorSpaceName:NSDeviceRGBColorSpace] getHue:&h
saturation:&s brightness:&b alpha:&a];
[[NSColor colorWithCalibratedHue:h saturation:s brightness:(b<0.5)
? 0.5 : b alpha:a] set];
--- cenon.app-3.93.orig/GraphicObjects.subproj/VRectangle.m
+++ cenon.app-3.93/GraphicObjects.subproj/VRectangle.m
@@ -643,7 +643,7 @@
col = [self separationColor:fillColor]; // get individual
separation color
if ( [principal mustDrawPale] )
- { float h, s, b, a;
+ { CGFloat h, s, b, a;
[[col colorUsingColorSpaceName:NSDeviceRGBColorSpace]
getHue:&h saturation:&s brightness:&b alpha:&a];
[[NSColor colorWithCalibratedHue:h saturation:s
brightness:(b<0.5) ? 0.5 : b alpha:a] set];
--- cenon.app-3.93.orig/MoveMatrix.m
+++ cenon.app-3.93/MoveMatrix.m
@@ -104,7 +104,7 @@
- (void)mouseDown:(NSEvent *)theEvent
{ NSPoint mouseDownLocation, mouseUpLocation, mouseLocation;
- int row, column, newRow;
+ NSInteger row, column, newRow;
NSRect visibleRect, cellCacheBounds, cellFrame;
float dy;
NSEvent *event;
@@ -348,10 +348,10 @@
- (void)drawRect:(NSRect)rect;
-{ int row, col;
+{ NSInteger row, col;
NSRect cellBorder;
NSRectEdge sides[] = {NSMinXEdge, NSMinYEdge, NSMaxXEdge, NSMaxYEdge,
NSMinXEdge, NSMinYEdge};
- float grays[] = {NSDarkGray, NSDarkGray, NSWhite, NSWhite, NSBlack,
NSBlack};
+ const CGFloat grays[] = {NSDarkGray, NSDarkGray, NSWhite, NSWhite,
NSBlack, NSBlack};
/* do the regular drawing */
[super drawRect:rect];