JavaScriptCore:
authorweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Aug 2006 18:57:40 +0000 (18:57 +0000)
committerweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Aug 2006 18:57:40 +0000 (18:57 +0000)
        Reviewed by Darin.

        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10192
          Make WebCore (and friends) compile with -Wshorten-64-to-32

          * Adds -Wshorten-64-to-32 flag to Xcode project.
          * Adds explicit casts where OK.

        * API/JSNodeList.c:
        (JSNodeList_item):
        (JSNodeList_getProperty):
        * JavaScriptCore.xcodeproj/project.pbxproj:

JavaScriptGlue:

        Reviewed by Darin.

        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10192
          Make WebCore (and friends) compile with -Wshorten-64-to-32

          * Adds -Wshorten-64-to-32 flag to Xcode project.

        * JavaScriptGlue.xcodeproj/project.pbxproj:

WebCore:

        Reviewed by Darin.

        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10192
          Make WebCore (and friends) compile with -Wshorten-64-to-32

          * Adds -Wshorten-64-to-32 flag to Xcode project.
          * Adds 'f' to float literals where expecting a float.
          * Use cosf() instead of cos() when assigning to a float.

        * WebCore.xcodeproj/project.pbxproj:
        * kcanvas/device/quartz/filters/WKDiffuseLightingFilter.m:
        (+[WKDiffuseLightingFilter initialize]):
        * kcanvas/device/quartz/filters/WKDiscreteTransferFilter.m:
        (-[WKDiscreteTransferFilter outputImage]):
        * kcanvas/device/quartz/filters/WKDisplacementMapFilter.m:
        (+[WKDisplacementMapFilter initialize]):
        * kcanvas/device/quartz/filters/WKSpecularLightingFilter.m:
        (+[WKSpecularLightingFilter initialize]):
        * kcanvas/device/quartz/filters/WKSpotLightFilter.m:
        (-[WKSpotLightFilter outputImage]):
        * kcanvas/device/quartz/filters/WKTableTransferFilter.m:
        (-[WKTableTransferFilter outputImage]):

WebKit:

        Reviewed by Darin.

        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10192
          Make WebCore (and friends) compile with -Wshorten-64-to-32

          * Adds 'f' to float literals where expecting a float.
          * Use ceilf() instead of ceil() when assigning to a float.
          * Adds explicit casts where OK.

          NOTE: The -Wshorten-64-to-32 flag was not added for WebKit
          because there are still a few places where no error handling
          is in place.  The flag can be added as soon as those are worked
          out.

        * Misc/WebNSControlExtras.m:
        (-[NSControl sizeToFitAndAdjustWindowHeight]):
        * Misc/WebNSImageExtras.m:
        (-[NSImage _web_scaleToMaxSize:]):
        * Misc/WebNSViewExtras.h:
        * Misc/WebNSViewExtras.m:
        * Plugins/WebBaseNetscapePluginView.m:
        (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]):
        (-[WebBaseNetscapePluginView drawRect:]):
        * WebCoreSupport/WebFrameBridge.m:
        (-[WebFrameBridge expiresTimeForResponse:]):
        * WebInspector/WebInspector.m:
        (-[NSWindow window]):
        (-[WebInspector treeViewScrollTo:]):
        (-[WebInspector _updateSystemColors]):
        (-[WebInspector webView:plugInViewWithArguments:]):
        (-[WebInspector outlineView:objectValueForTableColumn:byItem:]):
        * WebInspector/WebInspectorOutlineView.m:
        (-[WebInspectorOutlineView _highlightRow:clipRect:]):
        * WebInspector/WebNodeHighlight.m:
        (-[WebNodeHighlight initWithBounds:andRects:forView:]):
        * WebInspector/WebNodeHighlightView.m:
        (-[WebNodeHighlightView roundedRect:withRadius:]):
        (-[WebNodeHighlightView initWithHighlight:andRects:forView:]):
        (-[WebNodeHighlightView drawRect:]):
        * WebView/WebFrame.m:
        (-[WebFrame _opened]):
        * WebView/WebFrameView.m:
        (-[WebFrameView initWithFrame:]):
        * WebView/WebHTMLView.m:
        (-[WebHTMLView _dragImageForLinkElement:]):
        (-[WebHTMLView _web_setPrintingModeRecursive]):
        (-[WebHTMLView _web_clearPrintingModeRecursive]):
        (-[NSArray layout]):
        (-[NSArray _setPrinting:minimumPageWidth:maximumPageWidth:adjustViewSize:]):
        (-[NSArray adjustPageHeightNew:top:bottom:limit:]):
        (-[NSArray _scaleFactorForPrintOperation:]):
        (-[NSArray setPageWidthForPrinting:]):
        (-[NSArray _endPrintMode]):
        (-[NSArray knowsPageRange:]):
        (-[NSArray _originalFontA]):
        (-[NSArray _originalFontB]):
        (-[WebTextCompleteController _buildUI]):
        (-[WebTextCompleteController _placePopupWindow:]):
        * WebView/WebPDFView.m:
        (-[WebPDFView _makeTextStandardSize:]):
        (-[WebPDFView selectionImageForcingWhiteText:]):
        (-[PDFPrefUpdatingProxy forwardInvocation:]):
        * WebView/WebPreferences.m:
        (-[WebPreferences _floatValueForKey:]):
        * WebView/WebView.m:
        (-[WebView makeTextSmaller:]):
        (-[WebView canMakeTextStandardSize]):
        (-[WebView makeTextStandardSize:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15799 268f45cc-cd09-0410-ab3c-d52691b4dbfc

30 files changed:
JavaScriptCore/API/JSNodeList.c
JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
JavaScriptGlue/ChangeLog
JavaScriptGlue/JavaScriptGlue.xcodeproj/project.pbxproj
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/kcanvas/device/quartz/filters/WKDiffuseLightingFilter.m
WebCore/kcanvas/device/quartz/filters/WKDiscreteTransferFilter.m
WebCore/kcanvas/device/quartz/filters/WKDisplacementMapFilter.m
WebCore/kcanvas/device/quartz/filters/WKSpecularLightingFilter.m
WebCore/kcanvas/device/quartz/filters/WKSpotLightFilter.m
WebCore/kcanvas/device/quartz/filters/WKTableTransferFilter.m
WebKit/ChangeLog
WebKit/Misc/WebNSControlExtras.m
WebKit/Misc/WebNSImageExtras.m
WebKit/Misc/WebNSViewExtras.h
WebKit/Misc/WebNSViewExtras.m
WebKit/Plugins/WebBaseNetscapePluginView.m
WebKit/WebCoreSupport/WebFrameBridge.m
WebKit/WebInspector/WebInspector.m
WebKit/WebInspector/WebInspectorOutlineView.m
WebKit/WebInspector/WebNodeHighlight.m
WebKit/WebInspector/WebNodeHighlightView.m
WebKit/WebView/WebFrame.m
WebKit/WebView/WebFrameView.m
WebKit/WebView/WebHTMLView.m
WebKit/WebView/WebPDFView.m
WebKit/WebView/WebPreferences.m
WebKit/WebView/WebView.m

index 273de71..6e094f8 100644 (file)
@@ -33,7 +33,7 @@ static JSValueRef JSNodeList_item(JSContextRef context, JSObjectRef object, JSOb
     if (argumentCount > 0) {
         NodeList* nodeList = JSObjectGetPrivate(thisObject);
         assert(nodeList);
-        Node* node = NodeList_item(nodeList, JSValueToNumber(context, arguments[0], exception));
+        Node* node = NodeList_item(nodeList, (unsigned)JSValueToNumber(context, arguments[0], exception));
         if (node)
             return JSNode_new(context, node);
     }
@@ -65,12 +65,11 @@ static JSValueRef JSNodeList_getProperty(JSContextRef context, JSObjectRef thisO
     NodeList* nodeList = JSObjectGetPrivate(thisObject);
     assert(nodeList);
     double index = JSValueToNumber(context, JSValueMakeString(context, propertyName), exception);
-    unsigned uindex = index;
+    unsigned uindex = (unsigned)index;
     if (uindex == index) { // false for NaN
         Node* node = NodeList_item(nodeList, uindex);
-        if (node) {
+        if (node)
             return JSNode_new(context, node);
-        }
     }
     
     return NULL;
index 879224b..c3f12cf 100644 (file)
@@ -1,3 +1,18 @@
+2006-08-04  Sam Weinig  <sam.weinig@gmail.com>
+
+        Reviewed by Darin.
+
+        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10192
+          Make WebCore (and friends) compile with -Wshorten-64-to-32
+
+          * Adds -Wshorten-64-to-32 flag to Xcode project.
+          * Adds explicit casts where OK.
+
+        * API/JSNodeList.c:
+        (JSNodeList_item):
+        (JSNodeList_getProperty):
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+
 2006-08-04  Adam Roben  <aroben@apple.com>
 
         Reviewed by Anders.
index 3f2ee53..2bab9fa 100644 (file)
                                        "-Wno-format-y2k",
                                        "-Wno-long-double",
                                        "-Wundef",
+                                       "-Wshorten-64-to-32",
                                );
                        };
                        name = Debug;
                                        "-Wno-format-y2k",
                                        "-Wno-long-double",
                                        "-Wundef",
+                                       "-Wshorten-64-to-32",
                                );
                        };
                        name = Release;
                                        "-Wno-format-y2k",
                                        "-Wno-long-double",
                                        "-Wundef",
