Revision: 13340
          http://sourceforge.net/p/skim-app/code/13340
Author:   hofman
Date:     2023-03-03 17:11:08 +0000 (Fri, 03 Mar 2023)
Log Message:
-----------
make conversion of floats to integers explicit

Modified Paths:
--------------
    trunk/NSBitmapImageRep_SKExtensions.m
    trunk/NSColor_SKExtensions.m
    trunk/NSGeometry_SKExtensions.h
    trunk/PDFPage_SKExtensions.m
    trunk/SKGeneralPreferences.m
    trunk/SKPDFView.m
    trunk/SKTransitionController.m

Modified: trunk/NSBitmapImageRep_SKExtensions.m
===================================================================
--- trunk/NSBitmapImageRep_SKExtensions.m       2023-03-03 10:36:34 UTC (rev 
13339)
+++ trunk/NSBitmapImageRep_SKExtensions.m       2023-03-03 17:11:08 UTC (rev 
13340)
@@ -232,7 +232,7 @@
 
 + (id)imageRepWithSize:(NSSize)size scale:(CGFloat)scale drawingHandler:(void 
(^)(NSRect dstRect))drawingHandler {
     NSBitmapImageRep *bmpImageRep = [[[self alloc] 
initWithBitmapDataPlanes:NULL
-        pixelsWide:size.width * scale pixelsHigh:size.height * scale
+        pixelsWide:(NSInteger)(size.width * scale) 
pixelsHigh:(NSInteger)(size.height * scale)
         bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO
         colorSpaceName:NSCalibratedRGBColorSpace 
bitmapFormat:NSAlphaFirstBitmapFormat
         bytesPerRow:0 bitsPerPixel:0] autorelease];

Modified: trunk/NSColor_SKExtensions.m
===================================================================
--- trunk/NSColor_SKExtensions.m        2023-03-03 10:36:34 UTC (rev 13339)
+++ trunk/NSColor_SKExtensions.m        2023-03-03 17:11:08 UTC (rev 13340)
@@ -260,10 +260,10 @@
     [[self colorUsingColorSpaceName:NSCalibratedRGBColorSpace] getRed:&red 
green:&green blue:&blue alpha:&alpha];
     
     NSAppleEventDescriptor *descriptor = [NSAppleEventDescriptor 
listDescriptor];
-    [descriptor insertDescriptor:[NSAppleEventDescriptor 
descriptorWithInt32:round(65535 * red)] atIndex:1];
-    [descriptor insertDescriptor:[NSAppleEventDescriptor 
descriptorWithInt32:round(65535 * green)] atIndex:2];
-    [descriptor insertDescriptor:[NSAppleEventDescriptor 
descriptorWithInt32:round(65535 * blue)] atIndex:3];
-    [descriptor insertDescriptor:[NSAppleEventDescriptor 
descriptorWithInt32:round(65535 * alpha)] atIndex:4];
+    [descriptor insertDescriptor:[NSAppleEventDescriptor 
descriptorWithInt32:(SInt32)round(65535 * red)] atIndex:1];
+    [descriptor insertDescriptor:[NSAppleEventDescriptor 
descriptorWithInt32:(SInt32)round(65535 * green)] atIndex:2];
+    [descriptor insertDescriptor:[NSAppleEventDescriptor 
descriptorWithInt32:(SInt32)round(65535 * blue)] atIndex:3];
+    [descriptor insertDescriptor:[NSAppleEventDescriptor 
descriptorWithInt32:(SInt32)round(65535 * alpha)] atIndex:4];
     
     return descriptor;
 }

Modified: trunk/NSGeometry_SKExtensions.h
===================================================================
--- trunk/NSGeometry_SKExtensions.h     2023-03-03 10:36:34 UTC (rev 13339)
+++ trunk/NSGeometry_SKExtensions.h     2023-03-03 17:11:08 UTC (rev 13340)
@@ -170,10 +170,10 @@
 static inline
 Rect SKQDRectFromNSRect(NSRect nsRect) {
     Rect qdRect;
-    qdRect.left = round(NSMinX(nsRect));
-    qdRect.bottom = round(NSMinY(nsRect));
-    qdRect.right = round(NSMaxX(nsRect));
-    qdRect.top = round(NSMaxY(nsRect));
+    qdRect.left = (short)round(NSMinX(nsRect));
+    qdRect.bottom = (short)round(NSMinY(nsRect));
+    qdRect.right = (short)round(NSMaxX(nsRect));
+    qdRect.top = (short)round(NSMaxY(nsRect));
     return qdRect;
 }
 
