Reviewed by Maciej.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Apr 2005 01:13:11 +0000 (01:13 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Apr 2005 01:13:11 +0000 (01:13 +0000)
        - fixed problems preventing us from compiling with gcc 4.0

        * WebKit.pbproj/project.pbxproj: Removed -fobjc-exceptions because I can't figure out an easy
        way to pass it only when compiling Objective-C/C++. Removed -Wmissing-prototypes from
        WARNING_CPLUSPLUSFLAGS since it's now a C-only warning.

        * History.subproj/WebHistoryItem.m: (-[WebHistoryItem pageCache]): Changed return type
        to match the declaration.
        * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge _retrieveKeyboardUIModeFromPreferences:]):
        Fixed a BOOL that should have been a Boolean.
        * WebCoreSupport.subproj/WebTextRenderer.m: Removed redundant copy of ROUND_TO_INT, also in
        a WebCore header.
        (-[WebTextRenderer _computeWidthForSpace]): Had to add cast because of difference in type of
        ROUND_TO_INT vs. CEIL_TO_INT.
        (pathFromFont): Added a cast to convert UInt8 * to char *.
        * WebView.subproj/WebFrameView.m:
        (-[WebFrameView _setDocumentView:]): Fixed parameter type to match the declaration.
        (-[WebFrameView documentView]): Fixed return type to match the declaration.
        * WebView.subproj/WebHTMLView.m:
        (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]):
        Initialized a variable to quiet an incorrect gcc 4.0 uninitialized variable warning.
        (-[WebHTMLView deleteToMark:]): Switched from @try style to NS_DURING style of exception handler
        because we can't pass -fobjc-exceptions just to Objective-C at the moment (see above).
        (-[WebHTMLView selectToMark:]): Ditto.
        (-[WebHTMLView swapWithMark:]): Ditto.

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

WebKit/ChangeLog
WebKit/History.subproj/WebHistoryItem.m
WebKit/WebCoreSupport.subproj/WebBridge.m
WebKit/WebCoreSupport.subproj/WebTextRenderer.m
WebKit/WebKit.pbproj/project.pbxproj
WebKit/WebView.subproj/WebFrameView.m
WebKit/WebView.subproj/WebHTMLView.m

index 506ecb3e360e9dd3d8489ef81f1e7cc09235106b..c82ab0086c8781d6f376d374e02a23fae430f4e1 100644 (file)
@@ -1,3 +1,33 @@
+2005-04-28  Darin Adler  <darin@apple.com>
+
+        Reviewed by Maciej.
+
+        - fixed problems preventing us from compiling with gcc 4.0
+
+        * WebKit.pbproj/project.pbxproj: Removed -fobjc-exceptions because I can't figure out an easy
+        way to pass it only when compiling Objective-C/C++. Removed -Wmissing-prototypes from
+        WARNING_CPLUSPLUSFLAGS since it's now a C-only warning.
+
+        * History.subproj/WebHistoryItem.m: (-[WebHistoryItem pageCache]): Changed return type
+        to match the declaration.
+        * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge _retrieveKeyboardUIModeFromPreferences:]):
+        Fixed a BOOL that should have been a Boolean.
+        * WebCoreSupport.subproj/WebTextRenderer.m: Removed redundant copy of ROUND_TO_INT, also in
+        a WebCore header.
+        (-[WebTextRenderer _computeWidthForSpace]): Had to add cast because of difference in type of
+        ROUND_TO_INT vs. CEIL_TO_INT.
+        (pathFromFont): Added a cast to convert UInt8 * to char *.
+        * WebView.subproj/WebFrameView.m:
+        (-[WebFrameView _setDocumentView:]): Fixed parameter type to match the declaration.
+        (-[WebFrameView documentView]): Fixed return type to match the declaration.
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]):
+        Initialized a variable to quiet an incorrect gcc 4.0 uninitialized variable warning.
+        (-[WebHTMLView deleteToMark:]): Switched from @try style to NS_DURING style of exception handler
+        because we can't pass -fobjc-exceptions just to Objective-C at the moment (see above).
+        (-[WebHTMLView selectToMark:]): Ditto.
+        (-[WebHTMLView swapWithMark:]): Ditto.
+
 2005-04-27  John Sullivan  <sullivan@apple.com>
 
         Reviewed by Dave Harrison.