+                                       "-Wshorten-64-to-32",
                                );
                        };
                        name = Production;
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
                                        "-Wundef",
+                                       "-Wshorten-64-to-32",
                                );
                        };
                        name = Debug;
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
                                        "-Wundef",
+                                       "-Wshorten-64-to-32",
                                );
                        };
                        name = Release;
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
                                        "-Wundef",
+                                       "-Wshorten-64-to-32",
                                );
                        };
                        name = Production;
index 1bea746..c891d38 100644 (file)
@@ -1,3 +1,14 @@
+2006-08-04  Sam Weinig  <sam.weinig@gmail.com>
+
+        Reviewed by Darin.
+
+        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10192
+          Make WebCore (and friends) compile with -Wshorten-64-to-32
+
+          * Adds -Wshorten-64-to-32 flag to Xcode project.
+
+        * JavaScriptGlue.xcodeproj/project.pbxproj:
+
 2006-08-03  Sam Weinig  <sam.weinig@gmail.com>
 
         Reviewed by Darin.
index a7567fd..49a82d9 100644 (file)
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
                                        "-Wundef",
+                                       "-Wshorten-64-to-32",
                                );
                        };
                        name = Debug;
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
                                        "-Wundef",
+                                       "-Wshorten-64-to-32",
                                );
                        };
                        name = Release;
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
                                        "-Wundef",
+                                       "-Wshorten-64-to-32",
                                );
                        };
                        name = Production;
index fd43681..495607c 100644 (file)
@@ -1,3 +1,28 @@
+2006-08-04  Sam Weinig  <sam.weinig@gmail.com>
+
+        Reviewed by Darin.
+
+        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10192
+          Make WebCore (and friends) compile with -Wshorten-64-to-32
+
+          * Adds -Wshorten-64-to-32 flag to Xcode project.
+          * Adds 'f' to float literals where expecting a float.
+          * Use cosf() instead of cos() when assigning to a float.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * kcanvas/device/quartz/filters/WKDiffuseLightingFilter.m:
+        (+[WKDiffuseLightingFilter initialize]):
+        * kcanvas/device/quartz/filters/WKDiscreteTransferFilter.m:
+        (-[WKDiscreteTransferFilter outputImage]):
+        * kcanvas/device/quartz/filters/WKDisplacementMapFilter.m:
+        (+[WKDisplacementMapFilter initialize]):
+        * kcanvas/device/quartz/filters/WKSpecularLightingFilter.m:
+        (+[WKSpecularLightingFilter initialize]):
+        * kcanvas/device/quartz/filters/WKSpotLightFilter.m:
+        (-[WKSpotLightFilter outputImage]):
+        * kcanvas/device/quartz/filters/WKTableTransferFilter.m:
+        (-[WKTableTransferFilter outputImage]):
+
 2006-08-03  David Hyatt  <hyatt@apple.com>
 
         Fix for bug 10229, don't bother trying to clear when no floats are
index 0b57c60..b401c0d 100644 (file)
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
                                        "-Wundef",
+                                       "-Wshorten-64-to-32",
                                );
                        };
                        name = Debug;
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
                                        "-Wundef",
+                                       "-Wshorten-64-to-32",
                                );
                        };
                        name = Release;
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
                                        "-Wundef",
+                                       "-Wshorten-64-to-32",
                                );
                        };
                        name = Production;
index 877f515..f6d6ce0 100644 (file)
@@ -37,7 +37,7 @@ static CIKernel *diffuseLightingFilter = nil;
                      [NSArray arrayWithObjects:kCICategoryStylize, kCICategoryVideo,
                          kCICategoryStillImage, kCICategoryNonSquarePixels,nil], kCIAttributeFilterCategories,
                      [NSDictionary dictionaryWithObjectsAndKeys:
-                         [CIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0],
+                         [CIColor colorWithRed:1.0f green:1.0f blue:1.0f alpha:1.0f],
                          kCIAttributeDefault, nil], @"inputLightingColor",
                      [NSDictionary dictionaryWithObjectsAndKeys:
                          [NSNumber numberWithDouble:0.0], kCIAttributeMin,
index 8f1ae46..c963709 100644 (file)
@@ -61,7 +61,7 @@ static CIKernel *discreteTransferFilter = nil;
     CISampler *inputSampler = [CISampler samplerWithImage: inputImage];
     CISampler *tableSampler = [CISampler samplerWithImage: inputTable keysAndValues:kCISamplerFilterMode, kCISamplerFilterNearest, kCISamplerWrapMode, kCISamplerWrapClamp, nil];
     NSArray *args = [NSArray arrayWithObjects:inputSampler, tableSampler, inputSelector, 
-        [NSNumber numberWithFloat:[inputTable extent].size.width-1.0], @"definition", [inputSampler definition], nil];
+        [NSNumber numberWithFloat:[inputTable extent].size.width - 1.0f], @"definition", [inputSampler definition], nil];
     return [self apply:discreteTransferFilter arguments:args options:nil];
 }
 
