JavaScriptCore:
authorweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Aug 2006 21:55:57 +0000 (21:55 +0000)
committerweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Aug 2006 21:55:57 +0000 (21:55 +0000)
        Reviewed by Darin.

        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10176
          Make WebCore compile with -Wundef

          * Adds -Wundef flag to Xcode project
          * Converts #ifs to #ifdef and #ifndefs where needed.
          * Added #define YYMAXDEPTH 10000 in kjs/grammar.y
            to fix a warning from within Bison.

        * JavaScriptCore.xcodeproj/project.pbxproj:
        * bindings/jni/jni_jsobject.cpp:
        (JavaJSObject::getSlot):
        (JavaJSObject::setSlot):
        * bindings/npapi.h:
        * bindings/objc/objc_class.mm:
        (KJS::Bindings::ObjcClass::methodsNamed):
        (KJS::Bindings::ObjcClass::fieldNamed):
        * bindings/objc/objc_instance.mm:
        (ObjcInstance::invokeMethod):
        * bindings/objc/objc_runtime.mm:
        (ObjcMethod::getMethodSignature):
        (ObjcField::name):
        (ObjcField::type):
        * kjs/grammar.y:
        * kjs/identifier.h:

JavaScriptGlue:

        Reviewed by Darin.

        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10176
          Make WebCore compile with -Wundef

          * Adds -Wundef flag to Xcode project

        * JavaScriptGlue.xcodeproj/project.pbxproj:

WebCore:

        Reviewed by Darin.

        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10176
          Make WebCore compile with -Wundef

          * Adds -Wundef flag to Xcode project
          * Converts #ifs to #ifdef and #ifndefs where needed.
          * Replaces #ifdef WIN32 with #if PLATFORM(WIN_OS) or PLATFORM(WIN)
            (and in one instance in config.h with #if !COMPILER(MSVC))
          * Added #define YYMAXDEPTH 10000 in XPathGrammar.y and CSSGrammar.y
            to fix a warning from within Bison.
          * Cleaned up style a little in surrounding code.

        * WebCore.xcodeproj/project.pbxproj:
        * bridge/mac/WebCoreAXObject.mm:
        (-[WebCoreAXObject doAXTextMarkerRangeForUnorderedTextMarkers:]):
        * config.h:
        * css/CSSGrammar.y:
        * css/MediaFeatureNames.cpp:
        * css/MediaFeatureNames.h:
        * css/cssparser.cpp:
        * dom/ContainerNode.cpp:
        (WebCore::ContainerNode::setActive):
        * dom/Element.cpp:
        (WebCore::Element::attach):
        * dom/Element.h:
        * dom/EventNames.cpp:
        * dom/EventNames.h:
        * dom/NamedAttrMap.h:
        * dom/Position.cpp:
        * dom/QualifiedName.cpp:
        * dom/QualifiedName.h:
        * dom/Range.h:
        * dom/XMLTokenizer.cpp:
        (WebCore::XMLTokenizer::error):
        * html/HTMLTokenizer.cpp:
        (WebCore::HTMLTokenizer::scriptHandler):
        (WebCore::HTMLTokenizer::scriptExecution):
        (WebCore::HTMLTokenizer::parseTag):
        (WebCore::HTMLTokenizer::continueProcessing):
        (WebCore::HTMLTokenizer::write):
        (WebCore::HTMLTokenizer::timerFired):
        (WebCore::HTMLTokenizer::notifyFinished):
        * kcanvas/device/quartz/KCanvasFilterQuartz.h:
        * kcanvas/device/quartz/KRenderingDeviceQuartz.h:
        * ksvg2/css/SVGRenderStyle.h:
        * ksvg2/css/SVGRenderStyleDefs.h:
        * ksvg2/scripts/make_names.pl:
        * loader/CachedResource.h:
        * loader/LoaderFunctions.h:
        * loader/loader.h:
        * page/Frame.cpp:
        * page/FrameTree.cpp:
        * page/FrameView.cpp:
        (WebCore::FrameView::clear):
        (WebCore::FrameView::layout):
        (WebCore::FrameView::layoutTimerFired):
        (WebCore::FrameView::scheduleRelayout):
        (WebCore::FrameView::unscheduleRelayout):
        * platform/AtomicString.cpp:
        * platform/AtomicString.h:
        * platform/Cursor.h:
        * platform/DeprecatedArray.h:
        * platform/DeprecatedString.cpp:
        (WebCore::allocateHandle):
        (WebCore::initializeHandleNodeBlock):
        (WebCore::freeHandle):
        * platform/FloatPoint.h:
        * platform/FloatRect.h:
        * platform/FloatSize.h:
        * platform/GraphicsContext.h:
        * platform/Image.h:
        * platform/IntPoint.h:
        * platform/IntRect.h:
        (WebCore::IntRect::inflateX):
        (WebCore::IntRect::inflateY):
        * platform/IntSize.h:
        * platform/PlatformKeyboardEvent.h:
        * platform/PlatformMouseEvent.h:
        * platform/PlatformString.h:
        * platform/ResourceLoader.h:
        * platform/ResourceLoaderInternal.h:
        (WebCore::ResourceLoaderInternal::ResourceLoaderInternal):
        * platform/ScrollView.h:
        * platform/StaticConstructors.h:
        * platform/StreamingTextDecoderICU.cpp:
        (WebCore::StreamingTextDecoderICU::convert):
        * platform/StringImpl.h:
        * platform/Widget.h:
        * platform/mac/BlockExceptions.mm:
        * platform/mac/ColorMac.mm:
        (+[WebCoreControlTintObserver WebCore]):
        * platform/mac/FloatPointMac.mm:
        * platform/mac/FloatRectMac.mm:
        * platform/mac/FloatSizeMac.mm:
        * platform/mac/FontMac.mm:
        * platform/mac/GraphicsContextMac.mm:
        (WebCore::GraphicsContext::drawFocusRing):
        * platform/mac/IntPointMac.mm:
        * platform/mac/IntRectMac.mm:
        * platform/mac/IntSizeMac.mm:
        * platform/mac/WebCoreSystemInterface.h:
        * rendering/RenderBlock.h:
        * rendering/RenderTableCell.h:
        * rendering/bidi.cpp:
        (WebCore::appendRun):
        (WebCore::RenderBlock::layoutInlineChildren):
        * xml/XSLTProcessor.cpp:
        (WebCore::parseErrorFunc):
        * xpath/impl/XPathGrammar.y:

WebKit:

        Reviewed by Darin.

        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10176
          Make WebCore compile with -Wundef

          * Adds -Wundef flag to Xcode project
          * Converts #ifs to #ifdef and #ifndefs where needed.

        * Carbon/CarbonUtils.m:
        * Carbon/CarbonWindowAdapter.m:
        * Carbon/HIViewAdapter.m:
        (+[NSView bindHIViewToNSView:nsView:]):
        * Carbon/HIWebView.m:
        (HIWebViewEventHandler):
        * Misc/WebFileDatabase.m:
        (UniqueFilePathForKey):
        * Misc/WebNSWindowExtras.m:
        (swizzleInstanceMethod):
        * Misc/WebTypesInternal.h:
        * Plugins/WebNetscapeDeprecatedFunctions.c:
        * Plugins/WebNetscapeDeprecatedFunctions.h:
        * Plugins/WebNetscapePluginPackage.h:
        * Plugins/WebNetscapePluginPackage.m:
        (-[WebNetscapePluginPackage unloadWithoutShutdown]):
        (-[WebNetscapePluginPackage load]):
        * WebKit.xcodeproj/project.pbxproj:

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

94 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
JavaScriptCore/bindings/jni/jni_jsobject.cpp
JavaScriptCore/bindings/npapi.h
JavaScriptCore/bindings/objc/objc_class.mm
JavaScriptCore/bindings/objc/objc_instance.mm
JavaScriptCore/bindings/objc/objc_runtime.mm
JavaScriptCore/kjs/grammar.y
JavaScriptCore/kjs/identifier.h
JavaScriptGlue/ChangeLog
JavaScriptGlue/JavaScriptGlue.xcodeproj/project.pbxproj
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bridge/mac/WebCoreAXObject.mm
WebCore/config.h
WebCore/css/CSSGrammar.y
WebCore/css/MediaFeatureNames.cpp
WebCore/css/MediaFeatureNames.h
WebCore/css/cssparser.cpp
WebCore/dom/ContainerNode.cpp
WebCore/dom/Element.cpp
WebCore/dom/Element.h
WebCore/dom/EventNames.cpp
WebCore/dom/EventNames.h
WebCore/dom/NamedAttrMap.h
WebCore/dom/Position.cpp
WebCore/dom/QualifiedName.cpp
WebCore/dom/QualifiedName.h
WebCore/dom/Range.h
WebCore/dom/XMLTokenizer.cpp
WebCore/html/HTMLTokenizer.cpp
WebCore/kcanvas/device/quartz/KCanvasFilterQuartz.h
WebCore/kcanvas/device/quartz/KRenderingDeviceQuartz.h
WebCore/ksvg2/css/SVGRenderStyle.h
WebCore/ksvg2/css/SVGRenderStyleDefs.h
WebCore/ksvg2/scripts/make_names.pl
WebCore/loader/CachedResource.h
WebCore/loader/LoaderFunctions.h
WebCore/loader/loader.h
WebCore/page/Frame.cpp
WebCore/page/FrameTree.cpp
WebCore/page/FrameView.cpp
WebCore/platform/AtomicString.cpp
WebCore/platform/AtomicString.h
WebCore/platform/Cursor.h
WebCore/platform/DeprecatedArray.h
WebCore/platform/DeprecatedString.cpp
WebCore/platform/FloatPoint.h
WebCore/platform/FloatRect.h
WebCore/platform/FloatSize.h
WebCore/platform/GraphicsContext.h
WebCore/platform/Image.h
WebCore/platform/IntPoint.h
WebCore/platform/IntRect.h
WebCore/platform/IntSize.h
WebCore/platform/PlatformKeyboardEvent.h
WebCore/platform/PlatformMouseEvent.h
WebCore/platform/PlatformString.h
WebCore/platform/ResourceLoader.h
WebCore/platform/ResourceLoaderInternal.h
WebCore/platform/ScrollView.h
WebCore/platform/StaticConstructors.h
WebCore/platform/StreamingTextDecoderICU.cpp
WebCore/platform/StringImpl.h
WebCore/platform/Widget.h
WebCore/platform/mac/BlockExceptions.mm
WebCore/platform/mac/ColorMac.mm
WebCore/platform/mac/FloatPointMac.mm
WebCore/platform/mac/FloatRectMac.mm
WebCore/platform/mac/FloatSizeMac.mm
WebCore/platform/mac/FontMac.mm
WebCore/platform/mac/GraphicsContextMac.mm
WebCore/platform/mac/IntPointMac.mm
WebCore/platform/mac/IntRectMac.mm
WebCore/platform/mac/IntSizeMac.mm
WebCore/platform/mac/WebCoreSystemInterface.h
WebCore/rendering/RenderBlock.h
WebCore/rendering/RenderTableCell.h
WebCore/rendering/bidi.cpp
WebCore/xml/XSLTProcessor.cpp
WebCore/xpath/impl/XPathGrammar.y
WebKit/Carbon/CarbonUtils.m
WebKit/Carbon/CarbonWindowAdapter.m
WebKit/Carbon/HIViewAdapter.m
WebKit/Carbon/HIWebView.m
WebKit/ChangeLog
WebKit/Misc/WebFileDatabase.m
WebKit/Misc/WebNSWindowExtras.m
WebKit/Misc/WebTypesInternal.h
WebKit/Plugins/WebNetscapeDeprecatedFunctions.c
WebKit/Plugins/WebNetscapeDeprecatedFunctions.h
WebKit/Plugins/WebNetscapePluginPackage.h
WebKit/Plugins/WebNetscapePluginPackage.m
WebKit/WebKit.xcodeproj/project.pbxproj

index 7160a24b20fd6b030228a55981479f4dce39193e..2491cb508e911da5b000742eff683bcb7b95c8e0 100644 (file)
@@ -1,3 +1,32 @@
+2006-08-03  Sam Weinig  <sam.weinig@gmail.com>
+
+        Reviewed by Darin.
+
+        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10176
+          Make WebCore compile with -Wundef
+
+          * Adds -Wundef flag to Xcode project
+          * Converts #ifs to #ifdef and #ifndefs where needed.
+          * Added #define YYMAXDEPTH 10000 in kjs/grammar.y
+            to fix a warning from within Bison.
+
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * bindings/jni/jni_jsobject.cpp:
+        (JavaJSObject::getSlot):
+        (JavaJSObject::setSlot):
+        * bindings/npapi.h:
+        * bindings/objc/objc_class.mm:
+        (KJS::Bindings::ObjcClass::methodsNamed):
+        (KJS::Bindings::ObjcClass::fieldNamed):
+        * bindings/objc/objc_instance.mm:
+        (ObjcInstance::invokeMethod):
+        * bindings/objc/objc_runtime.mm:
+        (ObjcMethod::getMethodSignature):
+        (ObjcField::name):
+        (ObjcField::type):
+        * kjs/grammar.y:
+        * kjs/identifier.h:
+
 2006-08-03  Anders Carlsson  <acarlsson@apple.com>
 
         Reviewed by John Sullivan.
index d239a200e071ad19863766f658b17e56c61c0553..3f2ee53cf08ec41f99e748f681f0bacbf5fda3cb 100644 (file)
                                        "-Wwrite-strings",
                                        "-Wno-format-y2k",
                                        "-Wno-long-double",
+                                       "-Wundef",
                                );
                        };
                        name = Debug;
                                        "-Wwrite-strings",
                                        "-Wno-format-y2k",
                                        "-Wno-long-double",
