abs() -> fabs()

OK Fred Kiefer



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@38572 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Sebastian Reitenbach 2015-05-26 17:57:19 +00:00
parent 8b6d21351b
commit 8060ece175
3 changed files with 14 additions and 11 deletions

View file

@ -20,6 +20,9 @@
* Model/GMArchiver.m
* TextConverters/RTF/RTFConsumer.m
Format string fixes and casts
* Source/NSGradient.m
* Source/NSWindow.m
abs() -> fabs()
2015-05-22 Fred Kiefer <FredKiefer@gmx.de>

View file

@ -334,7 +334,7 @@ relativeCenterPosition: (NSPoint)relativeCenterPoint
startPoint = NSMakePoint(NSMinX(rect), NSMaxY(rect));
}
rad = PI * angle / 180;
length = abs(NSWidth(rect) * cos(rad) + NSHeight(rect) * sin(rad));
length = fabs(NSWidth(rect) * cos(rad) + NSHeight(rect) * sin(rad));
endPoint = NSMakePoint(startPoint.x + length * cos(rad),
startPoint.y + length * sin(rad));

View file

@ -889,8 +889,8 @@ many times.
- (NSString*) description
{
return [[super description] stringByAppendingFormat: @"Number: %d Title: %@",
[self windowNumber], [self title]];
return [[super description] stringByAppendingFormat: @"Number: %ld Title: %@",
(long) [self windowNumber], [self title]];
}
- (void) _startBackendWindow
@ -2066,10 +2066,10 @@ titleWithRepresentedFilename(NSString *representedFilename)
}
// Find the biggest difference
maxDiff = abs(newFrame.origin.x - _frame.origin.x);
maxDiff = MAX(maxDiff, abs(newFrame.origin.y - _frame.origin.y));
maxDiff = MAX(maxDiff, abs(newFrame.size.width - _frame.size.width));
maxDiff = MAX(maxDiff, abs(newFrame.size.height - _frame.size.height));
maxDiff = fabs(newFrame.origin.x - _frame.origin.x);
maxDiff = MAX(maxDiff, fabs(newFrame.origin.y - _frame.origin.y));
maxDiff = MAX(maxDiff, fabs(newFrame.size.width - _frame.size.width));
maxDiff = MAX(maxDiff, fabs(newFrame.size.height - _frame.size.height));
return (maxDiff * resizeTime) / 150;
}
@ -5115,10 +5115,10 @@ current key view.<br />
maxRect = [self constrainFrameRect: maxRect toScreen: [self screen]];
// Compare the new frame with the current one
if ((abs(NSMaxX(maxRect) - NSMaxX(_frame)) < DIST)
&& (abs(NSMaxY(maxRect) - NSMaxY(_frame)) < DIST)
&& (abs(NSMinX(maxRect) - NSMinX(_frame)) < DIST)
&& (abs(NSMinY(maxRect) - NSMinY(_frame)) < DIST))
if ((fabs(NSMaxX(maxRect) - NSMaxX(_frame)) < DIST)
&& (fabs(NSMaxY(maxRect) - NSMaxY(_frame)) < DIST)
&& (fabs(NSMinX(maxRect) - NSMinX(_frame)) < DIST)
&& (fabs(NSMinY(maxRect) - NSMinY(_frame)) < DIST))
{
// Already in zoomed mode, reset user frame, if stored
if (_autosaveName != nil)