index ac7b1cc..efb699c 100644 (file)
@@ -38,10 +38,10 @@ static CIKernel *displacementMapFilter = nil;
                      [NSArray arrayWithObjects:kCICategoryStylize, kCICategoryVideo,
                          kCICategoryStillImage, kCICategoryNonSquarePixels,nil], kCIAttributeFilterCategories,
                      [NSDictionary dictionaryWithObjectsAndKeys:
-                         [CIVector vectorWithX:1.0 Y:0.0 Z:0.0 W:0.0],
+                         [CIVector vectorWithX:1.0f Y:0.0f Z:0.0f W:0.0f],
                          kCIAttributeDefault, nil], @"inputXChannelSelector",   
                      [NSDictionary dictionaryWithObjectsAndKeys:
-                         [CIVector vectorWithX:0.0 Y:1.0 Z:0.0 W:0.0],
+                         [CIVector vectorWithX:0.0f Y:1.0f Z:0.0f W:0.0f],
                          kCIAttributeDefault, nil], @"inputYChannelSelector",                  
                      [NSDictionary dictionaryWithObjectsAndKeys:
                          [NSNumber numberWithDouble:0.0], kCIAttributeDefault,
index 95e4438..661a233 100644 (file)
@@ -38,7 +38,7 @@ static CIKernel *specularLightingFilter = nil;
                      [NSArray arrayWithObjects:kCICategoryStylize, kCICategoryVideo,
                          kCICategoryStillImage, kCICategoryNonSquarePixels,nil], kCIAttributeFilterCategories,
                      [NSDictionary dictionaryWithObjectsAndKeys:
-                         [CIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0],
+                         [CIColor colorWithRed:1.0f green:1.0f blue:1.0f alpha:1.0f],
                          kCIAttributeDefault, nil],  @"inputLightingColor",
                      [NSDictionary dictionaryWithObjectsAndKeys:
                          [NSNumber numberWithDouble:0.0], kCIAttributeMin,
index 158bfd0..42a78f2 100644 (file)
@@ -70,7 +70,7 @@ static CIKernel *spotLightFilter = nil;
 
 - (CIImage *)outputImage
 {
-    float coscutoff = cos([inputLimitingConeAngle floatValue]);
+    float coscutoff = cosf([inputLimitingConeAngle floatValue]);
     if (coscutoff < 0) 
         coscutoff = -coscutoff;
     return [self apply:spotLightFilter, inputLightVectors, inputLightDirection, inputSpecularExponent, [NSNumber numberWithFloat:coscutoff], nil];
index 8bfe0b1..175341d 100644 (file)
@@ -64,7 +64,7 @@ static CIKernel *tableTransferFilter = nil;
     CISampler *inputSampler = [CISampler samplerWithImage: inputImage];
     CISampler *tableSampler = [CISampler samplerWithImage: inputTable keysAndValues:kCISamplerFilterMode, kCISamplerFilterLinear, kCISamplerWrapMode, kCISamplerWrapClamp, nil];
     NSArray *args = [NSArray arrayWithObjects:inputSampler, tableSampler, inputSelector, 
-        [NSNumber numberWithFloat:[inputTable extent].size.width-1.0], @"definition", [inputSampler definition], nil];
+        [NSNumber numberWithFloat:[inputTable extent].size.width - 1.0f], @"definition", [inputSampler definition], nil];
     return [self apply:tableTransferFilter arguments:args options:nil];
 }
 
index 27db8f2..afd297a 100644 (file)
@@ -1,3 +1,74 @@
+2006-08-04  Sam Weinig  <sam.weinig@gmail.com>
+
+        Reviewed by Darin.
+
+        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10192
+          Make WebCore (and friends) compile with -Wshorten-64-to-32
+
+          * Adds 'f' to float literals where expecting a float.
+          * Use ceilf() instead of ceil() when assigning to a float.
+          * Adds explicit casts where OK.
+          
+          NOTE: The -Wshorten-64-to-32 flag was not added for WebKit
+          because there are still a few places where no error handling 
+          is in place.  The flag can be added as soon as those are worked
+          out.
+
+        * Misc/WebNSControlExtras.m:
+        (-[NSControl sizeToFitAndAdjustWindowHeight]):
+        * Misc/WebNSImageExtras.m:
+        (-[NSImage _web_scaleToMaxSize:]):
+        * Misc/WebNSViewExtras.h:
+        * Misc/WebNSViewExtras.m:
+        * Plugins/WebBaseNetscapePluginView.m:
+        (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]):
+        (-[WebBaseNetscapePluginView drawRect:]):
+        * WebCoreSupport/WebFrameBridge.m:
+        (-[WebFrameBridge expiresTimeForResponse:]):
+        * WebInspector/WebInspector.m:
+        (-[NSWindow window]):
+        (-[WebInspector treeViewScrollTo:]):
+        (-[WebInspector _updateSystemColors]):
+        (-[WebInspector webView:plugInViewWithArguments:]):
+        (-[WebInspector outlineView:objectValueForTableColumn:byItem:]):
+        * WebInspector/WebInspectorOutlineView.m:
+        (-[WebInspectorOutlineView _highlightRow:clipRect:]):
+        * WebInspector/WebNodeHighlight.m:
+        (-[WebNodeHighlight initWithBounds:andRects:forView:]):
+        * WebInspector/WebNodeHighlightView.m:
+        (-[WebNodeHighlightView roundedRect:withRadius:]):
+        (-[WebNodeHighlightView initWithHighlight:andRects:forView:]):
+        (-[WebNodeHighlightView drawRect:]):
+        * WebView/WebFrame.m:
+        (-[WebFrame _opened]):
+        * WebView/WebFrameView.m:
+        (-[WebFrameView initWithFrame:]):
+        * WebView/WebHTMLView.m:
+        (-[WebHTMLView _dragImageForLinkElement:]):
+        (-[WebHTMLView _web_setPrintingModeRecursive]):
+        (-[WebHTMLView _web_clearPrintingModeRecursive]):
+        (-[NSArray layout]):
+        (-[NSArray _setPrinting:minimumPageWidth:maximumPageWidth:adjustViewSize:]):
+        (-[NSArray adjustPageHeightNew:top:bottom:limit:]):
+        (-[NSArray _scaleFactorForPrintOperation:]):
+        (-[NSArray setPageWidthForPrinting:]):
+        (-[NSArray _endPrintMode]):
+        (-[NSArray knowsPageRange:]):
+        (-[NSArray _originalFontA]):
+        (-[NSArray _originalFontB]):
+        (-[WebTextCompleteController _buildUI]):
+        (-[WebTextCompleteController _placePopupWindow:]):
+        * WebView/WebPDFView.m:
+        (-[WebPDFView _makeTextStandardSize:]):
+        (-[WebPDFView selectionImageForcingWhiteText:]):
+        (-[PDFPrefUpdatingProxy forwardInvocation:]):
+        * WebView/WebPreferences.m:
+        (-[WebPreferences _floatValueForKey:]):
+        * WebView/WebView.m:
+        (-[WebView makeTextSmaller:]):
+        (-[WebView canMakeTextStandardSize]):
+        (-[WebView makeTextStandardSize:]):
+
 2006-08-04  David Kilzer  <ddkilzer@kilzer.net>
 
         Reviewed by NOBODY (build fix).
index 165ad39..733269b 100644 (file)
@@ -34,7 +34,7 @@
 {
     NSRect frame = [self frame];
 
-    NSSize bestSize = [[self cell] cellSizeForBounds:NSMakeRect(0, 0, frame.size.width, 10000.0)];
+    NSSize bestSize = [[self cell] cellSizeForBounds:NSMakeRect(0.0f, 0.0f, frame.size.width, 10000.0f)];
     
     float heightDelta = bestSize.height - frame.size.height;
 
index a187900..fa25ddd 100644 (file)
@@ -34,7 +34,7 @@
 
 - (void)_web_scaleToMaxSize:(NSSize)size
 {
-    float heightResizeDelta = 0.0, widthResizeDelta = 0.0, resizeDelta = 0.0;
+    float heightResizeDelta = 0.0f, widthResizeDelta = 0.0f, resizeDelta = 0.0f;
     NSSize originalSize = [self size];
 
     if(originalSize.width > size.width){
index ae570f4..1550128 100644 (file)
@@ -28,7 +28,7 @@
 
 #import <AppKit/AppKit.h>
 
-#define WebDragImageAlpha 0.75
+#define WebDragImageAlpha 0.75f
 
 @class DOMElement;
 @class WebFrameView;
index 4b2db94..6435454 100644 (file)
 #import <WebKit/WebNSURLExtras.h>
 #import <WebKitSystemInterface.h>
 
-#define WebDragStartHysteresisX                 5.0
-#define WebDragStartHysteresisY                 5.0
-#define WebMaxDragImageSize                     NSMakeSize(400, 400)
-#define WebMaxOriginalImageArea                 (1500 * 1500)
-#define WebDragIconRightInset                   7.0
-#define WebDragIconBottomInset                  3.0
+#define WebDragStartHysteresisX                 5.0f
+#define WebDragStartHysteresisY                 5.0f
+#define WebMaxDragImageSize                     NSMakeSize(400.0f, 400.0f)
+#define WebMaxOriginalImageArea                 (1500.0f * 1500.0f)
+#define WebDragIconRightInset                   7.0f
+#define WebDragIconBottomInset                  3.0f
 
 @implementation NSView (WebExtras)
 
index 0f49d6f..fa68476 100644 (file)
@@ -479,7 +479,7 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
                 {
                     GLsizei width, height;
                     if ([self _getAGLOffscreenBuffer:NULL width:&width height:&height])
-                        glViewport(0.0, 0.0, width, height);
+                        glViewport(00, width, height);
                 }
                 break;
                 
@@ -1497,8 +1497,8 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
             CGContextRef cgContext = [[NSGraphicsContext currentContext] graphicsPort];
             CGContextSaveGState(cgContext);
             NSRect bounds = [self bounds];
-            CGContextTranslateCTM(cgContext, 0.0, NSHeight(bounds));
-            CGContextScaleCTM(cgContext, 1.0, -1.0);
+            CGContextTranslateCTM(cgContext, 0.0f, NSHeight(bounds));
+            CGContextScaleCTM(cgContext, 1.0f, -1.0f);
             [printedPluginBitmap drawInRect:bounds];
             CGContextRestoreGState(cgContext);
         }
@@ -1512,13 +1512,13 @@ static OSStatus TSMEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEve
             CGContextRef cgContext = [[NSGraphicsContext currentContext] graphicsPort];
             CGContextSaveGState(cgContext);
             NSRect bounds = [self bounds];
-            CGContextTranslateCTM(cgContext, 0.0, NSHeight(bounds));
-            CGContextScaleCTM(cgContext, 1.0, -1.0);
+            CGContextTranslateCTM(cgContext, 0.0f, NSHeight(bounds));
+            CGContextScaleCTM(cgContext, 1.0f, -1.0f);
             
             // Copy 'rect' from the offscreen buffer to this view (the flip above makes this sort of tricky)
             NSRect flippedRect = rect;
             flippedRect.origin.y = NSMaxY(bounds) - NSMaxY(flippedRect);
-            [aglOffscreenImage drawInRect:flippedRect fromRect:flippedRect operation:NSCompositeSourceOver fraction:1.0];
+            [aglOffscreenImage drawInRect:flippedRect fromRect:flippedRect operation:NSCompositeSourceOver fraction:1.0f];
             CGContextRestoreGState(cgContext);
         }
     }