+                                       "-Wundef",
                                );
                        };
                        name = Release;
                                        "-Wwrite-strings",
                                        "-Wno-format-y2k",
                                        "-Wno-long-double",
+                                       "-Wundef",
                                );
                        };
                        name = Production;
                                        "-Wno-format-y2k",
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
+                                       "-Wundef",
                                );
                        };
                        name = Debug;
                                        "-Wno-format-y2k",
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
+                                       "-Wundef",
                                );
                        };
                        name = Release;
                                        "-Wno-format-y2k",
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
+                                       "-Wundef",
                                );
                        };
                        name = Production;
index 37d4a2d2b2ffcfd19b123ce8054219e5eec05a6b..e9231c4df2fbe54f8d0ce1327d22b2462ef3a1e0 100644 (file)
@@ -244,7 +244,7 @@ void JavaJSObject::removeMember(jstring memberName) const
 
 jobject JavaJSObject::getSlot(jint index) const
 {
-#if __LP64__
+#ifdef __LP64__
     JS_LOG ("index = %d\n", index);
 #else
     JS_LOG ("index = %ld\n", index);
@@ -261,7 +261,7 @@ jobject JavaJSObject::getSlot(jint index) const
 
 void JavaJSObject::setSlot(jint index, jobject value) const
 {
-#if __LP64__
+#ifdef __LP64__
     JS_LOG ("index = %d, value = %p\n", index, value);
 #else
     JS_LOG ("index = %ld, value = %p\n", index, value);
index c279922c5b0d33e222298480eef3a8822107fcf9..521e3ec0550737147dae5a68b83dd65ac470e115 100644 (file)
@@ -115,7 +115,7 @@ typedef unsigned short uint16;
 
 #ifndef _UINT32
 #define _UINT32
-#if __LP64__
+#ifdef __LP64__
 typedef unsigned int uint32;
 #else /* __LP64__ */
 typedef unsigned long uint32;
@@ -129,7 +129,7 @@ typedef short int16;
 
 #ifndef _INT32
 #define _INT32
-#if __LP64__
+#ifdef __LP64__
 typedef int int32;
 #else /* __LP64__ */
 typedef long int32;
index 89d97cce29cbe26d962a7608c98b9314b5e212fd..a3d2d32c90269daa964f364591c7e9408407c32e 100644 (file)
@@ -93,7 +93,7 @@ MethodList ObjcClass::methodsNamed(const char* JSName, Instance*) const
 
     ClassStructPtr thisClass = _isa;
     while (thisClass && methodList.length() < 1) {
-#if OBJC_API_VERSION >= 2
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2
         unsigned numMethodsInClass = 0;
         MethodStructPtr* objcMethodList = class_copyMethodList(thisClass, &numMethodsInClass);
 #else
@@ -103,7 +103,7 @@ MethodList ObjcClass::methodsNamed(const char* JSName, Instance*) const
             unsigned numMethodsInClass = objcMethodList->method_count;
 #endif
             for (unsigned i = 0; i < numMethodsInClass; i++) {
-#if OBJC_API_VERSION >= 2
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2
                 MethodStructPtr objcMethod = objcMethodList[i];
                 SEL objcMethodSelector = method_getName(objcMethod);
                 const char* objcMethodSelectorName = sel_getName(objcMethodSelector);
@@ -132,7 +132,7 @@ MethodList ObjcClass::methodsNamed(const char* JSName, Instance*) const
                     break;
                 }
             }
-#if OBJC_API_VERSION >= 2
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2
             thisClass = class_getSuperclass(thisClass);
             free(objcMethodList);
 #else
@@ -191,7 +191,7 @@ Field* ObjcClass::fieldNamed(const char* name, Instance* instance) const
         // introspection.
 
         while (thisClass) {
-#if OBJC_API_VERSION >= 2
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2
             unsigned numFieldsInClass = 0;
             IvarStructPtr* ivarsInClass = class_copyIvarList(thisClass, &numFieldsInClass);
 #else
@@ -200,7 +200,7 @@ Field* ObjcClass::fieldNamed(const char* name, Instance* instance) const
                 unsigned numFieldsInClass = fieldsInClass->ivar_count;
 #endif
                 for (unsigned i = 0; i < numFieldsInClass; i++) {
-#if OBJC_API_VERSION >= 2
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2
                     IvarStructPtr objcIVar = ivarsInClass[i];
                     const char* objcIvarName = ivar_getName(objcIVar);
 #else
@@ -226,7 +226,7 @@ Field* ObjcClass::fieldNamed(const char* name, Instance* instance) const
                         break;
                     }
                 }
-#if OBJC_API_VERSION >= 2
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2
             thisClass = class_getSuperclass(thisClass);
             free(ivarsInClass);
 #else
index f67e73d5b81d742f303329f6a4a2f8e22cb1be98..4c732956b0d9eeb440e4d0abf1a3c43cd5e0a988 100644 (file)
@@ -124,7 +124,7 @@ JSValue* ObjcInstance::invokeMethod(ExecState* exec, const MethodList &methodLis
     method = static_cast<ObjcMethod*>(methodList.methodAt(0));
     NSMethodSignature* signature = method->getMethodSignature();
     NSInvocation* invocation = [NSInvocation invocationWithMethodSignature:signature];
-#if OBJC_API_VERSION >= 2
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2
     [invocation setSelector:sel_registerName(method->name())];
 #else
     [invocation setSelector:(SEL)method->name()];
index 67477f84f77f32a4c2596bca5e56b7069f195021..3d4028c156fda025ea27b4c753161747ec749b2a 100644 (file)
@@ -57,7 +57,7 @@ int ObjcMethod::numParameters() const
 
 NSMethodSignature* ObjcMethod::getMethodSignature() const
 {
-#if OBJC_API_VERSION >= 2
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2
     return [_objcClass instanceMethodSignatureForSelector:sel_registerName(_selector)];
 #else
     return [_objcClass instanceMethodSignatureForSelector:(SEL)_selector];
@@ -89,7 +89,7 @@ ObjcField::ObjcField(CFStringRef name)
 
 const char* ObjcField::name() const 
 {
-#if OBJC_API_VERSION >= 2
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2
     if (_ivar)
         return ivar_getName(_ivar);
 #else
@@ -101,7 +101,7 @@ const char* ObjcField::name() const
 
 RuntimeType ObjcField::type() const 
 { 
-#if OBJC_API_VERSION >= 2
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2
     if (_ivar)
         return ivar_getTypeEncoding(_ivar);
 #else
index b0aa05feacc20ef0ce3fab25976ee411527feeef..316bd81082f65309a08d9e680c8e8460b1488002 100644 (file)
@@ -36,6 +36,8 @@
 // Not sure why, but yacc doesn't add this define along with the others.
 #define yylloc kjsyylloc
 
+#define YYMAXDEPTH 10000
+
 /* default values for bison */
 #define YYDEBUG 0
 #if !PLATFORM(DARWIN)
index 6d96ca1829f97fdf61b3c9ca91d77f4120fa5993..a31e213e4c274bcf9e1022dae195c135c99d2b61 100644 (file)
@@ -82,7 +82,7 @@ namespace KJS {
         static PassRefPtr<UString::Rep> add(UString::Rep *);
     };
     
-#if !KJS_IDENTIFIER_HIDE_GLOBALS
+#ifndef KJS_IDENTIFIER_HIDE_GLOBALS
     extern const Identifier nullIdentifier;
 
     inline const Identifier &Identifier::null()
@@ -117,7 +117,7 @@ namespace KJS {
         macro(valueOf)
 
     // Define external global variables for all property names above (and one more).
-#if !KJS_IDENTIFIER_HIDE_GLOBALS
+#ifndef KJS_IDENTIFIER_HIDE_GLOBALS
     extern const Identifier specialPrototypePropertyName;
 
     #define KJS_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL(name) extern const Identifier name ## PropertyName;
@@ -125,6 +125,6 @@ namespace KJS {
     #undef KJS_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL
 #endif
 
-}
+} // namespace KJS
 
-#endif
+#endif // KJS_IDENTIFIER_H
index b94bfbcbe80dc4369e0db640b5b670d21d589dc9..1bea7460e9d5d43fbc3f194c56a491de7d461c05 100644 (file)
@@ -1,3 +1,14 @@
+2006-08-03  Sam Weinig  <sam.weinig@gmail.com>
+
+        Reviewed by Darin.
+
+        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10176
+          Make WebCore compile with -Wundef
+
+          * Adds -Wundef flag to Xcode project
+
+        * JavaScriptGlue.xcodeproj/project.pbxproj:
+
 2006-07-29  Sam Weinig  <sam.weinig@gmail.com>
 
         Reviewed by Darin.
index e48eac7e84a4f8458c502ec65988a3c2f5f0c44a..a7567fdc8d0721b7b3b904c08aa92a004b24fee0 100644 (file)
@@ -65,7 +65,7 @@
                0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
                089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; indentWidth = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                1422E86709DE3BCE00749B87 /* testjsglue.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = testjsglue.cpp; sourceTree = "<group>"; };
-               1422E87709DE3BE800749B87 /* testjsglue */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testjsglue; sourceTree = BUILT_PRODUCTS_DIR; };
+               1422E87709DE3BE800749B87 /* testjsglue */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = testjsglue; sourceTree = BUILT_PRODUCTS_DIR; };
                DD66F3D508F73ED700C75FD7 /* Info.plist */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                DD66F3D608F73ED700C75FD7 /* JavaScriptGlue.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = JavaScriptGlue.framework; sourceTree = BUILT_PRODUCTS_DIR; };
                DD66F3F508F7401B00C75FD7 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
                                        "-Wno-format-y2k",
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
+                                       "-Wundef",
                                );
                        };
                        name = Debug;
                                        "-Wno-format-y2k",
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
+                                       "-Wundef",
                                );
                        };
                        name = Release;
                                        "-Wno-format-y2k",
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
+                                       "-Wundef",
                                );
                        };
                        name = Production;
index 368ee5979ee610a096a72ee5e4a4cd80291d4279..5c076f104ebdd192517e31b523b77e7d61539d11 100644 (file)
@@ -1,3 +1,116 @@
+2006-08-03  Sam Weinig  <sam.weinig@gmail.com>
+
+        Reviewed by Darin.
+
+        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10176
+          Make WebCore compile with -Wundef
+
+          * Adds -Wundef flag to Xcode project
+          * Converts #ifs to #ifdef and #ifndefs where needed.
+          * Replaces #ifdef WIN32 with #if PLATFORM(WIN_OS) or PLATFORM(WIN)
+            (and in one instance in config.h with #if !COMPILER(MSVC))
+          * Added #define YYMAXDEPTH 10000 in XPathGrammar.y and CSSGrammar.y
+            to fix a warning from within Bison.
+          * Cleaned up style a little in surrounding code.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * bridge/mac/WebCoreAXObject.mm:
+        (-[WebCoreAXObject doAXTextMarkerRangeForUnorderedTextMarkers:]):
+        * config.h:
+        * css/CSSGrammar.y:
+        * css/MediaFeatureNames.cpp:
+        * css/MediaFeatureNames.h:
+        * css/cssparser.cpp:
+        * dom/ContainerNode.cpp:
+        (WebCore::ContainerNode::setActive):
+        * dom/Element.cpp:
+        (WebCore::Element::attach):
+        * dom/Element.h:
+        * dom/EventNames.cpp:
+        * dom/EventNames.h:
+        * dom/NamedAttrMap.h:
+        * dom/Position.cpp:
+        * dom/QualifiedName.cpp:
+        * dom/QualifiedName.h:
+        * dom/Range.h:
+        * dom/XMLTokenizer.cpp:
+        (WebCore::XMLTokenizer::error):
+        * html/HTMLTokenizer.cpp:
+        (WebCore::HTMLTokenizer::scriptHandler):
+        (WebCore::HTMLTokenizer::scriptExecution):
+        (WebCore::HTMLTokenizer::parseTag):
+        (WebCore::HTMLTokenizer::continueProcessing):
+        (WebCore::HTMLTokenizer::write):
+        (WebCore::HTMLTokenizer::timerFired):
+        (WebCore::HTMLTokenizer::notifyFinished):
+        * kcanvas/device/quartz/KCanvasFilterQuartz.h:
+        * kcanvas/device/quartz/KRenderingDeviceQuartz.h:
+        * ksvg2/css/SVGRenderStyle.h:
+        * ksvg2/css/SVGRenderStyleDefs.h:
+        * ksvg2/scripts/make_names.pl:
+        * loader/CachedResource.h:
+        * loader/LoaderFunctions.h:
+        * loader/loader.h:
+        * page/Frame.cpp:
+        * page/FrameTree.cpp:
+        * page/FrameView.cpp:
+        (WebCore::FrameView::clear):
+        (WebCore::FrameView::layout):
+        (WebCore::FrameView::layoutTimerFired):
+        (WebCore::FrameView::scheduleRelayout):
+        (WebCore::FrameView::unscheduleRelayout):
+        * platform/AtomicString.cpp:
+        * platform/AtomicString.h:
+        * platform/Cursor.h:
+        * platform/DeprecatedArray.h:
+        * platform/DeprecatedString.cpp:
+        (WebCore::allocateHandle):
+        (WebCore::initializeHandleNodeBlock):
+        (WebCore::freeHandle):
+        * platform/FloatPoint.h:
+        * platform/FloatRect.h:
+        * platform/FloatSize.h:
+        * platform/GraphicsContext.h:
+        * platform/Image.h:
+        * platform/IntPoint.h:
+        * platform/IntRect.h:
+        (WebCore::IntRect::inflateX):
+        (WebCore::IntRect::inflateY):
+        * platform/IntSize.h:
+        * platform/PlatformKeyboardEvent.h:
+        * platform/PlatformMouseEvent.h:
+        * platform/PlatformString.h:
+        * platform/ResourceLoader.h:
+        * platform/ResourceLoaderInternal.h:
+        (WebCore::ResourceLoaderInternal::ResourceLoaderInternal):
+        * platform/ScrollView.h:
+        * platform/StaticConstructors.h:
+        * platform/StreamingTextDecoderICU.cpp:
+        (WebCore::StreamingTextDecoderICU::convert):
+        * platform/StringImpl.h:
+        * platform/Widget.h:
+        * platform/mac/BlockExceptions.mm:
+        * platform/mac/ColorMac.mm:
+        (+[WebCoreControlTintObserver WebCore]):
+        * platform/mac/FloatPointMac.mm:
+        * platform/mac/FloatRectMac.mm:
+        * platform/mac/FloatSizeMac.mm:
+        * platform/mac/FontMac.mm:
+        * platform/mac/GraphicsContextMac.mm:
+        (WebCore::GraphicsContext::drawFocusRing):
+        * platform/mac/IntPointMac.mm:
+        * platform/mac/IntRectMac.mm:
+        * platform/mac/IntSizeMac.mm:
+        * platform/mac/WebCoreSystemInterface.h:
+        * rendering/RenderBlock.h:
+        * rendering/RenderTableCell.h:
+        * rendering/bidi.cpp:
+        (WebCore::appendRun):
+        (WebCore::RenderBlock::layoutInlineChildren):
+        * xml/XSLTProcessor.cpp:
+        (WebCore::parseErrorFunc):
+        * xpath/impl/XPathGrammar.y:
+
 2006-08-03  Adam Roben  <aroben@apple.com>
 
         Reviewed by Maciej and Beth.
index 0cc67dbce99f1fd8e107e10b9747eeebbaf8f3a4..df01119e2ece7cd22813d4a1f96e6b63fe0f8ea9 100644 (file)
                                935C475E09AC4CAE00A6AAB4 /* HistoryMac.mm */,
                                F58784FF02DE375901EA4122 /* JavaAppletWidget.mm */,
                                93E47C5B09BE2BBB0019C5C1 /* PageMac.mm */,
+                               55998A5A052B59CC0017A6C1 /* WebCoreAXObject.h */,
+                               55998A5B052B59CC0017A6C1 /* WebCoreAXObject.mm */,
                                F5B2A4FC02E2220F018635CB /* WebCoreCache.h */,
                                F5B2A4FD02E2220F018635CB /* WebCoreCache.mm */,
                                BEF7EEA005FF8F0D009717EE /* WebCoreEditCommand.h */,
                                F587855502DE375901EA4122 /* WebCoreViewFactory.m */,
                                5150C2A10702629000AF642C /* WebDashboardRegion.h */,
                                5150C2A50702629800AF642C /* WebDashboardRegion.m */,
-                               55998A5A052B59CC0017A6C1 /* WebCoreAXObject.h */,
-                               55998A5B052B59CC0017A6C1 /* WebCoreAXObject.mm */,
                        );
                        path = mac;
                        sourceTree = "<group>";
                                F587868202DE3B8601EA4122 /* PopUpButton.h */,
                                F587852B02DE375901EA4122 /* RegularExpression.cpp */,
                                F58786B302DE3B8601EA4122 /* RegularExpression.h */,
+                               6545F66C09B82FED0013006F /* ResourceLoader.cpp */,
+                               6545F66D09B82FED0013006F /* ResourceLoader.h */,
+                               6545F66E09B82FED0013006F /* ResourceLoaderClient.h */,
+                               6545F66F09B82FED0013006F /* ResourceLoaderInternal.h */,
                                9385F761098D9C3100D90D24 /* Screen.h */,
                                BC7B2AF80450824100A8000F /* ScrollBar.h */,
                                9353673E09AED79200D35CD6 /* ScrollBarMode.h */,
                                F58786BF02DE3B8601EA4122 /* TextStream.h */,
                                93309EA1099EB78C0056E581 /* Timer.cpp */,
                                9305B24C098F1B6B00C28855 /* Timer.h */,
-                               6545F66C09B82FED0013006F /* ResourceLoader.cpp */,
-                               6545F66D09B82FED0013006F /* ResourceLoader.h */,
-                               6545F66E09B82FED0013006F /* ResourceLoaderClient.h */,
-                               6545F66F09B82FED0013006F /* ResourceLoaderInternal.h */,
                                9380F47109A11AB4001FDB34 /* Widget.cpp */,
                                9380F47209A11AB4001FDB34 /* Widget.h */,
                                93B780C909B3B7FE00690162 /* WidgetClient.h */,
                                        "-Wno-format-y2k",
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
+                                       "-Wundef",
                                );
                        };
                        name = Debug;
                                        "-Wno-format-y2k",
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
+                                       "-Wundef",
                                );
                        };
                        name = Release;
                                        "-Wno-format-y2k",
                                        "-Wno-unused-parameter",
                                        "-Wno-long-double",
