2007-01-31 Mark Rowe <mrowe@apple.com>
authorbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Jan 2007 07:26:13 +0000 (07:26 +0000)
committerbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Jan 2007 07:26:13 +0000 (07:26 +0000)
        Reviewed by Oliver.

        Enable -Wundef in WebKit, and change misuses of #if to #ifdef or #ifndef as appropriate.

        * Misc/WebKitLogging.h:
        * WebKit.xcodeproj/project.pbxproj:
        * WebView/WebFrame.mm:
        * WebView/WebFrameInternal.h:
        * WebView/WebHTMLView.mm:
        (-[WebHTMLView validateUserInterfaceItem:]):
        (-[WebHTMLView delete:]):
        (-[WebHTMLView showGuessPanel:]):
        (-[WebHTMLView copy:]):
        (-[WebHTMLView cut:]):
        (-[WebHTMLView paste:]):
        * WebView/WebHTMLViewInternal.h:
        * WebView/WebView.mm:
        (-[WebViewPrivate init]):
        (-[WebView validateUserInterfaceItem:]):
        * WebView/WebViewPrivate.h:

2007-01-31  Mark Rowe  <mrowe@apple.com>

        Reviewed by Oliver.

        * dom/Document.h: Change #if XSLT_SUPPORT to #ifdef XSLT_SUPPORT.

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

WebCore/ChangeLog
WebCore/dom/Document.h
WebKit/ChangeLog
WebKit/Misc/WebKitLogging.h
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/WebView/WebFrame.mm
WebKit/WebView/WebFrameInternal.h
WebKit/WebView/WebHTMLView.mm
WebKit/WebView/WebHTMLViewInternal.h
WebKit/WebView/WebView.mm
WebKit/WebView/WebViewPrivate.h

index 1c36719..7a788dd 100644 (file)
@@ -1,3 +1,9 @@
+2007-01-31  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Oliver.
+
+        * dom/Document.h: Change #if XSLT_SUPPORT to #ifdef XSLT_SUPPORT.
+
 2007-01-31  Lars Knoll <lars@trolltech.com>
 
         Fix the Qt build.
index b94e34f..a2ef21e 100644 (file)
@@ -575,7 +575,7 @@ public:
 
     int docID() const { return m_docID; }
 
-#if XSLT_SUPPORT
+#ifdef XSLT_SUPPORT
     void applyXSLTransform(ProcessingInstruction* pi);
     void setTransformSource(void* doc) { m_transformSource = doc; }
     const void* transformSource() { return m_transformSource; }
@@ -714,7 +714,7 @@ protected:
     double m_startTime;
     bool m_overMinimumLayoutThreshold;
     
-#if XSLT_SUPPORT
+#ifdef XSLT_SUPPORT
     void* m_transformSource;
     RefPtr<Document> m_transformSourceDocument;
 #endif
index 8a493c8..40fdd5b 100644 (file)
@@ -1,3 +1,26 @@
+2007-01-31  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Oliver.
+
+        Enable -Wundef in WebKit, and change misuses of #if to #ifdef or #ifndef as appropriate.
+
+        * Misc/WebKitLogging.h:
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebView/WebFrame.mm:
+        * WebView/WebFrameInternal.h:
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView validateUserInterfaceItem:]):
+        (-[WebHTMLView delete:]):
+        (-[WebHTMLView showGuessPanel:]):
+        (-[WebHTMLView copy:]):
+        (-[WebHTMLView cut:]):
+        (-[WebHTMLView paste:]):
+        * WebView/WebHTMLViewInternal.h:
+        * WebView/WebView.mm:
+        (-[WebViewPrivate init]):
+        (-[WebView validateUserInterfaceItem:]):
+        * WebView/WebViewPrivate.h:
+
 2007-01-30  Brady Eidson  <beidson@apple.com>
 
         Reviewed by Oliver
index 7b9a453..4de0ca3 100644 (file)
@@ -66,7 +66,7 @@ BOOL WebKitRunningOnMainThread(void);
 
 // The ASSERT_MAIN_THREAD() check should be on by default in DEBUG builds
 // To disable it, even in a debug build, define DISABLE_THREAD_CHECK in your project file (or elsewhere globally)