index 773387e..6957280 100644 (file)
@@ -639,7 +639,8 @@ NSString *WebPluginContainerKey =   @"WebPluginContainer";
 
     NSTimeInterval expiration = [response _calculatedExpiration];
     expiration += kCFAbsoluteTimeIntervalSince1970;
-    return expiration > MAX_TIME_T ? MAX_TIME_T : expiration;
+    
+    return expiration > MAX_TIME_T ? MAX_TIME_T : (time_t)expiration;
 }
 
 - (void)reportClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date lockHistory:(BOOL)lockHistory isJavaScriptFormAction:(BOOL)isJavaScriptFormAction
index 776c9f6..afcb405 100644 (file)
@@ -106,7 +106,7 @@ static NSMapTable *lastChildIgnoringWhitespaceCache = NULL;
 {
     NSWindow *window = [super window];
     if (!window) {
-        NSPanel *window = [[WebInspectorPanel alloc] initWithContentRect:NSMakeRect(60.0, 200.0, 350.0, 550.0)\
+        NSPanel *window = [[WebInspectorPanel alloc] initWithContentRect:NSMakeRect(60.0f, 200.0f, 350.0f, 550.0f)\
             styleMask:(NSBorderlessWindowMask | NSUtilityWindowMask) backing:NSBackingStoreBuffered defer:YES];
         [window setBackgroundColor:[NSColor clearColor]];
         [window setOpaque:NO];
@@ -120,7 +120,7 @@ static NSMapTable *lastChildIgnoringWhitespaceCache = NULL;
         [window setMovableByWindowBackground:YES];
         [window setHidesOnDeactivate:NO];
         [window setDelegate:self];
-        [window setMinSize:NSMakeSize(280.0, 450.0)];
+        [window setMinSize:NSMakeSize(280.0f, 450.0f)];
 
         // Keep preferences separate from the rest of the client.
         // One reason this is good is that it keeps the inspector out of history via "private browsing".
@@ -415,8 +415,8 @@ static NSMapTable *lastChildIgnoringWhitespaceCache = NULL;
 - (void)treeViewScrollTo:(float)number
 {
     float bottom = NSHeight([_private->treeOutlineView frame]) - NSHeight([_private->treeScrollView documentVisibleRect]);
-    number = MAX(0.0, MIN(bottom, number));
-    [[_private->treeScrollView contentView] scrollToPoint:NSMakePoint(0.0, number)];
+    number = MAX(0.0f, MIN(bottom, number));
+    [[_private->treeScrollView contentView] scrollToPoint:NSMakePoint(0.0f, number)];
 }
 
 - (float)treeViewOffsetTop
@@ -773,7 +773,7 @@ static NSMapTable *lastChildIgnoringWhitespaceCache = NULL;
     if (!_private->webViewLoaded)
         return;
 
-    CGFloat red = 0.0, green = 0.0, blue = 0.0;
+    CGFloat red = 0.0f, green = 0.0f, blue = 0.0f;
     NSColor *color = [[NSColor alternateSelectedControlColor] colorUsingColorSpaceName:NSDeviceRGBColorSpace];
     [color getRed:&red green:&green blue:&blue alpha:NULL];
 
@@ -869,7 +869,7 @@ static NSMapTable *lastChildIgnoringWhitespaceCache = NULL;
     NSDictionary *attributes = [arguments objectForKey:@"WebPlugInAttributesKey"];
     if ([[attributes objectForKey:@"type"] isEqualToString:@"application/x-inspector-tree"]) {
         if (!_private->treeOutlineView) {
-            _private->treeScrollView = [[NSScrollView alloc] initWithFrame:NSMakeRect(0.0, 0.0, 250.0, 100.0)];
+            _private->treeScrollView = [[NSScrollView alloc] initWithFrame:NSMakeRect(0.0f, 0.0f, 250.0f, 100.0f)];
             [_private->treeScrollView setDrawsBackground:NO];
             [_private->treeScrollView setBorderType:NSNoBorder];
             [_private->treeScrollView setVerticalScroller:NO];
@@ -886,15 +886,15 @@ static NSMapTable *lastChildIgnoringWhitespaceCache = NULL;
             [_private->treeOutlineView sendActionOn:(NSLeftMouseUpMask | NSLeftMouseDownMask | NSLeftMouseDraggedMask)];
             [_private->treeOutlineView setFocusRingType:NSFocusRingTypeNone];
             [_private->treeOutlineView setAutoresizesOutlineColumn:NO];
-            [_private->treeOutlineView setRowHeight:15.0];
+            [_private->treeOutlineView setRowHeight:15.0f];
             [_private->treeOutlineView setTarget:self];
             [_private->treeOutlineView setDoubleAction:@selector(_focusRootNode:)];
-            [_private->treeOutlineView setIndentationPerLevel:12.0];
+            [_private->treeOutlineView setIndentationPerLevel:12.0f];
             [_private->treeScrollView setDocumentView:_private->treeOutlineView];
 
             NSCell *headerCell = [[NSCell alloc] initTextCell:@""];
             NSCell *dataCell = [[NSCell alloc] initTextCell:@""];
-            [dataCell setFont:[NSFont systemFontOfSize:11.0]];
+            [dataCell setFont:[NSFont systemFontOfSize:11.0f]];
 
             NSTableColumn *tableColumn = [[NSTableColumn alloc] initWithIdentifier:@"node"];
             [tableColumn setHeaderCell:headerCell];
@@ -973,8 +973,8 @@ static NSMapTable *lastChildIgnoringWhitespaceCache = NULL;
     if (outlineView == _private->treeOutlineView && node) {
         NSShadow *shadow = [[NSShadow alloc] init];
         [shadow setShadowColor:[NSColor blackColor]];
-        [shadow setShadowBlurRadius:2.0];
-        [shadow setShadowOffset:NSMakeSize(2.0,-2.0)];
+        [shadow setShadowBlurRadius:2.0f];
+        [shadow setShadowOffset:NSMakeSize(2.0f, -2.0f)];
         NSMutableParagraphStyle *para = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
         [para setLineBreakMode:NSLineBreakByTruncatingTail];
         
@@ -983,7 +983,7 @@ static NSMapTable *lastChildIgnoringWhitespaceCache = NULL;
         [attrs release];
 
         if ([node hasChildNodes] && ![outlineView isItemExpanded:node]) {
-            attrs = [[NSDictionary alloc] initWithObjectsAndKeys:[NSColor colorWithCalibratedRed:1.0 green:1.0 blue:1.0 alpha:0.5], NSForegroundColorAttributeName, shadow, NSShadowAttributeName, para, NSParagraphStyleAttributeName, nil];
+            attrs = [[NSDictionary alloc] initWithObjectsAndKeys:[NSColor colorWithCalibratedRed:1.0f green:1.0f blue:1.0f alpha:0.5f], NSForegroundColorAttributeName, shadow, NSShadowAttributeName, para, NSParagraphStyleAttributeName, nil];
             NSAttributedString *preview = [[NSAttributedString alloc] initWithString:[node _contentPreview] attributes:attrs];
             [string appendAttributedString:preview];
             [attrs release];
index a9d8745..bd75d13 100644 (file)
@@ -43,8 +43,8 @@
 - (void)_highlightRow:(int)row clipRect:(NSRect)clip {
     NSColor *selectionColor = nil;
     if ([[self window] firstResponder] == self && [[self window] isKeyWindow])
-        selectionColor = [[NSColor alternateSelectedControlColor] colorWithAlphaComponent:0.333];
-    selectionColor = [[NSColor alternateSelectedControlColor] colorWithAlphaComponent:0.45];
+        selectionColor = [[NSColor alternateSelectedControlColor] colorWithAlphaComponent:0.333f];
+    selectionColor = [[NSColor alternateSelectedControlColor] colorWithAlphaComponent:0.45f];
 
     if ([self numberOfColumns] > 0) {
         NSRect highlight = [self rectOfRow:row];
             if ([NSGraphicsContext currentContextDrawingToScreen]) {
                 NSBezierPath *path = [[NSBezierPath alloc] init];
 
-                float radius = 6.0;
+                float radius = 6.0f;
                 NSRect irect = NSInsetRect(highlight, radius, radius);
                 if (!solid)
-                    irect = NSInsetRect(irect, 1.0, 1.0);
-                [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(irect), NSMinY(irect)) radius:radius startAngle:180. endAngle:270.];
-                [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(irect), NSMinY(irect)) radius:radius startAngle:270. endAngle:360.];
-                [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(irect), NSMaxY(irect)) radius:radius startAngle:0. endAngle:90.];
-                [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(irect), NSMaxY(irect)) radius:radius startAngle:90. endAngle:180.];
+                    irect = NSInsetRect(irect, 1.0f, 1.0f);
+                [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(irect), NSMinY(irect)) radius:radius startAngle:180.0f endAngle:270.0f];
+                [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(irect), NSMinY(irect)) radius:radius startAngle:270.0f endAngle:360.0f];
+                [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(irect), NSMaxY(irect)) radius:radius startAngle:0.0f endAngle:90.0f];
+                [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(irect), NSMaxY(irect)) radius:radius startAngle:90.0f endAngle:180.0f];
                 [path closePath];
 
                 NSRectClip(clip);
@@ -76,7 +76,7 @@
                 if (solid) {
                     [path fill];
                 } else {
-                    [path setLineWidth:2.0];
+                    [path setLineWidth:2.0f];
                     [path stroke];
                 }
 
index f9b50d9..a0e3578 100644 (file)
@@ -54,8 +54,8 @@ NSString *WebNodeHighlightExpiredNotification = @"WebNodeHighlightExpiredNotific
     }
 
     // adjust size and position for rect padding that the view adds
-    bounds.origin.y -= 3.0;
-    bounds.origin.x -= 3.0;
+    bounds.origin.y -= 3.0f;
+    bounds.origin.x -= 3.0f;
     bounds.size = [_webNodeHighlightView frame].size;
 
     NSRect windowBounds = [view convertRect:bounds toView:nil];
index 9affec1..4e8e6a4 100644 (file)
 {
     NSBezierPath *path = [[NSBezierPath alloc] init];
 
-    NSRect irect = NSInsetRect( rect, radius, radius );
-    [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(irect), NSMinY(irect)) radius:radius startAngle:180. endAngle:270.];
-    [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(irect), NSMinY(irect)) radius:radius startAngle:270. endAngle:360.];
-    [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(irect), NSMaxY(irect)) radius:radius startAngle:0. endAngle:90.];
-    [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(irect), NSMaxY(irect)) radius:radius startAngle:90. endAngle:180.];
+    NSRect irect = NSInsetRect(rect, radius, radius);
+    [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(irect), NSMinY(irect)) radius:radius startAngle:180.0f endAngle:270.0f];
+    [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(irect), NSMinY(irect)) radius:radius startAngle:270.0f endAngle:360.0f];
+    [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(irect), NSMaxY(irect)) radius:radius startAngle:0.0f endAngle:90.0f];
+    [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(irect), NSMaxY(irect)) radius:radius startAngle:90.0f endAngle:180.0f];
     [path closePath];
 
     return [path autorelease];
 
     if([rects count] == 1) {
         NSValue *value = (NSValue *)[rects objectAtIndex:0];
-        rect = NSInsetRect([value rectValue], -1.0, -1.0);
+        rect = NSInsetRect([value rectValue], -1.0f, -1.0f);
         rect = NSIntersectionRect(rect, visibleRect);
         if (!NSIsEmptyRect(rect))
-            path = [[self roundedRect:rect withRadius:3.0] retain];
+            path = [[self roundedRect:rect withRadius:3.0f] retain];
 
         // shift everything to the corner
         NSAffineTransform *transform = [[NSAffineTransform alloc] init];
-        [transform translateXBy:(NSMinX(rect) * -1.0) + 2.5 yBy:(NSMinY(rect) * -1.0) + 2.5];
+        [transform translateXBy:(NSMinX(rect) * -1.0f) + 2.5f yBy:(NSMinY(rect) * -1.0f) + 2.5f];
         [path transformUsingAffineTransform:transform];
         [straightPath transformUsingAffineTransform:transform];
         [transform release];
@@ -84,7 +84,7 @@
             rect = NSIntersectionRect([value rectValue], visibleRect);
             if (!NSIsEmptyRect(rect)) {
                 [straightPath appendBezierPathWithRect:rect];
-                [path appendBezierPath:[self roundedRect:rect withRadius:3.0]];
+                [path appendBezierPath:[self roundedRect:rect withRadius:3.0f]];
             }
         }
 
 
         // multiple rects we get from WebCore need flipped to show up correctly
         NSAffineTransform *transform = [[NSAffineTransform alloc] init];