+                                       "-Wundef",
                                );
                        };
                        name = Production;
index 66df08228d32eafe4f6a51e9c36cdfede565e9fa..315604531c902186b7ea196d91b3e2e512cfa8fe 100644 (file)
@@ -1362,7 +1362,7 @@ static void AXAttributedStringAppendReplaced (NSMutableAttributedString *attrStr
 
 - (id)doAXTextMarkerRangeForUnorderedTextMarkers: (NSArray *) markers
 {
-#if MARKERARRAY_SELF_TEST
+#if defined(MARKERARRAY_SELF_TEST) && MARKERARRAY_SELF_TEST
     WebCoreTextMarkerRange *tmr = [self getSelectedTextMarkerRange];
     WebCoreTextMarker *tm1 = AXTextMarkerRangeCopyEndMarker(tmr);
     WebCoreTextMarker *tm2 = AXTextMarkerRangeCopyStartMarker(tmr);
index 285db47e9a652eda3bbe975529c100f5dee2fc07..919ea8931109efe667a3edf7a3fbf3ee73575112 100644 (file)
 #define KHTML_NO_XBL 1
 #define KHTML_XSLT 1
 
+
 #if __APPLE__
 #define HAVE_FUNC_USLEEP 1
 
 #ifndef CGFLOAT_DEFINED
-#if __LP64__
+#ifdef __LP64__
 typedef double CGFloat;
 #else
 typedef float CGFloat;
@@ -35,9 +36,10 @@ typedef float CGFloat;
 #define CGFLOAT_DEFINED 1
 #endif
 
-#endif
+#endif /* __APPLE__ */
+
 
-#if WIN32
+#if PLATFORM(WIN_OS)
 
 #ifndef _WIN32_WINNT
 #define _WIN32_WINNT 0x0500
@@ -54,10 +56,10 @@ typedef float CGFloat;
 // FIXME: Should probably just dump this eventually, but it's needed for now.
 // We get this from some system place on OS X; probably better not to use it
 // in WebCore code.
-
 #include <assert.h>
 
-#endif
+#endif /* PLATFORM(WIN_OS) */
+
 
 #ifdef __cplusplus
 
@@ -69,6 +71,6 @@ typedef float CGFloat;
 
 #endif
 
-#if !defined(WIN32) // can't get this to compile on Visual C++ yet
+#if !COMPILER(MSVC) // can't get this to compile on Visual C++ yet
 #define AVOID_STATIC_CONSTRUCTORS 1
 #endif
index 16404077fd5a255ba75026c193db64a0c80c9217..e51b4fcf5dcffffb7cb36fa9eda7331435b7a42c 100644 (file)
@@ -117,6 +117,7 @@ static inline int getValueID(const char* tagStr, int len)
     return val->id;
 }
 
+#define YYMAXDEPTH 10000
 #define YYDEBUG 0
 #define YYPARSE_PARAM parser
 
index e015d7d789ecfdbad7d428c71b1b18239dc933d1..9e4454b07c486e8573f93d6a32ab7ae7cf7311c8 100644 (file)
 
 #include "config.h"
 
-#if AVOID_STATIC_CONSTRUCTORS
+#ifdef AVOID_STATIC_CONSTRUCTORS
 #define CSS_MEDIAQUERY_NAMES_HIDE_GLOBALS 1
 #endif
 
 #include "MediaFeatureNames.h"
 #include "StaticConstructors.h"
 
-namespace WebCore { namespace MediaFeatureNames {
+namespace WebCore {
+namespace MediaFeatureNames {
 
 #define DEFINE_MEDIAFEATURE_GLOBAL(name, str) \
     DEFINE_GLOBAL(AtomicString, name##MediaFeature, str)
@@ -50,4 +51,5 @@ void init()
     }
 }
 
-} }
+} // namespace MediaFeatureNames
+} // namespace WebCore
index bb488b565ea052990d9d192bf2560b868dc76400..78a2a7c1c6fbf6b3f0f357236fefe313fc182052 100644 (file)
@@ -24,7 +24,8 @@
 
 #include "AtomicString.h"
 