-#if (!NDEBUG && !DISABLE_THREAD_CHECK)
+#if (!defined(NDEBUG) && !DISABLE_THREAD_CHECK)
 #define ASSERT_MAIN_THREAD() do \
     if (!WebKitRunningOnMainThread()) { \
         WTFReportAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, "<not running on main thread>"); \
index d84ea54..5ed35cd 100644 (file)
                                        "-Wwrite-strings",
                                        "-Wno-format-y2k",
                                        "-Wno-unused-parameter",
+                                       "-Wundef",
                                );
                        };
                        name = Debug;
                                        "-Wwrite-strings",
                                        "-Wno-format-y2k",
                                        "-Wno-unused-parameter",
+                                       "-Wundef",
                                );
                        };
                        name = Release;
                                        "-Wwrite-strings",
                                        "-Wno-format-y2k",
                                        "-Wno-unused-parameter",
+                                       "-Wundef",
                                );
                        };
                        name = Production;
index 5f756fa..aade982 100644 (file)
@@ -452,7 +452,7 @@ WebView *getWebView(WebFrame *webFrame)
     return _private->internalLoadDelegate;
 }
 
-#if !BUILDING_ON_TIGER
+#ifndef BUILDING_ON_TIGER
 - (void)_unmarkAllBadGrammar
 {
     Frame* coreFrame = core(self);
index d5eb4b9..656ced7 100644 (file)
@@ -117,7 +117,7 @@ struct WebCoreHistoryItem;
 - (void)_updateBackground;
 - (void)_setInternalLoadDelegate:(id)internalLoadDelegate;
 - (id)_internalLoadDelegate;
-#if !BUILDING_ON_TIGER
+#ifndef BUILDING_ON_TIGER
 - (void)_unmarkAllBadGrammar;
 #endif
 - (void)_unmarkAllMisspellings;
index c8464fd..8798e30 100644 (file)
@@ -2127,7 +2127,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
         return [self _canEdit];
     
     if (action == @selector(showGuessPanel:)) {
-#if !BUILDING_ON_TIGER
+#ifndef BUILDING_ON_TIGER
         // Match OS X AppKit behavior for post-Tiger. Don't change Tiger behavior.
         NSMenuItem *menuItem = (NSMenuItem *)item;
         if ([menuItem isKindOfClass:[NSMenuItem class]]) {
@@ -2263,7 +2263,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
         return [self _hasSelection];
     } 
     
-#if !BUILDING_ON_TIGER
+#ifndef BUILDING_ON_TIGER
     if (action == @selector(toggleGrammarChecking:)) {
         // FIXME 4799134: WebView is the bottleneck for this grammar-checking logic, but we must validate 
         // the selector here because we implement it here, and we must implement it here because the AppKit 
@@ -3761,7 +3761,7 @@ done:
 
 - (void)delete:(id)sender
 {
-#if USING_WEBCORE_DELETE
+#ifdef USING_WEBCORE_DELETE
     Frame* coreFrame = core([self _frame]);
     if (coreFrame)
         coreFrame->editor()->performDelete();
@@ -4471,7 +4471,7 @@ NSStrokeColorAttributeName        /* NSColor, default nil: same as foreground co
     }
     
     NSPanel *spellingPanel = [checker spellingPanel];
-#if !BUILDING_ON_TIGER
+#ifndef BUILDING_ON_TIGER
     // Post-Tiger, this menu item is a show/hide toggle, to match AppKit. Leave Tiger behavior alone
     // to match rest of OS X.
     if ([spellingPanel isVisible]) {
@@ -5060,7 +5060,7 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
 
 - (void)copy:(id)sender
 {
-#if USING_WEBCORE_COPY
+#ifdef USING_WEBCORE_COPY
     Frame* coreFrame = core([self _frame]);
     if (coreFrame)
         coreFrame->editor()->copy();
@@ -5078,7 +5078,7 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
 
 - (void)cut:(id)sender
 {
-#if USING_WEBCORE_CUT
+#ifdef USING_WEBCORE_CUT
     Frame* coreFrame = core([self _frame]);
     if (coreFrame)
         coreFrame->editor()->cut();
@@ -5101,7 +5101,7 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
 
 - (void)paste:(id)sender
 {
-#if USING_WEBCORE_PASTE
+#ifdef USING_WEBCORE_PASTE
     Frame* coreFrame = core([self _frame]);
     if (coreFrame)
         coreFrame->editor()->paste();
@@ -5137,7 +5137,7 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
     return [self _documentFragmentFromPasteboard:pasteboard inContext:nil allowPlainText:NO chosePlainText:&discard];
 }
 
-#if !BUILDING_ON_TIGER
+#ifndef BUILDING_ON_TIGER
 
 - (BOOL)isGrammarCheckingEnabled
 {
@@ -5160,9 +5160,7 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
     [[self _webView] toggleGrammarChecking:sender];
 }
 
-#endif /* !BUILDING_ON_TIGER */
 
-#if !BUILDING_ON_TIGER
 static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point)
 {
     NSRect allScreensFrame = NSZeroRect;
index ea0c57c..f2d3c3b 100644 (file)
@@ -116,7 +116,7 @@ struct WebHTMLViewInterpretKeyEventsParameters;
 - (void)_hoverFeedbackSuspendedChanged;
 - (BOOL)_interceptEditingKeyEvent:(WebCore::KeyboardEvent *)event;
 - (DOMDocumentFragment*)_documentFragmentFromPasteboard:(NSPasteboard *)pasteboard;
-#if !BUILDING_ON_TIGER
+#ifndef BUILDING_ON_TIGER
 - (BOOL)isGrammarCheckingEnabled;
 - (void)setGrammarCheckingEnabled:(BOOL)flag;
 - (void)toggleGrammarChecking:(id)sender;
index 62cb384..2089e28 100644 (file)
@@ -380,7 +380,7 @@ NSString *_WebMainFrameDocumentKey =    @"mainFrameDocument";
 @end
 
 static BOOL continuousSpellCheckingEnabled;
-#if !BUILDING_ON_TIGER
+#ifndef BUILDING_ON_TIGER
 static BOOL grammarCheckingEnabled;
 #endif
 
@@ -397,7 +397,7 @@ static BOOL grammarCheckingEnabled;
     dashboardBehaviorAllowWheelScrolling = YES;
     shouldCloseWithWindow = objc_collecting_enabled();
     continuousSpellCheckingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebContinuousSpellCheckingEnabled];
-#if !BUILDING_ON_TIGER
+#ifndef BUILDING_ON_TIGER
     grammarCheckingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebGrammarCheckingEnabled];
 #endif
     userAgent = new String;
@@ -2547,7 +2547,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
             [menuItem setState:checkMark ? NSOnState : NSOffState];
         }
         return retVal;
-#if !BUILDING_ON_TIGER
+#ifndef BUILDING_ON_TIGER
     } else if (action == @selector(toggleGrammarChecking:)) {
         BOOL checkMark = [self isGrammarCheckingEnabled];
         if ([(NSObject *)item isKindOfClass:[NSMenuItem class]]) {
@@ -3121,7 +3121,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
 #endif
 }
 
-#if !BUILDING_ON_TIGER
+#ifndef BUILDING_ON_TIGER
 // FIXME: This method should be merged into WebViewEditing when we're not in API freeze
 - (void)setGrammarCheckingEnabled:(BOOL)flag
 {
index 12c59a2..a0eb494 100644 (file)
@@ -365,7 +365,7 @@ Could be worth adding to the API.
 
 // FIXME: These two methods should be merged into WebViewEditing when we're not in API freeze
 - (BOOL)isGrammarCheckingEnabled;
-#if !BUILDING_ON_TIGER
+#ifndef BUILDING_ON_TIGER
 - (void)setGrammarCheckingEnabled:(BOOL)flag;
 
 // FIXME: This method should be merged into WebIBActions when we're not in API freeze