-        [transform scaleXBy:1.0 yBy:-1.0];
+        [transform scaleXBy:1.0f yBy:-1.0f];
         [path transformUsingAffineTransform:transform];
         [straightPath transformUsingAffineTransform:transform];
         [transform release];
 
         // shift everything to the corner
         transform = [[NSAffineTransform alloc] init];
-        [transform translateXBy:(NSMinX(rect) * -1.0) + 2.5 yBy:NSMaxY(rect) + 2.5];
+        [transform translateXBy:(NSMinX(rect) * -1.0f) + 2.5f yBy:NSMaxY(rect) + 2.5f];
         [path transformUsingAffineTransform:transform];
         [straightPath transformUsingAffineTransform:transform];
         [transform release];
 
     // make the drawing area larger for the focus ring blur
     rect = [path bounds];
-    rect.size.width += 5.0;
-    rect.size.height += 5.0;
+    rect.size.width += 5.0f;
+    rect.size.height += 5.0f;
     [self setFrameSize:rect.size];
 
     // draw into an image
 
     if (straightPath) {
         [[NSColor redColor] set];
-        [path setLineWidth:4.0];
+        [path setLineWidth:4.0f];
         [path stroke];
 
         // clear the center to eliminate thick inner strokes for overlapping rects
 
         // stroke the straight line path with a light color to show any inner rects
         [[NSGraphicsContext currentContext] setCompositingOperation:NSCompositeDestinationOver];
-        [[[NSColor redColor] colorWithAlphaComponent:0.6] set];
-        [straightPath setLineWidth:1.0];
+        [[[NSColor redColor] colorWithAlphaComponent:0.6f] set];
+        [straightPath setLineWidth:1.0f];
         [straightPath stroke];
     } else {
         [[NSColor redColor] set];
-        [path setLineWidth:2.0];
+        [path setLineWidth:2.0f];
         [path stroke];
     }
 
     else if (alpha < 0.0)
         alpha = 0.0;
 
-    [_highlightRingImage drawInRect:rect fromRect:rect operation:NSCompositeCopy fraction:alpha];
+    [_highlightRingImage drawInRect:rect fromRect:rect operation:NSCompositeCopy fraction:(float)alpha];
 }
 @end
index 364fa49..e887ab3 100644 (file)
@@ -902,7 +902,7 @@ static inline WebFrame *Frame(WebCoreFrameBridge *bridge)
             id identifier;
             NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[response URL]];
             [self _requestFromDelegateForRequest:request identifier:&identifier error:&error];
-            [self _sendRemainingDelegateMessagesWithIdentifier:identifier response:response length:[response expectedContentLength] error:error];
+            [self _sendRemainingDelegateMessagesWithIdentifier:identifier response:response length:(unsigned)[response expectedContentLength] error:error];
             [request release];
         }
         