-namespace WebCore { namespace MediaFeatureNames {
+namespace WebCore {
+    namespace MediaFeatureNames {
 
 #define CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(macro) \
     macro(color, "color") \
@@ -54,15 +55,15 @@ namespace WebCore { namespace MediaFeatureNames {
     macro(min_width, "min-width") \
 // end of macro
 
-#if !CSS_MEDIAQUERY_NAMES_HIDE_GLOBALS
+#ifndef CSS_MEDIAQUERY_NAMES_HIDE_GLOBALS
     #define CSS_MEDIAQUERY_NAMES_DECLARE(name, str) extern const AtomicString name##MediaFeature;
     CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(CSS_MEDIAQUERY_NAMES_DECLARE)
     #undef CSS_MEDIAQUERY_NAMES_DECLARE
 #endif
 
-     void init();
-} }
-
-#endif
+        void init();
 
+    } // namespace MediaFeatureNames
+} // namespace WebCore
 
+#endif // MEDIAFEATURENAMES_H
index 5ba081c52130e3d357c89f8994aa2d2a333db1dc..00859cee5715b947acee76ddcb3ca94a6be80a09 100644 (file)
@@ -2669,7 +2669,7 @@ bool CSSParser::parseBorderImage(int propId, bool important)
     return context.failed();
 }
 
-#if CSS_DEBUG
+#ifdef CSS_DEBUG
 
 static inline int yyerror(const char *str)
 {
index 99abac11a9df7032f70671e19fe854151959a47e..ff5c0b2c6f6d806f27b9a28a531052df63aa0040 100644 (file)
@@ -783,7 +783,7 @@ void ContainerNode::setActive(bool down, bool pause)
             // to repaint the "down" state of the control is about the same time as it would take to repaint the
             // "up" state.  Once you assume this, you can just delay for 100ms - that time (assuming that after you
             // leave this method, it will be about that long before the flush of the up state happens again).
-#if HAVE_FUNC_USLEEP
+#ifdef HAVE_FUNC_USLEEP
             double startTime = currentTime();
 #endif
 
@@ -792,7 +792,7 @@ void ContainerNode::setActive(bool down, bool pause)
             
             // FIXME: Find a substitute for usleep for Win32.
             // Better yet, come up with a way of doing this that doesn't use this sort of thing at all.            
-#if HAVE_FUNC_USLEEP
+#ifdef HAVE_FUNC_USLEEP
             // Now pause for a small amount of time (1/10th of a second from before we repainted in the pressed state)
             double remainingTime = 0.1 - (currentTime() - startTime);
             if (remainingTime > 0)
index 7244ab898eb1ca6709c71767f2e435a463552aba..43288d1b1595e64994610257b7711d280abf5b11 100644 (file)
@@ -540,7 +540,7 @@ void Element::removedFromDocument()
 
 void Element::attach()
 {
-#if SPEED_DEBUG < 1
+#if !defined(SPEED_DEBUG) || SPEED_DEBUG < 1
     createRendererIfNeeded();
 #endif
     ContainerNode::attach();
index d4c2d810ec3a0d66b358cfb3423ecf1c5abd2e15..4128eaddb440f92b0f60a974368f351c5636d940 100644 (file)
@@ -159,7 +159,7 @@ public:
     bool needsFocusAppearanceUpdate() const { return m_needsFocusAppearanceUpdate; }
     void setNeedsFocusAppearanceUpdate(bool b) { m_needsFocusAppearanceUpdate = b; }
     
-#if !NDEBUG
+#ifndef NDEBUG
     virtual void dump(TextStream *stream, DeprecatedString ind = "") const;
     virtual void formatForDebugger(char *buffer, unsigned length) const;
 #endif
index 5c54cc12cee333147a4fc1815a5a98a98e052598..a8a488bd7b87b1fa2c1504ff2714d6356dcfe4c5 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "config.h"
 
-#if AVOID_STATIC_CONSTRUCTORS
+#ifdef AVOID_STATIC_CONSTRUCTORS
 #define DOM_EVENT_NAMES_HIDE_GLOBALS 1
 #endif
 
index 20b417fa867217ff1371b6aceaf653d71313af0e..5cd84d2d2cb7047d9b6247ad35a55f03fffbbc76 100644 (file)
@@ -96,7 +96,7 @@ namespace WebCore { namespace EventNames {
     \
 // end of DOM_EVENT_NAMES_FOR_EACH
 
-#if !DOM_EVENT_NAMES_HIDE_GLOBALS
+#ifndef DOM_EVENT_NAMES_HIDE_GLOBALS
     #define DOM_EVENT_NAMES_DECLARE(name) extern const AtomicString name##Event;
     DOM_EVENT_NAMES_FOR_EACH(DOM_EVENT_NAMES_DECLARE)
     #undef DOM_EVENT_NAMES_DECLARE
index 3d9f366d46ac3c96a3751b8eb036743e3e218c11..65fb73642fd585fc829dd9b23a946a21ea839eff 100644 (file)
@@ -30,7 +30,7 @@
 #include "Element.h"
 #include "NamedNodeMap.h"
 
-#if __OBJC__
+#ifdef __OBJC__
 #define id id_AVOID_KEYWORD
 #endif
 
index 0e9ac786c570cb6ebd585a2ca840d1b14e707199..bdd3824e3dd2e5eea857fd76889671a7064f70f9 100644 (file)
@@ -654,7 +654,7 @@ void Position::debugPosition(const char *msg) const
         fprintf(stderr, "Position [%s]: %s [%p] at %d\n", msg, node()->nodeName().deprecatedString().latin1(), node(), offset());
 }
 
-#if !NDEBUG
+#ifndef NDEBUG
 
 void Position::formatForDebugger(char *buffer, unsigned length) const
 {
index 10607343550afd180c5866ae5594fb3128e93f62..bacc8201e78097cafcdcf5cf0a309b71697e1da9 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "config.h"
 
-#if AVOID_STATIC_CONSTRUCTORS
+#ifdef AVOID_STATIC_CONSTRUCTORS
 #define WEBCORE_QUALIFIEDNAME_HIDE_GLOBALS 1
 #else
 #define QNAME_DEFAULT_CONSTRUCTOR
index 1669486d0c5147f0c096dad5ebe51c10182fc562..cca5093530f39550c4e89b8dae41982c4136b69e 100644 (file)
@@ -71,7 +71,7 @@ private:
     QualifiedNameImpl* m_impl;
 };
 
-#if !WEBCORE_QUALIFIEDNAME_HIDE_GLOBALS
+#ifndef WEBCORE_QUALIFIEDNAME_HIDE_GLOBALS
 extern const QualifiedName anyName;
 inline const QualifiedName& anyQName() { return anyName; }
 #endif
index e2688628e5b060315ac496a2e1d95222e2e1c1de..f69dfe2d8eb148ed7c03d2be8372ee085cc134b6 100644 (file)
@@ -110,8 +110,8 @@ public:
 
     Position editingStartPosition() const;
 
-#if !NDEBUG
-    void formatForDebugger(char *buffer, unsigned length) const;
+#ifndef NDEBUG
+    void formatForDebugger(charbuffer, unsigned length) const;
 #endif
 
 private:
index 45767805da4379253c6e34749d979eaeb0da4677..95f8d4c887a6edf553b1123bef38146ddcc125d2 100644 (file)
@@ -43,6 +43,7 @@
 #include "ResourceLoader.h"
 #include <libxml/parser.h>
 #include <libxml/parserInternals.h>
+#include <wtf/Platform.h>
 #include <wtf/Vector.h>
 
 #ifdef KHTML_XSLT
@@ -63,12 +64,11 @@ using namespace HTMLNames;
 
 const int maxErrors = 25;
 
-typedef HashMap<StringImpl *, StringImpl *> PrefixForNamespaceMap;
+typedef HashMap<StringImpl*, StringImpl*> PrefixForNamespaceMap;
 
 class PendingCallbacks;
 
-class XMLTokenizer : public Tokenizer, public CachedResourceClient
-{
+class XMLTokenizer : public Tokenizer, public CachedResourceClient {
 public:
     XMLTokenizer(Document *, FrameView * = 0);
     XMLTokenizer(DocumentFragment *, Element *);
@@ -922,7 +922,7 @@ void XMLTokenizer::error(ErrorType type, const char *message, va_list args)
     if (m_parserStopped)
         return;
 
-#if WIN32
+#if PLATFORM(WIN_OS)
     char m[1024];
     vsnprintf(m, sizeof(m) - 1, message, args);
 #else
@@ -935,7 +935,7 @@ void XMLTokenizer::error(ErrorType type, const char *message, va_list args)
     else
         handleError(type, m, lineNumber(), columnNumber());
 
-#if !WIN32
+#if !PLATFORM(WIN_OS)
     free(m);
 #endif
 }
index 7d798357aff4ffe984302ad64f7a3ed9c286c1f4..968fcf18fde863a312dd25547121a551a83f314e 100644 (file)
@@ -363,10 +363,10 @@ HTMLTokenizer::State HTMLTokenizer::scriptHandler(State state)
         if (!scriptSrc.isEmpty() && m_doc->frame()) {
             // forget what we just got; load from src url instead
             if (!parser->skipMode() && !followingFrameset) {
-    #if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
                 if (!m_doc->ownerElement())
                     printf("Requesting script at time %d\n", m_doc->elapsedTime());
-    #endif
+#endif
                 // The parser might have been stopped by for example a window.close call in an earlier script.
                 // If so, we don't want to load scripts.
                 if (!m_parserStopped && (cs = m_doc->docLoader()->requestScript(scriptSrc, scriptSrcCharset) ))
@@ -376,13 +376,12 @@ HTMLTokenizer::State HTMLTokenizer::scriptHandler(State state)
             } else
                 scriptNode = 0;
             scriptSrc=DeprecatedString::null;
-        }
-        else {
-    #ifdef TOKEN_DEBUG
+        } else {
+#ifdef TOKEN_DEBUG
             kdDebug( 6036 ) << "---START SCRIPT---" << endl;
             kdDebug( 6036 ) << DeprecatedString(scriptCode, scriptCodeSize) << endl;
             kdDebug( 6036 ) << "---END SCRIPT---" << endl;
-    #endif
+#endif
             scriptNode = 0;
             // Parse scriptCode containing <script> info
             doScriptExec = true;
@@ -477,7 +476,7 @@ HTMLTokenizer::State HTMLTokenizer::scriptExecution(const DeprecatedString& str,
     SegmentedString prependingSrc;
     currentPrependingSrc = &prependingSrc;
 
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
     if (!m_doc->ownerElement())
         printf("beginning script execution at %d\n", m_doc->elapsedTime());
 #endif
@@ -488,7 +487,7 @@ HTMLTokenizer::State HTMLTokenizer::scriptExecution(const DeprecatedString& str,
 
     state.setAllowYield(true);
 
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
     if (!m_doc->ownerElement())
         printf("ending script execution at %d\n", m_doc->elapsedTime());
 #endif
@@ -808,7 +807,7 @@ HTMLTokenizer::State HTMLTokenizer::parseTag(SegmentedString &src, State state)
         }
         case TagName:
         {
-#if defined(TOKEN_DEBUG) &&  TOKEN_DEBUG > 1
+#if defined(TOKEN_DEBUG) && TOKEN_DEBUG > 1
             qDebug("TagName");
 #endif
             if (searchCount > 0)
@@ -1289,7 +1288,7 @@ inline bool HTMLTokenizer::continueProcessing(int& processedCount, double startT
                 (m_doc->documentElement()->id() != ID_HTML || m_doc->body()))) {*/
             // Schedule the timer to keep processing as soon as possible.
             m_timer.startOneShot(0);
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
             if (currentTime() - startTime > tokenizerTimeDelay)
                 printf("Deferring processing of data because 500ms elapsed away from event loop.\n");
 #endif
@@ -1335,7 +1334,7 @@ bool HTMLTokenizer::write(const SegmentedString &str, bool appendData)
     bool wasInWrite = inWrite;
     inWrite = true;
     
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
     if (!m_doc->ownerElement())
         printf("Beginning write at time %d\n", m_doc->elapsedTime());
 #endif
@@ -1453,7 +1452,7 @@ bool HTMLTokenizer::write(const SegmentedString &str, bool appendData)
         }
     }
     
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
     if (!m_doc->ownerElement())
         printf("Ending write at time %d\n", m_doc->elapsedTime());
 #endif
@@ -1487,7 +1486,7 @@ bool HTMLTokenizer::processingData() const
 
 void HTMLTokenizer::timerFired(Timer<HTMLTokenizer>*)
 {
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
     if (!m_doc->ownerElement())
         printf("Beginning timer write at time %d\n", m_doc->elapsedTime());
 #endif
@@ -1661,7 +1660,7 @@ void HTMLTokenizer::enlargeScriptBuffer(int len)
 
 void HTMLTokenizer::notifyFinished(CachedResource*)
 {
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
     if (!m_doc->ownerElement())
         printf("script loaded at %d\n", m_doc->elapsedTime());
 #endif
@@ -1689,7 +1688,7 @@ void HTMLTokenizer::notifyFinished(CachedResource*)
         RefPtr<Node> n = scriptNode;
         scriptNode = 0;
 
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
         if (!m_doc->ownerElement())
             printf("external script beginning execution at %d\n", m_doc->elapsedTime());
 #endif
@@ -1706,7 +1705,7 @@ void HTMLTokenizer::notifyFinished(CachedResource*)
         finished = pendingScripts.isEmpty();
         if (finished) {
             m_state.setLoadingExtScript(false);
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
             if (!m_doc->ownerElement())
                 printf("external script finished execution at %d\n", m_doc->elapsedTime());
 #endif
index 3d44e0bbbc57ca4528e642497236ca285e6e4d9a..affae84071fc504143a83b696f9008202a92c3f0 100644 (file)
@@ -27,7 +27,7 @@
 
 #import "KCanvasFilters.h"
 
-#if __OBJC__
+#ifdef __OBJC__
 @class CIFilter;
 @class CIImage;
 #else
index 3bfd8186f0c77ca9a50cf28623227751f02726db..3dba7917c0467b73bb7a95ca42d103f2ac094540 100644 (file)
@@ -33,7 +33,7 @@
 typedef struct CGRect CGRect;
 typedef struct CGContext *CGContextRef;
 
-#if __OBJC__
+#ifdef __OBJC__
 @class NSGraphicsContext;
 #else
 class NSGraphicsContext;
index faad98b5317bfbe679a37f513e542a3355bdcb29..87e35d24969ef208f952bde5d5faa9a87f652f47 100644 (file)
 #if SVG_SUPPORT
 
 #include "DataRef.h"
-
 #include <ksvg2/svg/SVGPaint.h>
 #include <ksvg2/css/SVGRenderStyleDefs.h>
+#include <wtf/Platform.h>
 
-#if WIN32
+#if PLATFORM(WIN_OS)
 typedef unsigned long long uint64_t;
 #endif
 
index 46919997ac216f2f38052e4ce0641ce6ab82b1ac..312b84550798ae457d3dfcca0da8b762080139ae 100644 (file)
@@ -102,7 +102,9 @@ namespace WebCore {
         PE_VISIBLE_STROKE, PE_VISIBLE_FILL, PE_VISIBLE_PAINTED, PE_ALL
     };
     
+    class CSSValue;
     class CSSValueList;
+    class SVGPaint;
 
     // Inherited/Non-Inherited Style Datastructures
     class StyleFillData : public Shared<StyleFillData> {
index 6c254ed284eff4b7a19564fe9fc263f7085b0e20..d811b0b1920a38588f05a306e95fe03a8fe639f8 100755 (executable)
@@ -214,7 +214,7 @@ sub printNamesHeaderFile
        }
        
        my $lowerNamespace = lc($namespacePrefix);
-       print "#if !DOM_${namespace}NAMES_HIDE_GLOBALS\n";
+       print "#ifndef DOM_${namespace}NAMES_HIDE_GLOBALS\n";
     print "// Namespace\n";
     print "extern const WebCore::AtomicString ${lowerNamespace}NamespaceURI;\n\n";
 
@@ -250,7 +250,7 @@ sub printNamesCppFile
 
 print "#include \"config.h\"\n";
 
-print "#if AVOID_STATIC_CONSTRUCTORS\n";
+print "#ifdef AVOID_STATIC_CONSTRUCTORS\n";
 print "#define DOM_${namespace}NAMES_HIDE_GLOBALS 1\n";
 print "#else\n";
 print "#define QNAME_DEFAULT_CONSTRUCTOR 1\n";
index 0539e868fa4e88fc4eb6b4a788c359498f46dd33..ce4be43010a050f3cc3c7359c56691dd8b25cf11 100644 (file)
@@ -35,7 +35,7 @@
 #include <wtf/Vector.h>
 #include <time.h>
 
-#if __OBJC__
+#ifdef __OBJC__
 @class NSData;
 @class NSURLResponse;
 #else
index b102f878a41f631d3b5a0d2d5f26db347c4d351a..2407916f50ecef17b31d0f58b62d759a0762d9a0 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <wtf/Vector.h>
 
-#if __OBJC__
+#ifdef __OBJC__
 @class NSDictionary;
 @class NSString;
 @class NSURLResponse;
index 5d29c21519474b7f5027fb4fd1747776c5e38dd7..c27388b40bd4f1a3b4b185c05009ebe6c4df166c 100644 (file)
@@ -31,7 +31,7 @@
 #include <wtf/HashMap.h>
 #include "DeprecatedPtrList.h"
 
-#if __OBJC__
+#ifdef __OBJC__
 @class NSData;
 @class NSURLResponse;
 #else
index abbf48bd25fa798fb691f67d0ccc3426dd615d13..e7a22ded34f27c7631d2e478edec3ac6ff0e1f6d 100644 (file)
 #include "FloatRect.h"
 #include "Frame.h"
 #include "GraphicsContext.h"
-#include "HTMLViewSourceDocument.h"
 #include "HTMLFormElement.h"
 #include "HTMLFrameElement.h"
 #include "HTMLGenericFormElement.h"
+#include "HTMLInputElement.h"
 #include "HTMLNames.h"
 #include "HTMLObjectElement.h"
-#include "HTMLInputElement.h"
+#include "HTMLViewSourceDocument.h"
 #include "ImageDocument.h"
 #include "MediaFeatureNames.h"
 #include "MouseEventWithHitTestResults.h"
 #include "Plugin.h"
 #include "PluginDocument.h"
 #include "RenderPart.h"
-#include "RenderTheme.h"
 #include "RenderTextControl.h"
+#include "RenderTheme.h"
 #include "RenderView.h"
 #include "SegmentedString.h"
 #include "TextDocument.h"
 #include "TextIterator.h"
 #include "TypingCommand.h"
+#include "XMLTokenizer.h"
 #include "cssstyleselector.h"
 #include "htmlediting.h"
 #include "kjs_window.h"
 #include "markup.h"
 #include "visible_units.h"
-#include "XMLTokenizer.h"
 #include "xmlhttprequest.h"
 #include <math.h>
 #include <sys/types.h>
+#include <wtf/Platform.h>
 
-#if !WIN32
+#if !PLATFORM(WIN_OS)
 #include <unistd.h>
 #endif
 
index 00e2bcfb6db389800bd1bf3dadead3bba0b6a88f..1fc79f6138e116fbae6ff0bcd94742987b049bd9 100644 (file)
 
 #include "Frame.h"
 #include "Page.h"
-#include <wtf/Vector.h>
 #include <stdarg.h>
+#include <wtf/Platform.h>
+#include <wtf/Vector.h>
 
 using std::swap;
 
 namespace WebCore {
 
-// This belongs in some header file where multiple clients can share it.
-#if WIN32
+// FIXME: This belongs in some header file where multiple clients can share it.
+#if PLATFORM(WIN_OS)
 int snprintf(char* str, size_t size, const char* format, ...)
 {
     va_list args;
index b50bf765dd3b16e9971be6ded210b7525c6a3dbd..f7d7b16d9131fed72582cdc2beeb2398cbdd956d 100644 (file)
@@ -230,7 +230,7 @@ void FrameView::clear()
 
     d->reset();
 
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
     if (d->layoutTimer.isActive() && m_frame->document() && !m_frame->document()->ownerElement())
         printf("Killing the layout timer from a clear at %d\n", m_frame->document()->elapsedTime());
 #endif    
@@ -413,7 +413,7 @@ void FrameView::layout(bool allowSubtree)
             }
         } else if (rootRenderer)
             applyOverflowToViewport(rootRenderer, hMode, vMode); // XML/XHTML UAs use the root element.
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
         if (d->firstLayout && !document->ownerElement())
             printf("Elapsed time before first layout: %d\n", document->elapsedTime());
 #endif
@@ -1206,7 +1206,7 @@ void FrameView::repaintRectangle(const IntRect& r, bool immediate)
 
 void FrameView::layoutTimerFired(Timer<FrameView>*)
 {
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
     if (m_frame->document() && !m_frame->document()->ownerElement())
         printf("Layout timer fired at %d\n", m_frame->document()->elapsedTime());
 #endif
@@ -1240,7 +1240,7 @@ void FrameView::scheduleRelayout()
 
     d->delayedLayout = delay != 0;
 
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
     if (!m_frame->document()->ownerElement())
         printf("Scheduling layout for %d\n", delay);
 #endif
@@ -1288,7 +1288,7 @@ void FrameView::unscheduleRelayout()
     if (!d->layoutTimer.isActive())
         return;
 
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
     if (m_frame->document() && !m_frame->document()->ownerElement())
         printf("Layout timer unscheduled at %d\n", m_frame->document()->elapsedTime());
 #endif
index 90a7cd6e8cb0d24363f6f8787a6fa6edec595bf3..0ae83790701329c11f150e07cff498eb36cca16f 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "config.h"
 
-#if AVOID_STATIC_CONSTRUCTORS
+#ifdef AVOID_STATIC_CONSTRUCTORS
 #define ATOMICSTRING_HIDE_GLOBALS 1
 #endif
 
index de3a8abefe2b35bf5227947c0fdafa2089eaf272..840ba5bbd0d8c7212b4b71d2b80f27229877759d 100644 (file)
@@ -114,7 +114,7 @@ inline bool equalIgnoringCase(const char* a, const AtomicString& b) { return equ
 inline bool equalIgnoringCase(const String& a, const AtomicString& b) { return equalIgnoringCase(a.impl(), b.impl()); }
 
 // Define external global variables for the commonly used atomic strings.
-#if !ATOMICSTRING_HIDE_GLOBALS
+#ifndef ATOMICSTRING_HIDE_GLOBALS
     extern const AtomicString nullAtom;
     extern const AtomicString emptyAtom;
     extern const AtomicString textAtom;
@@ -122,6 +122,6 @@ inline bool equalIgnoringCase(const String& a, const AtomicString& b) { return e
     extern const AtomicString starAtom;
 #endif
 
-}
+} // namespace WebCore
 
-#endif
+#endif // AtomicString_h
index 94e9f31754cecc458acd3fee3aacc68ae0e0e432..ad4751a6e219d4a1a97a6c9f6b0ccee6c95df0d1 100644 (file)
@@ -26,7 +26,9 @@
 #ifndef CURSOR_H
 #define CURSOR_H
 
-#ifdef WIN32
+#include <wtf/Platform.h>
+
+#if PLATFORM(WIN)
 #include <windows.h>
 #elif PLATFORM(GDK)
 #include <gdk/gdk.h>
@@ -44,7 +46,7 @@ namespace WebCore {
 
     class Image;
 
-#ifdef WIN32
+#if PLATFORM(WIN)
     typedef HCURSOR PlatformCursor;
 #elif defined(__APPLE__)
     typedef NSCursor* PlatformCursor;
@@ -92,6 +94,6 @@ namespace WebCore {
     const Cursor& columnResizeCursor();
     const Cursor& rowResizeCursor();
 
-}
+} // namespace WebCore
 
-#endif
+#endif // CURSOR_H
index a4e202e163b0309a2548e4f644e2e8c0f424906d..239adc618b5f3f5d5ff7928ed073a27807761268 100644 (file)
@@ -27,6 +27,7 @@
 #define ARRAY_H_
 
 #include "ArrayImpl.h"
+#include <wtf/Platform.h>
 
 namespace WebCore {
 
@@ -51,7 +52,7 @@ public:
 
     T &operator[](int i) { return *(T *)impl.at(i); }
     const T &operator[](int i) const { return *(T *)impl.at(i); }
-#if WIN32
+#if PLATFORM(WIN_OS)
     // FIXME: Look into this strange compile error on Win32.
     T &operator[](unsigned i) { return *(T *)impl.at(i); }
     const T &operator[](unsigned i) const { return *(T *)impl.at(i); }
@@ -66,6 +67,6 @@ public:
 
 typedef DeprecatedArray<char> DeprecatedByteArray;
 
-}
+} // namespace WebCore
 
-#endif
+#endif // ARRAY_H_
index c8fd9571824463ef6494a59cf76c2d17c9fc58bf..342a17ce77f4d778e370cb88fcfc2cf7d3b4cdb3 100644 (file)
 #include "TextEncoding.h"
 #include <kjs/dtoa.h>
 #include <kjs/identifier.h>
-#include <stdio.h>
 #include <stdarg.h>
-#ifdef WIN32
+#include <stdio.h>
+#include <wtf/Platform.h>
+
+#if PLATFORM(WIN_OS)
 #include <windows.h>
 #endif
 
@@ -72,7 +74,7 @@ static inline void initializeHandleNodes()
 
 static inline DeprecatedStringData **allocateHandle()
 {
-#if CHECK_FOR_HANDLE_LEAKS
+#ifdef CHECK_FOR_HANDLE_LEAKS
     return static_cast<DeprecatedStringData **>(fastMalloc(sizeof(DeprecatedStringData *)));
 #endif
 
@@ -814,7 +816,7 @@ bool DeprecatedString::startsWith(const char *prefix) const
     }
 }
 
-#ifdef WIN32
+#if PLATFORM(WIN_OS)
 inline int strncasecmp(const char *first, const char *second, size_t maxLength)
 {
     return _strnicmp(first, second, maxLength);
@@ -2437,7 +2439,7 @@ static HandleNode *initializeHandleNodeBlock(HandlePageNode *pageNode)
     HandleNode* block;
     HandleNode* aNode;
 
-#ifdef WIN32
+#if PLATFORM(WIN_OS)
     block = (HandleNode*)VirtualAlloc(0, pageSize, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
 #else
     block = (HandleNode*)valloc(pageSize);
@@ -2506,7 +2508,7 @@ static HandleNode *allocateNode(HandlePageNode *pageNode)
 
 void freeHandle(DeprecatedStringData **_free)
 {
-#if CHECK_FOR_HANDLE_LEAKS
+#ifdef CHECK_FOR_HANDLE_LEAKS
     fastFree(_free);
     return;
 #endif
index 5b6cf3a4a87153626302f6a5a79b3889d32833f4..b25aa0f4f4152066ba55015bf8695ab4f90dc7dd 100644 (file)
@@ -33,7 +33,7 @@
 
 typedef struct CGPoint CGPoint;
 
-#if NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 typedef struct CGPoint NSPoint;
 #else
 typedef struct _NSPoint NSPoint;
@@ -63,7 +63,7 @@ public:
     FloatPoint(const CGPoint&);
     operator CGPoint() const;
 
-#if !NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
     FloatPoint(const NSPoint&);
     operator NSPoint() const;
 #endif
index 06f5b2d409d76a25ada0919e0e7d05eedbcf1799..0fb7c89a56605755d9eafbb93df38a3ad50cda79 100644 (file)
@@ -33,7 +33,7 @@
 
 typedef struct CGRect CGRect;
 
-#if NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 typedef struct CGRect NSRect;
 #else
 typedef struct _NSRect NSRect;
@@ -100,7 +100,7 @@ public:
     FloatRect(const CGRect&);
     operator CGRect() const;
 
-#if !NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
     FloatRect(const NSRect&);
     operator NSRect() const;
 #endif
index 346fc174736a519926f905aa93d8ebbf684fd9db..618815abe287f66b7225e17bdc5d52125f86860a 100644 (file)
@@ -31,7 +31,7 @@
 
 typedef struct CGSize CGSize;
 
-#if NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 typedef struct CGSize NSSize;
 #else
 typedef struct _NSSize NSSize;
@@ -118,6 +118,6 @@ inline bool operator!=(const FloatSize& a, const FloatSize& b)
     return a.width() != b.width() || a.height() != b.height();
 }
 
-}
+} // namespace WebCore
 
-#endif
+#endif // FloatSize_h
index 030741cae4d93182d5d347e65c2bfecb143b0a93..3bc3c66dde1a96830007a902d04ba7230940cf4e 100644 (file)
 #ifndef GraphicsContext_h
 #define GraphicsContext_h
 
-#include "Font.h"
 #include "FloatRect.h"
+#include "Font.h"
 #include "Image.h"
 #include "IntRect.h"
 #include "Pen.h"
 #include "TextDirection.h"
-#include <wtf/Noncopyable.h>
 #include <unicode/umachine.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/Platform.h>
 
+// FIXME: how should Cairo figure into the platform macros?
 #if __APPLE__
 typedef struct CGContext PlatformGraphicsContext;
-#elif WIN32
+#elif PLATFORM(WIN)
 typedef struct HDC__* HDC;
 typedef struct _cairo PlatformGraphicsContext;
 #elif PLATFORM(GDK)
@@ -158,7 +160,7 @@ namespace WebCore {
         KRenderingDeviceContext* createRenderingDeviceContext();
 #endif
 
-#if WIN32
+#if PLATFORM(WIN)
         GraphicsContext(HDC); // FIXME: To be removed.
 #endif
 
@@ -177,6 +179,6 @@ namespace WebCore {
         GraphicsContextPlatformPrivate* m_data;
     };
 
-}
+} // namespace WebCore
 
-#endif
+#endif // GraphicsContext_h
index 4b071da0aed99548d1ab2900d43ff7ee32091e83..8d1c8a1707e17869828bb5da8f37ded0738e9ff5 100644 (file)
@@ -34,7 +34,7 @@
 #include "FloatSize.h"
 
 #if __APPLE__
-#if __OBJC__
+#ifdef __OBJC__
 @class NSImage;
 #else
 class NSImage;
index 0291ea348f160ec4d86ba3bff41c6f6be80545a4..278c7793ce591efb8eb1a2520a972fe136f35fe0 100644 (file)
 #define INTPOINT_H_
 
 #include "IntSize.h"
+#include <wtf/Platform.h>
 
 #if __APPLE__
 
 typedef struct CGPoint CGPoint;
 
-#if NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 typedef struct CGPoint NSPoint;
 #else
 typedef struct _NSPoint NSPoint;
 #endif
 
-#endif
+#endif // __APPLE__
 
-#if WIN32
+#if PLATFORM(WIN)
 typedef struct tagPOINT POINT;
 #endif
 
@@ -64,14 +65,14 @@ public:
     explicit IntPoint(const CGPoint&); // don't do this implicitly since it's lossy
     operator CGPoint() const;
 
-#if !NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
     explicit IntPoint(const NSPoint&); // don't do this implicitly since it's lossy
     operator NSPoint() const;
 #endif
 
 #endif
 
-#if WIN32
+#if PLATFORM(WIN)
     IntPoint(const POINT&);
     operator POINT() const;
 #endif
@@ -117,6 +118,6 @@ inline bool operator!=(const IntPoint& a, const IntPoint& b)
     return a.x() != b.x() || a.y() != b.y();
 }
 
-}
+} // namespace WebCore
 
-#endif
+#endif // INTPOINT_H_
index cde166f0541c9502c7797e8c5348ff71876cf024..3fd066410774ab2c91388cc099c72706be6e1b1a 100644 (file)
 #define INTRECT_H_
 
 #include "IntPoint.h"
+#include <wtf/Platform.h>
 
 #if __APPLE__
 
 typedef struct CGRect CGRect;
 
-#if NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 typedef struct CGRect NSRect;
 #else
 typedef struct _NSRect NSRect;
 #endif
 
-#endif
+#endif // __APPLE__
 
-#if WIN32
+#if PLATFORM(WIN)
 typedef struct tagRECT RECT;
 #endif
 
@@ -90,18 +91,20 @@ public:
     void intersect(const IntRect&);
     void unite(const IntRect&);
 
-    void inflateX(int dx) {
+    void inflateX(int dx)
+    {
         m_location.setX(m_location.x() - dx);
         m_size.setWidth(m_size.width() + dx + dx);
     }
-    void inflateY(int dy) {
+    void inflateY(int dy)
+    {
         m_location.setY(m_location.y() - dy);
         m_size.setHeight(m_size.height() + dy + dy);
     }
     void inflate(int d) { inflateX(d); inflateY(d); }
     void scale(float s);
 
-#if WIN32
+#if PLATFORM(WIN)
     IntRect(const RECT&);
     operator RECT() const;
 #endif
@@ -110,7 +113,7 @@ public:
 
     operator CGRect() const;
 
-#if !NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
     operator NSRect() const;
 #endif
 
@@ -149,7 +152,7 @@ inline bool operator!=(const IntRect& a, const IntRect& b)
 
 IntRect enclosingIntRect(const CGRect&);
 
-#if !NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 
 IntRect enclosingIntRect(const NSRect&);
 
@@ -157,6 +160,6 @@ IntRect enclosingIntRect(const NSRect&);
 
 #endif
 
-}
+} // namespace WebCore
 
-#endif
+#endif // INTRECT_H_
index bd0cf38394529540fb34f2ff1d963ee57eca579e..d2cb6c5cb88c054a34a722966afcfdaa14732d31 100644 (file)
 #ifndef INTSIZE_H_
 #define INTSIZE_H_
 
+#include <wtf/Platform.h>
+
 #if __APPLE__
 
 typedef struct CGSize CGSize;
 
-#if NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 typedef struct CGSize NSSize;
 #else
 typedef struct _NSSize NSSize;
 #endif
 
-#endif
+#endif // __APPLE__
 
-#if WIN32
+#if PLATFORM(WIN)
 typedef struct tagSIZE SIZE;
 #endif
 
@@ -86,7 +88,7 @@ public:
 
 #endif
 
-#if WIN32
+#if PLATFORM(WIN)
     IntSize(const SIZE&);
     operator SIZE() const;
 #endif
@@ -134,6 +136,6 @@ inline bool operator!=(const IntSize& a, const IntSize& b)
     return a.width() != b.width() || a.height() != b.height();
 }
 
-}
+} // namespace WebCore
 
-#endif
+#endif // INTSIZE_H_
index 9470e3e98110a16dd2c9b830783d45003f4cf132..4cd984cabff43667bd7858cb1445f4975f259416 100644 (file)
@@ -27,6 +27,7 @@
 #define PlatformKeyboardEvent_h
 
 #include "PlatformString.h"
+#include <wtf/Platform.h>
 
 #ifdef __OBJC__
 @class NSEvent;
@@ -34,7 +35,7 @@
 class NSEvent;
 #endif
 
-#if WIN32
+#if PLATFORM(WIN)
 typedef struct HWND__ *HWND;
 typedef unsigned    WPARAM;
 typedef long        LPARAM;
@@ -65,7 +66,7 @@ namespace WebCore {
         PlatformKeyboardEvent(NSEvent*, bool forceAutoRepeat = false);
 #endif
 
-#ifdef WIN32
+#if PLATFORM(WIN)
         PlatformKeyboardEvent(HWND, WPARAM, LPARAM);
 #endif
 
index 13be8d161e82b13cdca2dafd9bd5aa5b1c441f57..8f74077fe183646af8419e0fab8c07f2f1e2f89c 100644 (file)
@@ -27,6 +27,7 @@
 #define PlatformMouseEvent_h
 
 #include "IntPoint.h"
+#include <wtf/Platform.h>
 
 #if __APPLE__
 #ifdef __OBJC__
@@ -36,7 +37,7 @@ class NSEvent;
 #endif
 #endif
 
-#if WIN32
+#if PLATFORM(WIN)
 typedef struct HWND__* HWND;
 typedef unsigned WPARAM;
 typedef long LPARAM;
@@ -93,7 +94,7 @@ namespace WebCore {
 #if __APPLE__
         PlatformMouseEvent(NSEvent*);
 #endif
-#if WIN32
+#if PLATFORM(WIN)
         PlatformMouseEvent(HWND, WPARAM, LPARAM, int clickCount);
 #endif
 #if PLATFORM(GDK) 
index 992ba4955811fa012f3dc812e0ad27c9c969a064..d1dae8fc813329422df6cd3680b46f6c53bcb861 100644 (file)
@@ -133,7 +133,7 @@ public:
     String(CFStringRef);
     CFStringRef createCFString() const { return m_impl ? m_impl->createCFString() : CFSTR(""); }
 #endif
-#if __OBJC__
+#ifdef __OBJC__
     String(NSString*);
     operator NSString*() const { if (!m_impl) return @""; return *m_impl; }
 #endif
index faa84a589ddb34d4d4e753942df762a370c9ea92..c06992ae08fc2766ecffaaf0af99539e1dc3a2ec 100644 (file)
 #ifndef ResourceLoader_H_
 #define ResourceLoader_H_
 
+#include "ResourceLoaderClient.h" // for PlatformResponse
 #include "StringHash.h"
 #include "Timer.h"
-#include "ResourceLoaderClient.h" // for PlatformResponse
 #include <wtf/HashMap.h>
+#include <wtf/Platform.h>
 
-#ifdef WIN32
+#if PLATFORM(WIN)
 typedef unsigned long DWORD;
 typedef unsigned long DWORD_PTR;
 typedef void* LPVOID;
@@ -82,7 +83,7 @@ public:
 #if __APPLE__
     void setLoader(WebCoreResourceLoaderImp*);
 #endif
-#if WIN32
+#if PLATFORM(WIN)
     void fileLoadTimer(Timer<ResourceLoader>* timer);
     friend void __stdcall transferJobStatusCallback(HINTERNET, DWORD_PTR, DWORD, LPVOID, DWORD);
     friend LRESULT __stdcall ResourceLoaderWndProc(HWND, unsigned message, WPARAM, LPARAM);
index 3e375083e0abd6f22530bf7776f040f31c521f8e..f228894d341796ad1d82090b106c914c96f78911 100644 (file)
 #ifndef ResourceLoaderInternal_H_
 #define ResourceLoaderInternal_H_
 
-#include "KURL.h"
 #include "FormData.h"
+#include "KURL.h"
 #include <wtf/HashMap.h>
+#include <wtf/Platform.h>
 
-#ifdef WIN32
+#if PLATFORM(WIN)
 typedef void* HANDLE;
 #endif
 
@@ -59,7 +60,7 @@ namespace WebCore {
             , loader(nil)
             , response(nil)
 #endif
-#if WIN32
+#if PLATFORM(WIN)
             , m_fileHandle(0)
             , m_fileLoadTimer(job, &ResourceLoader::fileLoadTimer)
             , m_resourceHandle(0)
@@ -89,7 +90,7 @@ namespace WebCore {
             , loader(nil)
             , response(nil)
 #endif
-#if WIN32
+#if PLATFORM(WIN)
             , m_fileHandle(0)
             , m_fileLoadTimer(job, &ResourceLoader::fileLoadTimer)
             , m_resourceHandle(0)
@@ -125,7 +126,7 @@ namespace WebCore {
         WebCoreResourceLoaderImp* loader;
         NSURLResponse* response;
 #endif
-#if WIN32
+#if PLATFORM(WIN)
         HANDLE m_fileHandle;
         Timer<ResourceLoader> m_fileLoadTimer;
         HINTERNET m_resourceHandle;
index 585d718e84b3054ec3684ebc3fe8a1c433bee2b8..af495d41be744716e46431a7ef5fa640bb20bfbc 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "ScrollBarMode.h"
 #include "Widget.h"
+#include <wtf/Platform.h>
 
 namespace WebCore {
     class FloatRect;
@@ -76,7 +77,7 @@ namespace WebCore {
         NSView* getDocumentView() const;
 #endif
 
-#if WIN32
+#if PLATFORM(WIN)
         ScrollView();
         ~ScrollView();
     private:
@@ -87,7 +88,7 @@ namespace WebCore {
         ScrollViewPrivate* m_data;
 #endif
 
-#if  PLATFORM(GDK)
+#if PLATFORM(GDK)
         void updateView(const IntRect&, bool now = false);
         virtual void setDrawable(GdkDrawable* drawable);
         virtual void setFrameGeometry(const IntRect&);
@@ -102,6 +103,6 @@ namespace WebCore {
 #endif
     };
 
-}
+} // namespace WebCore
 
-#endif
+#endif // ScrollView_H
index b65ff56f44cf6897271c614656a90b85487bdedc..448adcf7024f1f7ef3bf13ae97dba7d6d68862a6 100644 (file)
@@ -26,7 +26,7 @@
 // portable, and it would be good to figure out a 100% clean way that still avoids code that
 // runs at init time.
 
-#if !AVOID_STATIC_CONSTRUCTORS
+#ifndef AVOID_STATIC_CONSTRUCTORS
     // Define an global in the normal way.
 #define DEFINE_GLOBAL(type, name, ...) \
     const type name;
index 1be1ef87facdaa2281b315142ac1631028e9fbb4..d6e730144eeabc66279c2e1f9abf291fd899e4cb 100644 (file)
@@ -27,8 +27,8 @@
 #include "config.h"
 #include "StreamingTextDecoderICU.h"
 
-#include <wtf/Assertions.h>
 #include <unicode/unorm.h>
+#include <wtf/Assertions.h>
 
 using std::min;
 
@@ -273,7 +273,7 @@ DeprecatedString StreamingTextDecoderICU::convert(const unsigned char* chs, int
     }
 
     //#define PARTIAL_CHARACTER_HANDLING_TEST_CHUNK_SIZE 1000
-#if PARTIAL_CHARACTER_HANDLING_TEST_CHUNK_SIZE
+#ifdef PARTIAL_CHARACTER_HANDLING_TEST_CHUNK_SIZE
     DeprecatedString result;
     int chunkSize;
     for (int i = 0; i != len; i += chunkSize) {
index 0a553d0a4fc5046f147a2b9be0a5425437f87912..fb3c80676fbf4a804167bbf5c8276fc6aa23b163 100644 (file)
@@ -36,7 +36,7 @@
 #include <CoreFoundation/CoreFoundation.h>
 #endif
 
-#if __OBJC__
+#ifdef __OBJC__
 @class NSString;
 #endif
 
@@ -122,7 +122,7 @@ public:
     StringImpl(CFStringRef);
     CFStringRef createCFString() const;
 #endif
-#if __OBJC__
+#ifdef __OBJC__
     StringImpl(NSString*);
     operator NSString*() const;
 #endif
index 3ee78a4269760ca97f2f16664f0b438c84ef9053..f74a69995fe1d6576f2e50698d6148cbffa9fbe2 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef WEBCORE_PLATFORM_WIDGET_H_
 #define WEBCORE_PLATFORM_WIDGET_H_
 
+#include <wtf/Platform.h>
+
 #if __APPLE__
 #ifdef __OBJC__
 @class NSView;
@@ -34,7 +36,7 @@ class NSView;
 #endif
 #endif
 
-#if WIN32
+#if PLATFORM(WIN)
 typedef struct HWND__ *HWND;
 typedef struct HINSTANCE__ *HINSTANCE;
 #endif
@@ -125,7 +127,7 @@ namespace WebCore {
 
         virtual bool isFrameView() const;
 
-#if WIN32
+#if PLATFORM(WIN)
         Widget(HWND);
         HWND windowHandle() const;
         void setWindowHandle(HWND);
@@ -161,6 +163,6 @@ namespace WebCore {
         WidgetPrivate* data;
     };
 
-}
+} // namespace WebCore
 
-#endif
+#endif // WEBCORE_PLATFORM_WIDGET_H_
index da55e34250587fc41a1883e0f891108c4ad2c673..0ce50d7776e2f93a44d39eb1af98819b19ef7ff0 100644 (file)
@@ -25,6 +25,7 @@
 
 #import "config.h"
 #import "BlockExceptions.h"
+
 #import <wtf/Assertions.h>
 
 void ReportBlockedObjCException(NSException *localException)
index 086898bb32fa5ffe93591682b35e86f43f7f0095..50e8b2489ada744962e407a1304dab405d35fcd3 100644 (file)
@@ -66,7 +66,7 @@ NSColor* nsColor(const Color& color)
                 if (cachedRGBAValues[i] == c)
                     return cachedColors[i];
 
-#if COLORMATCH_EVERYTHING
+#ifdef COLORMATCH_EVERYTHING
             NSColor* result = [NSColor colorWithCalibratedRed:color.red() / 255.0
                                                         green:color.green() / 255.0
                                                          blue:color.blue() / 255.0
index 6e3a5692f97ae9078b2de217a476af184175b36e..ae019a65f200d61f03c60d5ef6d4f75c23652c6b 100644 (file)
@@ -38,7 +38,7 @@ FloatPoint::operator CGPoint() const
     return CGPointMake(m_x, m_y);
 }
 
-#if !NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 
 FloatPoint::FloatPoint(const NSPoint& p) : m_x(p.x), m_y(p.y)
 {
index 6b2d685e729a3680b6813cb5ff937a2f75455d0f..1e008dc2aee88ff25d1d770e501fffdceabb2b5a 100644 (file)
@@ -38,7 +38,7 @@ FloatRect::operator CGRect() const
     return CGRectMake(x(), y(), width(), height());
 }
 
-#if !NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 
 FloatRect::FloatRect(const NSRect& r) : m_location(r.origin), m_size(r.size)
 {
index 6b45b23700f4006542c75de5a7e4cb416e82ab75..e43ae39cff73ced8cd54b8bff926cedc38b7a6d4 100644 (file)
@@ -38,7 +38,7 @@ FloatSize::operator CGSize() const
     return CGSizeMake(m_width, m_height);
 }
 
-#if !NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 
 FloatSize::FloatSize(const NSSize& s) : m_width(s.width), m_height(s.height)
 {
index cc3769e5a3565c44ce2c4260527ff0082607acc4..39bc24b8365dcbf04f84721b4d6b66d5f721a6c3 100644 (file)
@@ -47,7 +47,7 @@
 #define LEFT_TO_RIGHT_OVERRIDE 0x202D
 #define RIGHT_TO_LEFT_OVERRIDE 0x202E
 
-#if defined(__LP64__)
+#ifdef __LP64__
 #define URefCon void*
 #else
 #define URefCon UInt32
index bb4da2fb9255871f6ddab62a11389f42081261d4..b7c85a131ef48ad861b78705e3e1ba0394554289 100644 (file)
@@ -106,7 +106,7 @@ void GraphicsContext::drawFocusRing(const Color& color)
     ASSERT(view);
 
     const NSRect* drawRects;
-#if defined(__LP64__)
+#ifdef __LP64__
     long count;
 #else
     int count;
index def40409bf231d0362d3f88ba07df6bfc2a654e2..8eb012ef678563f7490173cb081501b440ac81a5 100644 (file)
@@ -37,7 +37,7 @@ IntPoint::operator CGPoint() const
     return CGPointMake(m_x, m_y);
 }
 
-#if !NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 
 IntPoint::IntPoint(const NSPoint& p) : m_x(static_cast<int>(p.x)), m_y(static_cast<int>(p.y))
 {
index f4bc11b2bf1efbd40aa9059aa87d1f894b65fe03..7997919ec7fef538715281027169f5e651ce1133 100644 (file)
@@ -42,7 +42,7 @@ IntRect enclosingIntRect(const CGRect& rect)
     return IntRect(l, t, r - l, b - t);
 }
 
-#if !NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 
 IntRect::operator NSRect() const
 {
index b7848671a0cb81a1b70180448827ec89bca53dcb..a80eaca0f3de06834ba63b156d65e9a41ef9aa7b 100644 (file)
@@ -37,7 +37,7 @@ IntSize::operator CGSize() const
     return CGSizeMake(m_width, m_height);
 }
 
-#if !NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 
 IntSize::IntSize(const NSSize& s) : m_width(static_cast<int>(s.width)), m_height(static_cast<int>(s.height))
 {
index e438fd61d6090cf14b4f8caed24e0ab3b97f85e3..08e1d22b5f03e9650109fd1376aadc9cf2169e4c 100644 (file)
@@ -32,7 +32,7 @@ typedef signed char BOOL;
 typedef struct CGRect CGRect;
 #endif
 
-#if NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 typedef struct CGRect NSRect;
 #else
 typedef struct _NSRect NSRect;
@@ -42,7 +42,7 @@ typedef struct _NSRect NSRect;
 typedef struct CGPoint CGPoint;
 #endif
 
-#if NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
 typedef struct CGPoint NSPoint;
 #else
 typedef struct _NSPoint NSPoint;
index f7057ca33fa7d051fe16dcf26a914605dad19b9f..244e8a858cbd308e75b843364ee3943876898393 100644 (file)
@@ -266,7 +266,7 @@ public:
     int leftSelectionOffset(RenderBlock* rootBlock, int y);
     int rightSelectionOffset(RenderBlock* rootBlock, int y);
 
-#if !NDEBUG
+#ifndef NDEBUG
     virtual void dump(TextStream *stream, DeprecatedString ind = "") const;
 #endif
 
index 990c9e2aa9c3b62b01d339764cf080a03fc2b087..f63a0ecae7bf6ba7b9799fc143168f5c1b5a879b 100644 (file)
@@ -100,7 +100,7 @@ public:
     RenderTable* table() const { return static_cast<RenderTable*>(parent()->parent()->parent()); }
     RenderTableSection* section() const { return static_cast<RenderTableSection*>(parent()->parent()); }
 
-#if !NDEBUG
+#ifndef NDEBUG
     virtual void dump(TextStream *stream, DeprecatedString ind = "") const;
 #endif
 
index 90121fb54fdf28bf60fb1a7a34499669284d61c8..e61831be266429d76a7f4cbf4a34e65d59f92a40 100644 (file)
@@ -595,7 +595,7 @@ static void appendRun(BidiState &bidi)
 {
     if (emptyRun || !bidi.eor.obj)
         return;
-#if BIDI_DEBUG > 1
+#if defined(BIDI_DEBUG) && BIDI_DEBUG > 1
     kdDebug(6041) << "appendRun: dir="<<(int)dir<<endl;
 #endif
 
@@ -1759,7 +1759,7 @@ IntRect RenderBlock::layoutInlineChildren(bool relayoutChildren)
 
     return repaintRect;
 
-#if BIDI_DEBUG > 1
+#if defined(BIDI_DEBUG) && BIDI_DEBUG > 1
     kdDebug(6041) << " ------- bidi end " << this << " -------" << endl;
 #endif
 }
index 236b0551e386722dd1b90fe7ecac5dc7d4d5e8ca..f3d2b47fb42360f6283f04c42d8d0b815de282e3 100644 (file)
 #include "HTMLDocument.h"
 #include "HTMLTokenizer.h"
 #include "LoaderFunctions.h"
-#include "Text.h"
 #include "ResourceLoader.h"
+#include "Text.h"
 #include "loader.h"
 #include "markup.h"
-#include <wtf/Vector.h>
 #include <libxslt/imports.h>
 #include <libxslt/variables.h>
 #include <libxslt/xsltutils.h>
+#include <wtf/Assertions.h>
+#include <wtf/Platform.h>
+#include <wtf/Vector.h>
 
 namespace WebCore {
 
 static void parseErrorFunc(void *ctxt, const char *msg, ...)
 {
     // FIXME: It would be nice to display error messages somewhere.
-#if !WIN32
+#if !PLATFORM(WIN_OS)
     // FIXME: No vasprintf support.
-#if !ERROR_DISABLED
+#ifndef ERROR_DISABLED
     char *errorMessage = 0;
     va_list args;
     va_start(args, msg);
@@ -376,6 +378,6 @@ void XSLTProcessor::removeParameter(StringImpl *namespaceURI, StringImpl *localN
     m_parameters.remove(localName);
 }
 
-}
+} // namespace WebCore
 
-#endif
+#endif // KHTML_XSLT
index ad0a50a4e3e4e160811b6725b766d541988b4adc..cb507159a8ccd28477451bdf33aef8da7cf204cd 100644 (file)
@@ -38,6 +38,7 @@
 #include "XPathVariableReference.h"
 
 #define YYDEBUG 0
+#define YYMAXDEPTH 10000
 #define YYPARSE_PARAM parserParameter
 #define PARSER static_cast<Parser*>(parserParameter)
 
index 982bc2e6cdf9aed598caf282d02634783c36548f..4a6548ff8f31b8456f0af5ad88a041e276a40f71 100644 (file)
@@ -27,7 +27,7 @@
  */
 
 // <rdar://problem/4561772> HIWebView needs to be reworked to not use QuickDraw, needed for 64-bit
-#if !__LP64__
+#ifndef __LP64__
 
 #include "CarbonUtils.h"
 #import <WebKitSystemInterface.h>
index 87b5913d42acba448a73ce3abd3a4a018ffbb0bb..bb4d848b1df3f882c86f7c77d3e662785cd5a9b0 100644 (file)
@@ -410,7 +410,7 @@ static OSStatus NSCarbonWindowHandleEvent(EventHandlerCallRef inEventHandlerCall
 }
 
 // FIXME: <rdar://problem/4561772> HIWebView and HIViewAdapter need to be reworked for 64-bit
-#if !__LP64__
+#ifndef __LP64__
 
 - (BOOL)makeFirstResponder:(NSResponder *)aResponder
 {
@@ -613,7 +613,7 @@ static OSStatus NSCarbonWindowHandleEvent(EventHandlerCallRef inEventHandlerCall
 }
 
 // FIXME: <rdar://problem/4561772> HIWebView and HIViewAdapter need to be reworked for 64-bit
-#if !__LP64__
+#ifndef __LP64__
 
 - (void)selectKeyViewFollowingView:(NSView *)aView {
        HIViewRef       view = NULL;
index 39cc86c33d96ea9d93f1c46f09efac7b3555e83d..dd687a47f853d6be3fdb48f852591520db24816a 100644 (file)
@@ -27,7 +27,7 @@
  */
 
 // <rdar://problem/4561772> HIWebView needs to be reworked to not use QuickDraw, needed for 64-bit
-#if !__LP64__
+#ifndef __LP64__
 
 #import "HIViewAdapter.h"
 
@@ -65,7 +65,7 @@ static NSView *_webkit_NSView_nextValidKeyView(id self, SEL _cmd);
         Method setNeedsDisplayMethod = class_getInstanceMethod(objc_getClass("NSView"), @selector(setNeedsDisplay:));
         ASSERT(setNeedsDisplayMethod);
         ASSERT(!oldNSViewSetNeedsDisplayIMP);
-#if OBJC_API_VERSION > 0
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION > 0
         oldNSViewSetNeedsDisplayIMP = method_setImplementation(setNeedsDisplayMethod, (IMP)_webkit_NSView_setNeedsDisplay);
 #else
         oldNSViewSetNeedsDisplayIMP = setNeedsDisplayMethod->method_imp;
@@ -76,7 +76,7 @@ static NSView *_webkit_NSView_nextValidKeyView(id self, SEL _cmd);
         Method setNeedsDisplayInRectMethod = class_getInstanceMethod(objc_getClass("NSView"), @selector(setNeedsDisplayInRect:));
         ASSERT(setNeedsDisplayInRectMethod);
         ASSERT(!oldNSViewSetNeedsDisplayInRectIMP);
-#if OBJC_API_VERSION > 0
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION > 0
         oldNSViewSetNeedsDisplayInRectIMP = method_setImplementation(setNeedsDisplayInRectMethod, (IMP)_webkit_NSView_setNeedsDisplayInRect);
 #else
         oldNSViewSetNeedsDisplayInRectIMP = setNeedsDisplayInRectMethod->method_imp;
@@ -87,7 +87,7 @@ static NSView *_webkit_NSView_nextValidKeyView(id self, SEL _cmd);
         Method nextValidKeyViewMethod = class_getInstanceMethod(objc_getClass("NSView"), @selector(nextValidKeyView));
         ASSERT(nextValidKeyViewMethod);
         ASSERT(!oldNSViewNextValidKeyViewIMP);
-#if OBJC_API_VERSION > 0
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION > 0
         oldNSViewNextValidKeyViewIMP = method_setImplementation(nextValidKeyViewMethod, (IMP)_webkit_NSView_nextValidKeyView);
 #else
         oldNSViewNextValidKeyViewIMP = nextValidKeyViewMethod->method_imp;
index f27f04e89e25469ab621386ede1e489b69c4238e..b53c930814527218bd132779dce0c14801a0d44c 100644 (file)
@@ -27,7 +27,7 @@
  */
 
 // <rdar://problem/4561772> HIWebView needs to be reworked to not use QuickDraw, needed for 64-bit
-#if !__LP64__
+#ifndef __LP64__
 
 #include "HIWebView.h"
 
@@ -1400,7 +1400,7 @@ HIWebViewEventHandler(
                                        GetEventParameter( inEvent, kEventParamControlDataBuffer, typePtr, NULL,
                                                        sizeof( Ptr ), NULL, &ptr );
 
-#if __LP64__
+#ifdef __LP64__
                                        GetEventParameter(inEvent, kEventParamControlDataBufferSize, typeSInt64, NULL, sizeof(Size), NULL, &size);
 #else
                                        GetEventParameter(inEvent, kEventParamControlDataBufferSize, typeSInt32, NULL, sizeof(Size), NULL, &size);
@@ -1421,7 +1421,7 @@ HIWebViewEventHandler(
                                                }
 
                                                outSize = sizeof( ControlKind );
-#if __LP64__
+#ifdef __LP64__
                         SetEventParameter(inEvent, kEventParamControlDataBufferSize, typeSInt64, sizeof(Size), &outSize);
 #else
                         SetEventParameter(inEvent, kEventParamControlDataBufferSize, typeSInt32, sizeof(Size), &outSize);
index 15a53eb600ba96e97873a8aca7ae125f74b32de9..8594b8af3723ec0d590e1d834bc344500f03525f 100644 (file)
@@ -1,3 +1,32 @@
+2006-08-03  Sam Weinig  <sam.weinig@gmail.com>
+
+        Reviewed by Darin.
+
+        - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10176
+          Make WebCore compile with -Wundef
+
+          * Adds -Wundef flag to Xcode project
+          * Converts #ifs to #ifdef and #ifndefs where needed.
+
+        * Carbon/CarbonUtils.m:
+        * Carbon/CarbonWindowAdapter.m:
+        * Carbon/HIViewAdapter.m:
+        (+[NSView bindHIViewToNSView:nsView:]):
+        * Carbon/HIWebView.m:
+        (HIWebViewEventHandler):
+        * Misc/WebFileDatabase.m:
+        (UniqueFilePathForKey):
+        * Misc/WebNSWindowExtras.m:
+        (swizzleInstanceMethod):
+        * Misc/WebTypesInternal.h:
+        * Plugins/WebNetscapeDeprecatedFunctions.c:
+        * Plugins/WebNetscapeDeprecatedFunctions.h:
+        * Plugins/WebNetscapePluginPackage.h:
+        * Plugins/WebNetscapePluginPackage.m:
+        (-[WebNetscapePluginPackage unloadWithoutShutdown]):
+        (-[WebNetscapePluginPackage load]):
+        * WebKit.xcodeproj/project.pbxproj:
+
 2006-08-03  Darin Adler  <darin@apple.com>
 
         Reviewed by Eric Seidel.
index ec666c9af2fe37d248115ec37ba7d47a1a3106fa..19174c2dc07979a2a47183a9a9162402495992fe 100644 (file)
@@ -210,7 +210,7 @@ static void UniqueFilePathForKey(id key, char *buffer)
         hash2 = (37 * hash2) ^ s[cnt];
     }
 
-#if __LP64__
+#ifdef __LP64__
     snprintf(buffer, UniqueFilePathSize, "%.2u/%.2u/%.10u-%.10u.cache", ((hash1 & 0xff) >> 4), ((hash2 & 0xff) >> 4), hash1, hash2);
 #else
     snprintf(buffer, UniqueFilePathSize, "%.2lu/%.2lu/%.10lu-%.10lu.cache", ((hash1 & 0xff) >> 4), ((hash2 & 0xff) >> 4), hash1, hash2);
index 37f9da197f1324b8edc34ec22a0226dab7bf2db1..42056be9e2758ffbd4ad442ef5048a39e3318978 100644 (file)
@@ -161,7 +161,7 @@ static IMP swizzleInstanceMethod(Class class, SEL selector, IMP newImplementatio
     Method method = class_getInstanceMethod(class, selector);
     ASSERT(method);
     IMP oldIMP;
-#if OBJC_API_VERSION > 0
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION > 0
     oldIMP = method_setImplementation(method, newImplementation);
 #else
     oldIMP = method->method_imp;
index 44dcc48045e1ee6ba2715378dd4d3caf87fa74af..b9f12cb20c15094ad57b226725f18616f78aa7e5 100644 (file)
@@ -35,7 +35,7 @@ typedef NSUInteger WebNSUInteger;
 #endif
 
 #ifndef CGFLOAT_DEFINED
-#if __LP64__
+#ifdef __LP64__
 typedef double CGFloat;
 #else
 typedef float CGFloat;
index 4efeab473c8dbe6a6f4bc21dd58a3cc86d48e6b0..a370728ce15493162a12853f6fae0fefe3dcca1f 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "WebNetscapeDeprecatedFunctions.h"
 
-#if !__LP64__
+#ifndef __LP64__
 
 OSErr WebGetDiskFragment(const FSSpec *fileSpec, UInt32 offset, UInt32 length, ConstStr63Param fragName, CFragLoadOptions options, CFragConnectionID *connID, Ptr *mainAddr, Str255 errMessage)
 {
index 6b600e7019af4e15791ec0d0b4ee09d2b77ce976..f1390a48eeb1248022e3043ba496ba9d550883f8 100644 (file)
@@ -7,7 +7,7 @@
  *
  */
 
-#if !__LP64__
+#ifndef __LP64__
 
 #import <CoreServices/CoreServices.h>
 
index 10dbbd39a5560dc345dd910cacb946669e10847f..85be8f8251607397a9f3dfa14bb6b4e0a391aaef 100644 (file)
@@ -44,7 +44,7 @@ typedef enum {
     uint16 pluginSize;
     uint16 pluginVersion;
         
-#if !__LP64__
+#ifndef __LP64__
     // CFM is not supported in 64-bit
     CFragConnectionID connID;
 #endif
index da399befb9e0c90a7e0601d1497cfc2c32f2f764..635800b14c005668429caea91f13f4ac9d338e9f 100644 (file)
@@ -50,7 +50,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
 
 @implementation WebNetscapePluginPackage
 
-#if !__LP64__
+#ifndef __LP64__
 + (void)initialize
 {
     // The Shockwave plugin requires a valid file in CurApRefNum.
@@ -265,7 +265,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
     if (isBundle)
         CFBundleUnloadExecutable(cfBundle);
     else
-#if !__LP64__
+#ifndef __LP64__
         // CFM is not supported in 64-bit
         WebCloseConnection(&connID);
 #endif
@@ -326,7 +326,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
                 goto abort;
         }
     } else {
-#if __LP64__
+#ifdef __LP64__
         // CFM is not supported in 64-bit
         goto abort;
 #else
index 23d108185994c0d46154973360f8a6d5532b2c31..de0c7b0ee868b27856f97c55021265903f02fe96 100644 (file)
                                        "-Wbad-function-cast",
                                        "-Wmissing-declarations",
                                        "-Wnested-externs",
+                                       "-Wundef",
                                );
                        };
                        name = Debug;
                                        "-Wbad-function-cast",
                                        "-Wmissing-declarations",
                                        "-Wnested-externs",
+                                       "-Wundef",
                                );
                        };
                        name = Release;
                                        "-Wbad-function-cast",
                                        "-Wmissing-declarations",
                                        "-Wnested-externs",
+                                       "-Wundef",
                                );
                        };
                        name = Production;