index da0ea6806f4ae5f34989244da25c8c1709a37137..717e386c8a45932a181c3ca4bb64a01695e8d06b 100644 (file)
@@ -727,7 +727,7 @@ static NSTimer *_pageCacheReleaseTimer = nil;
     }
 }
 
-- pageCache
+- (NSMutableDictionary *)pageCache
 {
     return _private->pageCache;
 }
index 6c5fe553142c7398683a4365bac144bd2bf1cf33..c42508d5f05d609a5f301af730985f2b550c472d 100644 (file)
@@ -1268,7 +1268,7 @@ static id <WebFormDelegate> formDelegate(WebBridge *self)
 {
     CFPreferencesAppSynchronize(UniversalAccessDomain);
 
-    BOOL keyExistsAndHasValidFormat;
+    Boolean keyExistsAndHasValidFormat;
     int mode = CFPreferencesGetAppIntegerValue(AppleKeyboardUIMode, UniversalAccessDomain, &keyExistsAndHasValidFormat);
     
     // The keyboard access mode is reported by two bits:
index eb1c9f0bccb971bd62c06ed92ea70afcff567ec3..609eeb791b7f6d8a311fb5d0fb76ba074b690355 100644 (file)
@@ -49,8 +49,6 @@
 #define NO_BREAK_SPACE 0x00A0
 #define ZERO_WIDTH_SPACE 0x200B
 
-#define ROUND_TO_INT(x) (int)((x)+.5)
-
 // Lose precision beyond 1000ths place. This is to work around an apparent
 // bug in CoreGraphics where there seem to be small errors to some metrics.
 #define CEIL_TO_INT(x) ((int)(x + 0.999)) /* ((int)(x + 1.0 - FLT_EPSILON)) */
@@ -876,7 +874,7 @@ static inline BOOL fontContainsString(NSFont *font, NSString *string)
     spaceWidth = width;
 
     treatAsFixedPitch = [[WebTextRendererFactory sharedFactory] isFontFixedPitch:font];
-    adjustedSpaceWidth = treatAsFixedPitch ? CEIL_TO_INT(width) : ROUND_TO_INT(width);
+    adjustedSpaceWidth = treatAsFixedPitch ? CEIL_TO_INT(width) : (int)ROUND_TO_INT(width);
     
     return YES;
 }
@@ -925,7 +923,7 @@ static NSString *pathFromFont (NSFont *font)
         if (err == noErr){
             status = FSRefMakePath(&fileRef,_filePathBuffer, PATH_MAX);
             if (status == noErr){
-                filePath = [NSString stringWithUTF8String:&_filePathBuffer[0]];
+                filePath = [NSString stringWithUTF8String:(const char *)&_filePathBuffer[0]];
             }
         }
     }
index b9cf04f0d3f061ac3d014f341037ee391c028d75..1a348818ee91948d8e92200eef43cbd9b984b3a3 100644 (file)
                                LOCAL_SEG1_ADDR = 0x7000000;
                                MACOSX_DEPLOYMENT_TARGET = 10.3;
                                OPTIMIZATION_CFLAGS = "-Os";
-                               OTHER_CFLAGS = "$(DEBUG_CFLAGS) -DFRAMEWORK_NAME=WebKit -fobjc-exceptions";
+                               OTHER_CFLAGS = "$(DEBUG_CFLAGS) -DFRAMEWORK_NAME=WebKit";
                                OTHER_LDFLAGS = "$(COMMON_LDFLAGS) -sub_umbrella WebCore -sub_umbrella JavaScriptCore";
                                PRECOMPILE_PREFIX_HEADER = YES;
                                PREFIX_HEADER = WebKitPrefix.h;
                                TIGER_FRAMEWORKS_LDFLAGS = "-framework \"`if [ -f /usr/local/SecurityPieces/Frameworks/security_cdsa_utils.framework/security_cdsa_utils ]; then echo \\\"security_cdsa_utils\\\"; else echo \\\"System\\\"; fi`\"";
                                USE_GCC3_PFE_SUPPORT = YES;
                                WARNING_CFLAGS = "-Werror -Wall -W -Wcast-align -Wchar-subscripts -Wformat-security -Wmissing-format-attribute -Wmissing-prototypes -Wpointer-arith -Wwrite-strings -Wno-format-y2k -Wno-unused-parameter -Wbad-function-cast -Wmissing-declarations -Wnested-externs";