index 55c8e57..e5106b7 100644 (file)
@@ -333,14 +333,14 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class class,
     
     _private = [[WebFrameViewPrivate alloc] init];
 
-    WebDynamicScrollBarsView *scrollView  = [[WebDynamicScrollBarsView alloc] initWithFrame:NSMakeRect(0,0,frame.size.width,frame.size.height)];
+    WebDynamicScrollBarsView *scrollView  = [[WebDynamicScrollBarsView alloc] initWithFrame:NSMakeRect(0.0f, 0.0f, frame.size.width, frame.size.height)];
     _private->frameScrollView = scrollView;
     [scrollView setContentView:[[[WebClipView alloc] initWithFrame:[scrollView bounds]] autorelease]];
     [scrollView setDrawsBackground:NO];
     [scrollView setHasVerticalScroller:NO];
     [scrollView setHasHorizontalScroller:NO];
     [scrollView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
-    [scrollView setLineScroll:40.0];
+    [scrollView setLineScroll:40.0f];
     [self addSubview:scrollView];
     // don't call our overridden version here; we need to make the standard NSView link between us
     // and our subview so that previousKeyView and previousValidKeyView work as expected. This works
index 47d2de8..f52cd7b 100644 (file)
@@ -121,26 +121,26 @@ void _NSResetKillRingOperationFlag(void);
 // print in IE and Camino. This lets them use fewer sheets than they
 // would otherwise, which is presumably why other browsers do this.
 // Wide pages will be scaled down more than this.
-#define PrintingMinimumShrinkFactor     1.25
+#define PrintingMinimumShrinkFactor     1.25f
 
 // This number determines how small we are willing to reduce the page content
 // in order to accommodate the widest line. If the page would have to be
 // reduced smaller to make the widest line fit, we just clip instead (this
 // behavior matches MacIE and Mozilla, at least)
-#define PrintingMaximumShrinkFactor     2.0
+#define PrintingMaximumShrinkFactor     2.0f
 
-#define AUTOSCROLL_INTERVAL             0.1
+#define AUTOSCROLL_INTERVAL             0.1f
 
-#define DRAG_LABEL_BORDER_X             4.0
-#define DRAG_LABEL_BORDER_Y             2.0
-#define DRAG_LABEL_RADIUS               5.0
-#define DRAG_LABEL_BORDER_Y_OFFSET              2.0
+#define DRAG_LABEL_BORDER_X             4.0f
+#define DRAG_LABEL_BORDER_Y             2.0f
+#define DRAG_LABEL_RADIUS               5.0f
+#define DRAG_LABEL_BORDER_Y_OFFSET              2.0f
 
-#define MIN_DRAG_LABEL_WIDTH_BEFORE_CLIP        120.0
-#define MAX_DRAG_LABEL_WIDTH                    320.0
+#define MIN_DRAG_LABEL_WIDTH_BEFORE_CLIP        120.0f
+#define MAX_DRAG_LABEL_WIDTH                    320.0f
 
-#define DRAG_LINK_LABEL_FONT_SIZE   11.0
-#define DRAG_LINK_URL_FONT_SIZE   10.0
+#define DRAG_LINK_LABEL_FONT_SIZE   11.0f
+#define DRAG_LINK_URL_FONT_SIZE   10.0f
 
 // Any non-zero value will do, but using something recognizable might help us debug some day.
 #define TRACKING_RECT_TAG 0xBADFACE
@@ -1247,48 +1247,48 @@ static WebHTMLView *lastHitView = nil;
     }
     
     NSSize imageSize, urlStringSize;
-    imageSize.width = labelSize.width + DRAG_LABEL_BORDER_X * 2;
-    imageSize.height = labelSize.height + DRAG_LABEL_BORDER_Y * 2;
+    imageSize.width = labelSize.width + DRAG_LABEL_BORDER_X * 2.0f;
+    imageSize.height = labelSize.height + DRAG_LABEL_BORDER_Y * 2.0f;
     if (drawURLString) {
         urlStringSize.width = [urlString _web_widthWithFont: urlFont];
         urlStringSize.height = [urlFont ascender] - [urlFont descender];
         imageSize.height += urlStringSize.height;
         if (urlStringSize.width > MAX_DRAG_LABEL_WIDTH) {
-            imageSize.width = MAX(MAX_DRAG_LABEL_WIDTH + DRAG_LABEL_BORDER_X * 2, MIN_DRAG_LABEL_WIDTH_BEFORE_CLIP);
+            imageSize.width = MAX(MAX_DRAG_LABEL_WIDTH + DRAG_LABEL_BORDER_X * 2.0f, MIN_DRAG_LABEL_WIDTH_BEFORE_CLIP);
             clipURLString = YES;
         } else {
-            imageSize.width = MAX(labelSize.width + DRAG_LABEL_BORDER_X * 2, urlStringSize.width + DRAG_LABEL_BORDER_X * 2);
+            imageSize.width = MAX(labelSize.width + DRAG_LABEL_BORDER_X * 2.0f, urlStringSize.width + DRAG_LABEL_BORDER_X * 2.0f);
         }
     }
     NSImage *dragImage = [[[NSImage alloc] initWithSize: imageSize] autorelease];
     [dragImage lockFocus];
     
-    [[NSColor colorWithCalibratedRed: 0.7 green: 0.7 blue: 0.7 alpha: 0.8] set];
+    [[NSColor colorWithCalibratedRed: 0.7f green: 0.7f blue: 0.7f alpha: 0.8f] set];
     
     // Drag a rectangle with rounded corners/
     NSBezierPath *path = [NSBezierPath bezierPath];
-    [path appendBezierPathWithOvalInRect: NSMakeRect(0,0, DRAG_LABEL_RADIUS * 2, DRAG_LABEL_RADIUS * 2)];
-    [path appendBezierPathWithOvalInRect: NSMakeRect(0,imageSize.height - DRAG_LABEL_RADIUS * 2, DRAG_LABEL_RADIUS * 2, DRAG_LABEL_RADIUS * 2)];
-    [path appendBezierPathWithOvalInRect: NSMakeRect(imageSize.width - DRAG_LABEL_RADIUS * 2, imageSize.height - DRAG_LABEL_RADIUS * 2, DRAG_LABEL_RADIUS * 2, DRAG_LABEL_RADIUS * 2)];
-    [path appendBezierPathWithOvalInRect: NSMakeRect(imageSize.width - DRAG_LABEL_RADIUS * 2,0, DRAG_LABEL_RADIUS * 2, DRAG_LABEL_RADIUS * 2)];
+    [path appendBezierPathWithOvalInRect: NSMakeRect(0.0f, 0.0f, DRAG_LABEL_RADIUS * 2.0f, DRAG_LABEL_RADIUS * 2.0f)];
+    [path appendBezierPathWithOvalInRect: NSMakeRect(0, imageSize.height - DRAG_LABEL_RADIUS * 2.0f, DRAG_LABEL_RADIUS * 2.0f, DRAG_LABEL_RADIUS * 2.0f)];
+    [path appendBezierPathWithOvalInRect: NSMakeRect(imageSize.width - DRAG_LABEL_RADIUS * 2.0f, imageSize.height - DRAG_LABEL_RADIUS * 2.0f, DRAG_LABEL_RADIUS * 2.0f, DRAG_LABEL_RADIUS * 2.0f)];
+    [path appendBezierPathWithOvalInRect: NSMakeRect(imageSize.width - DRAG_LABEL_RADIUS * 2.0f, 0.0f, DRAG_LABEL_RADIUS * 2.0f, DRAG_LABEL_RADIUS * 2.0f)];
     