@@ -191,8 +191,8 @@
 static inline
 Point SKQDPointFromNSPoint(NSPoint nsPoint) {
     Point qdPoint;
-    qdPoint.h = round(nsPoint.x);
-    qdPoint.v = round(nsPoint.y);
+    qdPoint.h = (short)round(nsPoint.x);
+    qdPoint.v = (short)round(nsPoint.y);
     return qdPoint;
 }
 

Modified: trunk/PDFPage_SKExtensions.m
===================================================================
--- trunk/PDFPage_SKExtensions.m        2023-03-03 10:36:34 UTC (rev 13339)
+++ trunk/PDFPage_SKExtensions.m        2023-03-03 17:11:08 UTC (rev 13340)
@@ -106,8 +106,8 @@
     NSRect bounds = [self boundsForBox:box];
     NSBitmapImageRep *imageRep;
     imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
-                                                       
pixelsWide:NSWidth(bounds) 
-                                                       
pixelsHigh:NSHeight(bounds) 
+                                                       
pixelsWide:(NSInteger)NSWidth(bounds)
+                                                       
pixelsHigh:(NSInteger)NSHeight(bounds)
                                                     bitsPerSample:8 
                                                   samplesPerPixel:4
                                                          hasAlpha:YES 
@@ -511,11 +511,11 @@
 
 static inline NSInteger distanceForAngle(NSInteger angle, NSRect bounds, 
NSRect pageBounds) {
     switch (angle) {
-        case 0:   return NSMinX(bounds);
-        case 90:  return NSMinY(bounds);
-        case 180: return NSMaxX(pageBounds) - NSMaxX(bounds);
-        case 270: return NSMaxY(pageBounds) - NSMaxY(bounds);
-        default:  return NSMinX(bounds);
+        case 0:   return (NSInteger)NSMinX(bounds);
+        case 90:  return (NSInteger)NSMinY(bounds);
+        case 180: return (NSInteger)(NSMaxX(pageBounds) - NSMaxX(bounds));
+        case 270: return (NSInteger)(NSMaxY(pageBounds) - NSMaxY(bounds));
+        default:  return (NSInteger)NSMinX(bounds);
     }
 }
 

Modified: trunk/SKGeneralPreferences.m
===================================================================
--- trunk/SKGeneralPreferences.m        2023-03-03 10:36:34 UTC (rev 13339)
+++ trunk/SKGeneralPreferences.m        2023-03-03 17:11:08 UTC (rev 13340)
@@ -128,7 +128,7 @@
 
 - (void)synchronizeUpdateInterval {
     [self willChangeValueForKey:UPDATEINTERVAL_KEY];
-    updateInterval = [[SUUpdater sharedUpdater] automaticallyChecksForUpdates] 
? [[SUUpdater sharedUpdater] updateCheckInterval] : 0;
+    updateInterval = (NSInteger)[[SUUpdater sharedUpdater] 
automaticallyChecksForUpdates] ? (NSInteger)[[SUUpdater sharedUpdater] 
updateCheckInterval] : 0;
     [self didChangeValueForKey:UPDATEINTERVAL_KEY];
 }
 

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2023-03-03 10:36:34 UTC (rev 13339)
+++ trunk/SKPDFView.m   2023-03-03 17:11:08 UTC (rev 13340)
@@ -2396,7 +2396,7 @@
     gestureRotation -= [theEvent rotation];
     if (fabs(gestureRotation) > 45.0 && gesturePageIndex != NSNotFound) {
         CGFloat rotation = 90.0 * round(gestureRotation / 90.0);
-        [self rotatePageAtIndex:gesturePageIndex by:rotation];
+        [self rotatePageAtIndex:gesturePageIndex by:(NSInteger)rotation];
         gestureRotation -= rotation;
     }
     if (([theEvent phase] == NSEventPhaseEnded || [theEvent phase] == 
NSEventPhaseCancelled)) {

Modified: trunk/SKTransitionController.m
===================================================================
--- trunk/SKTransitionController.m      2023-03-03 10:36:34 UTC (rev 13339)
+++ trunk/SKTransitionController.m      2023-03-03 17:11:08 UTC (rev 13340)
@@ -703,7 +703,7 @@
     if (needsReshape) {
         [[self openGLContext] update];
         
-        glViewport(0, 0, CGRectGetWidth(rect), CGRectGetHeight(rect));
+        glViewport(0, 0, (GLint)CGRectGetWidth(rect), 
(GLint)CGRectGetHeight(rect));
 
         glMatrixMode(GL_PROJECTION);
         glLoadIdentity();

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to