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
+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.
"-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;
jobject JavaJSObject::getSlot(jint index) const
{
-#if __LP64__
+#ifdef __LP64__
JS_LOG ("index = %d\n", index);
#else
JS_LOG ("index = %ld\n", index);
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);
#ifndef _UINT32
#define _UINT32
-#if __LP64__
+#ifdef __LP64__
typedef unsigned int uint32;
#else /* __LP64__ */
typedef unsigned long uint32;
#ifndef _INT32
#define _INT32
-#if __LP64__
+#ifdef __LP64__
typedef int int32;
#else /* __LP64__ */
typedef long int32;
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
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);
break;
}
}
-#if OBJC_API_VERSION >= 2
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2
thisClass = class_getSuperclass(thisClass);
free(objcMethodList);
#else
// 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
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
break;
}
}
-#if OBJC_API_VERSION >= 2
+#if defined(OBJC_API_VERSION) && OBJC_API_VERSION >= 2
thisClass = class_getSuperclass(thisClass);
free(ivarsInClass);
#else
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()];
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];
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
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
// 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)
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()
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;
#undef KJS_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL
#endif
-}
+} // namespace KJS
-#endif
+#endif // KJS_IDENTIFIER_H
+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.
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;
+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.
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;
- (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);
#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;
#define CGFLOAT_DEFINED 1
#endif
-#endif
+#endif /* __APPLE__ */
+
-#if WIN32
+#if PLATFORM(WIN_OS)
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0500
// 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
#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
return val->id;
}
+#define YYMAXDEPTH 10000
#define YYDEBUG 0
#define YYPARSE_PARAM parser
#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)
}
}
-} }
+} // namespace MediaFeatureNames
+} // namespace WebCore
#include "AtomicString.h"
-namespace WebCore { namespace MediaFeatureNames {
+namespace WebCore {
+ namespace MediaFeatureNames {
#define CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(macro) \
macro(color, "color") \
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
return context.failed();
}
-#if CSS_DEBUG
+#ifdef CSS_DEBUG
static inline int yyerror(const char *str)
{
// 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
// 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)
void Element::attach()
{
-#if SPEED_DEBUG < 1
+#if !defined(SPEED_DEBUG) || SPEED_DEBUG < 1
createRendererIfNeeded();
#endif
ContainerNode::attach();
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
#include "config.h"
-#if AVOID_STATIC_CONSTRUCTORS
+#ifdef AVOID_STATIC_CONSTRUCTORS
#define DOM_EVENT_NAMES_HIDE_GLOBALS 1
#endif
\
// 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
#include "Element.h"
#include "NamedNodeMap.h"
-#if __OBJC__
+#ifdef __OBJC__
#define id id_AVOID_KEYWORD
#endif
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
{
#include "config.h"
-#if AVOID_STATIC_CONSTRUCTORS
+#ifdef AVOID_STATIC_CONSTRUCTORS
#define WEBCORE_QUALIFIEDNAME_HIDE_GLOBALS 1
#else
#define QNAME_DEFAULT_CONSTRUCTOR
QualifiedNameImpl* m_impl;
};
-#if !WEBCORE_QUALIFIEDNAME_HIDE_GLOBALS
+#ifndef WEBCORE_QUALIFIEDNAME_HIDE_GLOBALS
extern const QualifiedName anyName;
inline const QualifiedName& anyQName() { return anyName; }
#endif
Position editingStartPosition() const;
-#if !NDEBUG
- void formatForDebugger(char *buffer, unsigned length) const;
+#ifndef NDEBUG
+ void formatForDebugger(char* buffer, unsigned length) const;
#endif
private:
#include "ResourceLoader.h"
#include <libxml/parser.h>
#include <libxml/parserInternals.h>
+#include <wtf/Platform.h>
#include <wtf/Vector.h>
#ifdef KHTML_XSLT
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 *);
if (m_parserStopped)
return;
-#if WIN32
+#if PLATFORM(WIN_OS)
char m[1024];
vsnprintf(m, sizeof(m) - 1, message, args);
#else
else
handleError(type, m, lineNumber(), columnNumber());
-#if !WIN32
+#if !PLATFORM(WIN_OS)
free(m);
#endif
}
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) ))
} 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;
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
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
}
case TagName:
{
-#if defined(TOKEN_DEBUG) && TOKEN_DEBUG > 1
+#if defined(TOKEN_DEBUG) && TOKEN_DEBUG > 1
qDebug("TagName");
#endif
if (searchCount > 0)
(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
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
}
}
-#if INSTRUMENT_LAYOUT_SCHEDULING
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
if (!m_doc->ownerElement())
printf("Ending write at time %d\n", m_doc->elapsedTime());
#endif
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
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
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
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
#import "KCanvasFilters.h"
-#if __OBJC__
+#ifdef __OBJC__
@class CIFilter;
@class CIImage;
#else
typedef struct CGRect CGRect;
typedef struct CGContext *CGContextRef;
-#if __OBJC__
+#ifdef __OBJC__
@class NSGraphicsContext;
#else
class NSGraphicsContext;
#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
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> {
}
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";
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";
#include <wtf/Vector.h>
#include <time.h>
-#if __OBJC__
+#ifdef __OBJC__
@class NSData;
@class NSURLResponse;
#else
#include <wtf/Vector.h>
-#if __OBJC__
+#ifdef __OBJC__
@class NSDictionary;
@class NSString;
@class NSURLResponse;
#include <wtf/HashMap.h>
#include "DeprecatedPtrList.h"
-#if __OBJC__
+#ifdef __OBJC__
@class NSData;
@class NSURLResponse;
#else
#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
#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;
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
}
} 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
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
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
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
#include "config.h"
-#if AVOID_STATIC_CONSTRUCTORS
+#ifdef AVOID_STATIC_CONSTRUCTORS
#define ATOMICSTRING_HIDE_GLOBALS 1
#endif
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;
extern const AtomicString starAtom;
#endif
-}
+} // namespace WebCore
-#endif
+#endif // AtomicString_h
#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>
class Image;
-#ifdef WIN32
+#if PLATFORM(WIN)
typedef HCURSOR PlatformCursor;
#elif defined(__APPLE__)
typedef NSCursor* PlatformCursor;
const Cursor& columnResizeCursor();
const Cursor& rowResizeCursor();
-}
+} // namespace WebCore
-#endif
+#endif // CURSOR_H
#define ARRAY_H_
#include "ArrayImpl.h"
+#include <wtf/Platform.h>
namespace WebCore {
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); }
typedef DeprecatedArray<char> DeprecatedByteArray;
-}
+} // namespace WebCore
-#endif
+#endif // ARRAY_H_
#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
static inline DeprecatedStringData **allocateHandle()
{
-#if CHECK_FOR_HANDLE_LEAKS
+#ifdef CHECK_FOR_HANDLE_LEAKS
return static_cast<DeprecatedStringData **>(fastMalloc(sizeof(DeprecatedStringData *)));
#endif
}
}
-#ifdef WIN32
+#if PLATFORM(WIN_OS)
inline int strncasecmp(const char *first, const char *second, size_t maxLength)
{
return _strnicmp(first, second, maxLength);
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);
void freeHandle(DeprecatedStringData **_free)
{
-#if CHECK_FOR_HANDLE_LEAKS
+#ifdef CHECK_FOR_HANDLE_LEAKS
fastFree(_free);
return;
#endif
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;
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
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;
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
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;
return a.width() != b.width() || a.height() != b.height();
}
-}
+} // namespace WebCore
-#endif
+#endif // FloatSize_h
#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)
KRenderingDeviceContext* createRenderingDeviceContext();
#endif
-#if WIN32
+#if PLATFORM(WIN)
GraphicsContext(HDC); // FIXME: To be removed.
#endif
GraphicsContextPlatformPrivate* m_data;
};
-}
+} // namespace WebCore
-#endif
+#endif // GraphicsContext_h
#include "FloatSize.h"
#if __APPLE__
-#if __OBJC__
+#ifdef __OBJC__
@class NSImage;
#else
class NSImage;
#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
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
return a.x() != b.x() || a.y() != b.y();
}
-}
+} // namespace WebCore
-#endif
+#endif // INTPOINT_H_
#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
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
operator CGRect() const;
-#if !NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
operator NSRect() const;
#endif
IntRect enclosingIntRect(const CGRect&);
-#if !NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
+#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
IntRect enclosingIntRect(const NSRect&);
#endif
-}
+} // namespace WebCore
-#endif
+#endif // INTRECT_H_
#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
#endif
-#if WIN32
+#if PLATFORM(WIN)
IntSize(const SIZE&);
operator SIZE() const;
#endif
return a.width() != b.width() || a.height() != b.height();
}
-}
+} // namespace WebCore
-#endif
+#endif // INTSIZE_H_
#define PlatformKeyboardEvent_h
#include "PlatformString.h"
+#include <wtf/Platform.h>
#ifdef __OBJC__
@class NSEvent;
class NSEvent;
#endif
-#if WIN32
+#if PLATFORM(WIN)
typedef struct HWND__ *HWND;
typedef unsigned WPARAM;
typedef long LPARAM;
PlatformKeyboardEvent(NSEvent*, bool forceAutoRepeat = false);
#endif
-#ifdef WIN32
+#if PLATFORM(WIN)
PlatformKeyboardEvent(HWND, WPARAM, LPARAM);
#endif
#define PlatformMouseEvent_h
#include "IntPoint.h"
+#include <wtf/Platform.h>
#if __APPLE__
#ifdef __OBJC__
#endif
#endif
-#if WIN32
+#if PLATFORM(WIN)
typedef struct HWND__* HWND;
typedef unsigned WPARAM;
typedef long LPARAM;
#if __APPLE__
PlatformMouseEvent(NSEvent*);
#endif
-#if WIN32
+#if PLATFORM(WIN)
PlatformMouseEvent(HWND, WPARAM, LPARAM, int clickCount);
#endif
#if PLATFORM(GDK)
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
#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;
#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);
#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
, loader(nil)
, response(nil)
#endif
-#if WIN32
+#if PLATFORM(WIN)
, m_fileHandle(0)
, m_fileLoadTimer(job, &ResourceLoader::fileLoadTimer)
, m_resourceHandle(0)
, loader(nil)
, response(nil)
#endif
-#if WIN32
+#if PLATFORM(WIN)
, m_fileHandle(0)
, m_fileLoadTimer(job, &ResourceLoader::fileLoadTimer)
, m_resourceHandle(0)
WebCoreResourceLoaderImp* loader;
NSURLResponse* response;
#endif
-#if WIN32
+#if PLATFORM(WIN)
HANDLE m_fileHandle;
Timer<ResourceLoader> m_fileLoadTimer;
HINTERNET m_resourceHandle;
#include "ScrollBarMode.h"
#include "Widget.h"
+#include <wtf/Platform.h>
namespace WebCore {
class FloatRect;
NSView* getDocumentView() const;
#endif
-#if WIN32
+#if PLATFORM(WIN)
ScrollView();
~ScrollView();
private:
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&);
#endif
};
-}
+} // namespace WebCore
-#endif
+#endif // ScrollView_H
// 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;
#include "config.h"
#include "StreamingTextDecoderICU.h"
-#include <wtf/Assertions.h>
#include <unicode/unorm.h>
+#include <wtf/Assertions.h>
using std::min;
}
//#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) {
#include <CoreFoundation/CoreFoundation.h>
#endif
-#if __OBJC__
+#ifdef __OBJC__
@class NSString;
#endif
StringImpl(CFStringRef);
CFStringRef createCFString() const;
#endif
-#if __OBJC__
+#ifdef __OBJC__
StringImpl(NSString*);
operator NSString*() const;
#endif
#ifndef WEBCORE_PLATFORM_WIDGET_H_
#define WEBCORE_PLATFORM_WIDGET_H_
+#include <wtf/Platform.h>
+
#if __APPLE__
#ifdef __OBJC__
@class NSView;
#endif
#endif
-#if WIN32
+#if PLATFORM(WIN)
typedef struct HWND__ *HWND;
typedef struct HINSTANCE__ *HINSTANCE;
#endif
virtual bool isFrameView() const;
-#if WIN32
+#if PLATFORM(WIN)
Widget(HWND);
HWND windowHandle() const;
void setWindowHandle(HWND);
WidgetPrivate* data;
};
-}
+} // namespace WebCore
-#endif
+#endif // WEBCORE_PLATFORM_WIDGET_H_
#import "config.h"
#import "BlockExceptions.h"
+
#import <wtf/Assertions.h>
void ReportBlockedObjCException(NSException *localException)
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
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)
{
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)
{
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)
{
#define LEFT_TO_RIGHT_OVERRIDE 0x202D
#define RIGHT_TO_LEFT_OVERRIDE 0x202E
-#if defined(__LP64__)
+#ifdef __LP64__
#define URefCon void*
#else
#define URefCon UInt32
ASSERT(view);
const NSRect* drawRects;
-#if defined(__LP64__)
+#ifdef __LP64__
long count;
#else
int count;
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))
{
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
{
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))
{
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;
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;
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
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
{
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
return repaintRect;
-#if BIDI_DEBUG > 1
+#if defined(BIDI_DEBUG) && BIDI_DEBUG > 1
kdDebug(6041) << " ------- bidi end " << this << " -------" << endl;
#endif
}
#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);
m_parameters.remove(localName);
}
-}
+} // namespace WebCore
-#endif
+#endif // KHTML_XSLT
#include "XPathVariableReference.h"
#define YYDEBUG 0
+#define YYMAXDEPTH 10000
#define YYPARSE_PARAM parserParameter
#define PARSER static_cast<Parser*>(parserParameter)
*/
// <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>
}
// FIXME: <rdar://problem/4561772> HIWebView and HIViewAdapter need to be reworked for 64-bit
-#if !__LP64__
+#ifndef __LP64__
- (BOOL)makeFirstResponder:(NSResponder *)aResponder
{
}
// 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;
*/
// <rdar://problem/4561772> HIWebView needs to be reworked to not use QuickDraw, needed for 64-bit
-#if !__LP64__
+#ifndef __LP64__
#import "HIViewAdapter.h"
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;
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;
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;
*/
// <rdar://problem/4561772> HIWebView needs to be reworked to not use QuickDraw, needed for 64-bit
-#if !__LP64__
+#ifndef __LP64__
#include "HIWebView.h"
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);
}
outSize = sizeof( ControlKind );
-#if __LP64__
+#ifdef __LP64__
SetEventParameter(inEvent, kEventParamControlDataBufferSize, typeSInt64, sizeof(Size), &outSize);
#else
SetEventParameter(inEvent, kEventParamControlDataBufferSize, typeSInt32, sizeof(Size), &outSize);
+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.
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);
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;
#endif
#ifndef CGFLOAT_DEFINED
-#if __LP64__
+#ifdef __LP64__
typedef double CGFloat;
#else
typedef float CGFloat;
#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)
{
*
*/
-#if !__LP64__
+#ifndef __LP64__
#import <CoreServices/CoreServices.h>
uint16 pluginSize;
uint16 pluginVersion;
-#if !__LP64__
+#ifndef __LP64__
// CFM is not supported in 64-bit
CFragConnectionID connID;
#endif
@implementation WebNetscapePluginPackage
-#if !__LP64__
+#ifndef __LP64__
+ (void)initialize
{
// The Shockwave plugin requires a valid file in CurApRefNum.
if (isBundle)
CFBundleUnloadExecutable(cfBundle);
else
-#if !__LP64__
+#ifndef __LP64__
// CFM is not supported in 64-bit
WebCloseConnection(&connID);
#endif
goto abort;
}
} else {
-#if __LP64__
+#ifdef __LP64__
// CFM is not supported in 64-bit
goto abort;
#else
"-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;