-    [path appendBezierPathWithRect: NSMakeRect(DRAG_LABEL_RADIUS, 0, imageSize.width - DRAG_LABEL_RADIUS * 2, imageSize.height)];
-    [path appendBezierPathWithRect: NSMakeRect(0, DRAG_LABEL_RADIUS, DRAG_LABEL_RADIUS + 10, imageSize.height - 2 * DRAG_LABEL_RADIUS)];
-    [path appendBezierPathWithRect: NSMakeRect(imageSize.width - DRAG_LABEL_RADIUS - 20,DRAG_LABEL_RADIUS, DRAG_LABEL_RADIUS + 20, imageSize.height - 2 * DRAG_LABEL_RADIUS)];
+    [path appendBezierPathWithRect: NSMakeRect(DRAG_LABEL_RADIUS, 0.0f, imageSize.width - DRAG_LABEL_RADIUS * 2.0f, imageSize.height)];
+    [path appendBezierPathWithRect: NSMakeRect(0.0f, DRAG_LABEL_RADIUS, DRAG_LABEL_RADIUS + 10.0f, imageSize.height - 2.0f * DRAG_LABEL_RADIUS)];
+    [path appendBezierPathWithRect: NSMakeRect(imageSize.width - DRAG_LABEL_RADIUS - 20.0f, DRAG_LABEL_RADIUS, DRAG_LABEL_RADIUS + 20.0f, imageSize.height - 2.0f * DRAG_LABEL_RADIUS)];
     [path fill];
         
-    NSColor *topColor = [NSColor colorWithCalibratedWhite:0.0 alpha:0.75];
-    NSColor *bottomColor = [NSColor colorWithCalibratedWhite:1.0 alpha:0.5];
+    NSColor *topColor = [NSColor colorWithCalibratedWhite:0.0f alpha:0.75f];
+    NSColor *bottomColor = [NSColor colorWithCalibratedWhite:1.0f alpha:0.5f];
     if (drawURLString) {
         if (clipURLString)
-            urlString = [WebStringTruncator centerTruncateString: urlString toWidth:imageSize.width - (DRAG_LABEL_BORDER_X * 2) withFont:urlFont];
+            urlString = [WebStringTruncator centerTruncateString: urlString toWidth:imageSize.width - (DRAG_LABEL_BORDER_X * 2.0f) withFont:urlFont];
 
         [urlString _web_drawDoubledAtPoint:NSMakePoint(DRAG_LABEL_BORDER_X, DRAG_LABEL_BORDER_Y - [urlFont descender]) 
              withTopColor:topColor bottomColor:bottomColor font:urlFont];
     }
 
     if (clipLabelString)
-        label = [WebStringTruncator rightTruncateString: label toWidth:imageSize.width - (DRAG_LABEL_BORDER_X * 2) withFont:labelFont];
+        label = [WebStringTruncator rightTruncateString: label toWidth:imageSize.width - (DRAG_LABEL_BORDER_X * 2.0f) withFont:labelFont];
     [label _web_drawDoubledAtPoint:NSMakePoint (DRAG_LABEL_BORDER_X, imageSize.height - DRAG_LABEL_BORDER_Y_OFFSET - [labelFont pointSize])
              withTopColor:topColor bottomColor:bottomColor font:labelFont];
     
@@ -1497,13 +1497,13 @@ static WebHTMLView *lastHitView = nil;
 
 - (void)_web_setPrintingModeRecursive
 {
-    [self _setPrinting:YES minimumPageWidth:0.0 maximumPageWidth:0.0 adjustViewSize:NO];
+    [self _setPrinting:YES minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:NO];
     [super _web_setPrintingModeRecursive];
 }
 
 - (void)_web_clearPrintingModeRecursive
 {
-    [self _setPrinting:NO minimumPageWidth:0.0 maximumPageWidth:0.0 adjustViewSize:NO];
+    [self _setPrinting:NO minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:NO];
     [super _web_clearPrintingModeRecursive];
 }
 
@@ -2519,7 +2519,7 @@ static WebHTMLView *lastHitView = nil;
 
 - (void)layout
 {
-    [self layoutToMinimumPageWidth:0.0 maximumPageWidth:0.0 adjustingViewSize:NO];
+    [self layoutToMinimumPageWidth:0.0f maximumPageWidth:0.0f adjustingViewSize:NO];
 }
 
 - (NSMenu *)menuForEvent:(NSEvent *)event
@@ -3056,7 +3056,7 @@ done:
         WebFrame *subframe = [subframes objectAtIndex:i];
         WebFrameView *frameView = [subframe frameView];
         if ([[subframe dataSource] _isDocumentHTML]) {
-            [(WebHTMLView *)[frameView documentView] _setPrinting:printing minimumPageWidth:0.0 maximumPageWidth:0.0 adjustViewSize:adjustViewSize];
+            [(WebHTMLView *)[frameView documentView] _setPrinting:printing minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:adjustViewSize];
         }
     }
 
@@ -3087,12 +3087,12 @@ done:
     // If the WebHTMLView itself is what we're printing, then we will never have to do this.
     BOOL wasInPrintingMode = _private->printing;
     if (!wasInPrintingMode)
-        [self _setPrinting:YES minimumPageWidth:0.0 maximumPageWidth:0.0 adjustViewSize:NO];
+        [self _setPrinting:YES minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:NO];
 
     [[self _bridge] adjustPageHeightNew:newBottom top:oldTop bottom:oldBottom limit:bottomLimit];
     
     if (!wasInPrintingMode)
-        [self _setPrinting:NO minimumPageWidth:0.0 maximumPageWidth:0.0 adjustViewSize:NO];
+        [self _setPrinting:NO minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:NO];
 }
 
 - (float)_availablePaperWidthForPrintOperation:(NSPrintOperation *)printOperation
@@ -3106,11 +3106,11 @@ done:
     float viewWidth = NSWidth([self bounds]);
     if (viewWidth < 1) {
         LOG_ERROR("%@ has no width when printing", self);
-        return 1.0;
+        return 1.0f;
     }
 
     float userScaleFactor = [printOperation _web_pageSetupScaleFactor];
-    float maxShrinkToFitScaleFactor = 1/PrintingMaximumShrinkFactor;
+    float maxShrinkToFitScaleFactor = 1.0f / PrintingMaximumShrinkFactor;
     float shrinkToFitScaleFactor = [self _availablePaperWidthForPrintOperation:printOperation]/viewWidth;
     return userScaleFactor * MAX(maxShrinkToFitScaleFactor, shrinkToFitScaleFactor);
 }
@@ -3126,13 +3126,13 @@ done:
 // This is used for Carbon printing. At some point we might want to make this public API.
 - (void)setPageWidthForPrinting:(float)pageWidth
 {
-    [self _setPrinting:NO minimumPageWidth:0. maximumPageWidth:0. adjustViewSize:NO];
+    [self _setPrinting:NO minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:NO];
     [self _setPrinting:YES minimumPageWidth:pageWidth maximumPageWidth:pageWidth adjustViewSize:YES];
 }
 
 - (void)_endPrintMode
 {
-    [self _setPrinting:NO minimumPageWidth:0.0 maximumPageWidth:0.0 adjustViewSize:YES];
+    [self _setPrinting:NO minimumPageWidth:0.0f maximumPageWidth:0.0f adjustViewSize:YES];
     [[self window] setAutodisplay:YES];
 }
 
@@ -3172,12 +3172,12 @@ done:
     
     // If we are a frameset just print with the layout we have onscreen, otherwise relayout
     // according to the paper size
-    float minLayoutWidth = 0.0;
-    float maxLayoutWidth = 0.0;
+    float minLayoutWidth = 0.0f;
+    float maxLayoutWidth = 0.0f;
     if (![[self _bridge] isFrameSet]) {
         float paperWidth = [self _availablePaperWidthForPrintOperation:[NSPrintOperation currentOperation]];
-        minLayoutWidth = paperWidth*PrintingMinimumShrinkFactor;
-        maxLayoutWidth = paperWidth*PrintingMaximumShrinkFactor;
+        minLayoutWidth = paperWidth * PrintingMinimumShrinkFactor;
+        maxLayoutWidth = paperWidth * PrintingMaximumShrinkFactor;
     }
     [self _setPrinting:YES minimumPageWidth:minLayoutWidth maximumPageWidth:maxLayoutWidth adjustViewSize:YES]; // will relayout
     NSPrintOperation *printOperation = [NSPrintOperation currentOperation];