-                               WARNING_CPLUSPLUSFLAGS = "-Werror -Wall -Wcast-align -Wchar-subscripts -Wformat-security -Wmissing-format-attribute -Wmissing-prototypes -Wpointer-arith -Wwrite-strings -Wno-format-y2k -Wno-unused-parameter";
+                               WARNING_CPLUSPLUSFLAGS = "-Werror -Wall -Wcast-align -Wchar-subscripts -Wformat-security -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings -Wno-format-y2k -Wno-unused-parameter";
                                WRAPPER_EXTENSION = framework;
                        };
                        dependencies = (
index 67e141c378d5c1a670b7acf4459dd692e53fa6bc..04676b1ffdf2ea52c8023602e565c57b1de35689 100644 (file)
@@ -164,7 +164,7 @@ enum {
     return _private->marginHeight;
 }
 
-- (void)_setDocumentView:(NSView *)view
+- (void)_setDocumentView:(NSView <WebDocumentView> *)view
 {
     WebDynamicScrollBarsView *sv = (WebDynamicScrollBarsView *)[self _scrollView];
     
@@ -353,7 +353,7 @@ static NSMutableDictionary *viewTypes;
     return [(WebDynamicScrollBarsView *)[self _scrollView] allowsScrolling];
 }
 
-- documentView
+- (NSView <WebDocumentView> *)documentView
 {
     return [[self _scrollView] documentView];
 }
index 2d1a6765e228fb8a013d7a0fb13160a947a6296e..f54da76ecdb974a1615030f92e08b3cb8a153c89 100644 (file)
@@ -1198,7 +1198,7 @@ static WebHTMLView *lastHitView = nil;
     NSPoint mouseDraggedPoint = [self convertPoint:[mouseDraggedEvent locationInWindow] fromView:nil];
     _private->webCoreDragOp = op;     // will be DragNone if WebCore doesn't care
     NSImage *dragImage = nil;
-    NSPoint dragLoc;
+    NSPoint dragLoc = { 0, 0 }; // quiet gcc 4.0 warning
 
     // We allow WebCore to override the drag image, even if its a link, image or text we're dragging.
     // This is in the spirit of the IE API, which allows overriding of pasteboard data and DragOp.
@@ -4536,11 +4536,11 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
     } else {
         DOMRange *selection = [self _selectedRange];
         DOMRange *r;
-        @try {
+        NS_DURING
             r = unionDOMRanges(mark, selection);
-        } @catch (NSException *exception) {
+        NS_HANDLER
             r = selection;
-        }
+        NS_ENDHANDLER
         [self _deleteRange:r killRing:YES prepend:YES smartDeleteOK:NO deletionAction:deleteSelectionAction];
     }
     [self setMark:sender];
@@ -4555,11 +4555,11 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
         return;
     }
     DOMRange *selection = [self _selectedRange];
-    @try {
+    NS_DURING
         [bridge setSelectedDOMRange:unionDOMRanges(mark, selection) affinity:NSSelectionAffinityDownstream closeTyping:YES];
-    } @catch (NSException *exception) {
+    NS_HANDLER
         NSBeep();
-    }
+    NS_ENDHANDLER
 }
 
 - (void)swapWithMark:(id)sender
@@ -4571,12 +4571,12 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
         return;
     }
     DOMRange *selection = [self _selectedRange];
-    @try {
+    NS_DURING
         [bridge setSelectedDOMRange:mark affinity:NSSelectionAffinityDownstream closeTyping:YES];
-    } @catch (NSException *exception) {
+    NS_HANDLER
         NSBeep();
         return;
-    }
+    NS_ENDHANDLER
     [bridge setMarkDOMRange:selection];
 }