@@ -3926,12 +3926,12 @@ done:
 
 - (NSFont *)_originalFontA
 {
-    return [[NSFontManager sharedFontManager] fontWithFamily:@"Helvetica" traits:0 weight:STANDARD_WEIGHT size:10];
+    return [[NSFontManager sharedFontManager] fontWithFamily:@"Helvetica" traits:0 weight:STANDARD_WEIGHT size:10.0f];
 }
 
 - (NSFont *)_originalFontB
 {
-    return [[NSFontManager sharedFontManager] fontWithFamily:@"Times" traits:(NSBoldFontMask | NSItalicFontMask) weight:STANDARD_BOLD_WEIGHT size:12];
+    return [[NSFontManager sharedFontManager] fontWithFamily:@"Times" traits:(NSBoldFontMask | NSItalicFontMask) weight:STANDARD_BOLD_WEIGHT size:12.0f];
 }
 
 - (void)_addToStyle:(DOMCSSStyleDeclaration *)style fontA:(NSFont *)a fontB:(NSFont *)b
@@ -5329,7 +5329,7 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
     [_tableView release];
     
     _popupWindow = [[NSWindow alloc] initWithContentRect:scrollFrame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
-    [_popupWindow setAlphaValue:0.88];
+    [_popupWindow setAlphaValue:0.88f];
     [_popupWindow setContentView:scrollView];
     [scrollView release];
     [_popupWindow setHasShadow:YES];
@@ -5351,12 +5351,12 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
     windowFrame.origin = [[_view window] convertBaseToScreen:[_view convertPoint:wordStart toView:nil]];
     windowFrame.size.height = numberToShow * [_tableView rowHeight] + (numberToShow + 1) * [_tableView intercellSpacing].height;
     windowFrame.origin.y -= windowFrame.size.height;
-    NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSFont systemFontOfSize:12.0], NSFontAttributeName, nil];
-    float maxWidth = 0.0;
+    NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSFont systemFontOfSize:12.0f], NSFontAttributeName, nil];
+    float maxWidth = 0.0f;
     int maxIndex = -1;
     int i;
     for (i = 0; i < numberToShow; i++) {
-        float width = ceil([[_completions objectAtIndex:i] sizeWithAttributes:attributes].width);
+        float width = ceilf([[_completions objectAtIndex:i] sizeWithAttributes:attributes].width);
         if (width > maxWidth) {
             maxWidth = width;
             maxIndex = i;
@@ -5364,11 +5364,11 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
     }
     windowFrame.size.width = 100;
     if (maxIndex >= 0) {
-        maxWidth = ceil([NSScrollView frameSizeForContentSize:NSMakeSize(maxWidth, 100) hasHorizontalScroller:NO hasVerticalScroller:YES borderType:NSNoBorder].width);
-        maxWidth = ceil([NSWindow frameRectForContentRect:NSMakeRect(0, 0, maxWidth, 100) styleMask:NSBorderlessWindowMask].size.width);
-        maxWidth += 5.0;
+        maxWidth = ceilf([NSScrollView frameSizeForContentSize:NSMakeSize(maxWidth, 100.0f) hasHorizontalScroller:NO hasVerticalScroller:YES borderType:NSNoBorder].width);
+        maxWidth = ceilf([NSWindow frameRectForContentRect:NSMakeRect(0.0f, 0.0f, maxWidth, 100.0f) styleMask:NSBorderlessWindowMask].size.width);
+        maxWidth += 5.0f;
         windowFrame.size.width = MAX(maxWidth, windowFrame.size.width);
-        maxWidth = MIN(400.0, windowFrame.size.width);
+        maxWidth = MIN(400.0f, windowFrame.size.width);
     }
     [_popupWindow setFrame:windowFrame display:NO];
     
index ea82c31..c21a714 100644 (file)
@@ -800,7 +800,7 @@ static BOOL PDFSelectionsAreEqual(PDFSelection *selectionA, PDFSelection *select
 
 - (IBAction)_makeTextStandardSize:(id)sender
 {
-    [PDFSubviewProxy setScaleFactor:1.0];
+    [PDFSubviewProxy setScaleFactor:1.0f];
 }
 
 - (BOOL)_tracksCommonSizeFactor
@@ -866,7 +866,7 @@ static BOOL PDFSelectionsAreEqual(PDFSelection *selectionA, PDFSelection *select
     [attributedString removeAttribute:NSBackgroundColorAttributeName range:wholeStringRange];
     [attributedString removeAttribute:NSUnderlineStyleAttributeName range:wholeStringRange];
     if (forceWhiteText)
-        [attributedString addAttribute:NSForegroundColorAttributeName value:[NSColor colorWithDeviceWhite:1.0 alpha:1.0] range:wholeStringRange];
+        [attributedString addAttribute:NSForegroundColorAttributeName value:[NSColor colorWithDeviceWhite:1.0f alpha:1.0f] range:wholeStringRange];
     [attributedString endEditing];
     
     NSImage* selectionImage = [[[NSImage alloc] initWithSize:[self selectionImageRect].size] autorelease];
@@ -992,7 +992,7 @@ static BOOL PDFSelectionsAreEqual(PDFSelection *selectionA, PDFSelection *select
     [invocation invokeWithTarget:PDFSubview];
 
     WebPreferences *prefs = [[view->dataSource _webView] preferences];
-    float scaleFactor = [PDFSubview autoScales] ? 0.0 : [PDFSubview scaleFactor];
+    float scaleFactor = [PDFSubview autoScales] ? 0.0f : [PDFSubview scaleFactor];
     [prefs setPDFScaleFactor:scaleFactor];
     [prefs setPDFDisplayMode:[PDFSubview displayMode]];
 }
index f50ff99..56d4187 100644 (file)
@@ -298,7 +298,7 @@ NS_ENDHANDLER
 - (float)_floatValueForKey:(NSString *)key
 {
     id o = [self _valueForKey:key];
-    return [o respondsToSelector:@selector(floatValue)] ? [o floatValue] : 0.0;
+    return [o respondsToSelector:@selector(floatValue)] ? [o floatValue] : 0.0f;
 }
 
 - (void)_setFloatValue:(float)value forKey:(NSString *)key
index e17c64a..bc89ebb 100644 (file)
@@ -2663,9 +2663,9 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
     [[self mainFrame] reload];
 }
 
-#define MinimumTextSizeMultiplier       0.5
-#define MaximumTextSizeMultiplier       3.0
-#define TextSizeMultiplierRatio         1.2
+#define MinimumTextSizeMultiplier       0.5f
+#define MaximumTextSizeMultiplier       3.0f
+#define TextSizeMultiplierRatio         1.2f
 
 - (BOOL)canMakeTextSmaller
 {
@@ -2681,7 +2681,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
 
 - (IBAction)makeTextSmaller:(id)sender
 {
-    float newScale = _private->textSizeMultiplier/TextSizeMultiplierRatio;
+    float newScale = _private->textSizeMultiplier / TextSizeMultiplierRatio;
     BOOL canShrinkMore = newScale > MinimumTextSizeMultiplier;
     [self _performTextSizingSelector:@selector(_makeTextSmaller:) withObject:sender onTrackingDocs:canShrinkMore selForNonTrackingDocs:@selector(_canMakeTextSmaller) newScaleFactor:newScale];
 }
@@ -2717,14 +2717,14 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
 
 - (BOOL)canMakeTextStandardSize
 {
-    BOOL notAlreadyStandard = _private->textSizeMultiplier != 1.0;
-    return [self _performTextSizingSelector:(SEL)0 withObject:nil onTrackingDocs:notAlreadyStandard selForNonTrackingDocs:@selector(_canMakeTextStandardSize) newScaleFactor:0];
+    BOOL notAlreadyStandard = _private->textSizeMultiplier != 1.0f;
+    return [self _performTextSizingSelector:(SEL)0 withObject:nil onTrackingDocs:notAlreadyStandard selForNonTrackingDocs:@selector(_canMakeTextStandardSize) newScaleFactor:0.0f];
 }
 
 - (IBAction)makeTextStandardSize:(id)sender
 {
-    BOOL notAlreadyStandard = _private->textSizeMultiplier != 1.0;
-    [self _performTextSizingSelector:@selector(_makeTextStandardSize:) withObject:sender onTrackingDocs:notAlreadyStandard selForNonTrackingDocs:@selector(_canMakeTextStandardSize) newScaleFactor:1.0];
+    BOOL notAlreadyStandard = _private->textSizeMultiplier != 1.0f;
+    [self _performTextSizingSelector:@selector(_makeTextStandardSize:) withObject:sender onTrackingDocs:notAlreadyStandard selForNonTrackingDocs:@selector(_canMakeTextStandardSize) newScaleFactor:1.0f];
 }
 
 #define VALIDATE(name) \