Build WebKit as C++11 on Mac
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Oct 2012 18:07:13 +0000 (18:07 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Oct 2012 18:07:13 +0000 (18:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=100720

Reviewed by Daniel Bates.

Source/JavaScriptCore:

* Configurations/Base.xcconfig:
Add CLANG_CXX_LANGUAGE_STANDARD=gnu++0x.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::generate):
(JSC::BytecodeGenerator::pushFinallyContext):
(JSC::BytecodeGenerator::beginSwitch):
* llint/LLIntOffsetsExtractor.cpp:
* runtime/Identifier.cpp:
(JSC::Identifier::add8):
* runtime/Identifier.h:
(JSC::Identifier::add):
* runtime/JSONObject.cpp:
(JSC::appendStringToStringBuilder):
* runtime/StringPrototype.cpp:
(JSC::replaceUsingStringSearch):
Add static_casts to prevent implicit type conversions in non-constant initializer lists.

Source/ThirdParty/ANGLE:

* Configurations/Base.xcconfig:
Add CLANG_CXX_LANGUAGE_STANDARD=gnu++0x.

Source/WebCore:

* Configurations/Base.xcconfig:
Add CLANG_CXX_LANGUAGE_STANDARD=gnu++0x.

* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::hash):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawLine):
(WebCore::GraphicsContext::strokeArc):
* platform/graphics/filters/CustomFilterProgramInfo.cpp:
(WebCore::CustomFilterProgramInfo::hash):
(WebCore::ProtectionSpaceHash::hash):
* platform/network/cf/FormDataStreamCFNet.cpp:
(WebCore::setHTTPBody):
Add static_casts to prevent implicit type conversions in non-constant initializer lists.

* platform/mac/ClipboardMac.mm:
(WebCore::ClipboardMac::createDragImage):
* platform/mac/CursorMac.mm:
(WebCore::createNamedCursor):
* platform/mac/ScrollViewMac.mm:
(WebCore::ScrollView::platformSetContentsSize):
Use NSMakePoint to prevent implicit type conversions in non-constant initializer lists.

* platform/mac/CookieJar.mm:
(WebCore::cookiesEnabled):
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::shouldRelaxThirdPartyCookiePolicy):
Add explicit casts to NSHTTPCookieAcceptPolicy.

* platform/mac/WebCoreNSURLExtras.h:
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::URLByTruncatingOneCharacterBeforeComponent):
(WebCore::dataForURLComponentType):
* platform/network/ProtectionSpaceHash.h:
Use CFIndex instead of CFURLComponentType, the enum can be mangled differently in some cases, and these
functions are exported from WebCore.

Source/WebKit/mac:

* Configurations/Base.xcconfig:
Add CLANG_CXX_LANGUAGE_STANDARD=gnu++0x.

* History/WebBackForwardList.mm:
(-[WebBackForwardList description]):
* History/WebHistoryItem.mm:
(-[WebHistoryItem description]):
Add static_casts to prevent implicit type conversions in non-constant initializer lists.

Source/WebKit2:

* Configurations/Base.xcconfig:
Add CLANG_CXX_LANGUAGE_STANDARD=gnu++0x.

* UIProcess/mac/WebCookieManagerProxyMac.mm:
(WebKit::WebCookieManagerProxy::persistHTTPCookieAcceptPolicy):
* WebProcess/Cookies/mac/WebCookieManagerMac.mm:
(WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
Add explicit casts to NSHTTPCookieAcceptPolicy.

Source/WTF:

* Configurations/Base.xcconfig:
Add CLANG_CXX_LANGUAGE_STANDARD=gnu++0x.

* wtf/text/AtomicString.cpp:
(WTF::AtomicString::add):
Change the type of length to be unsigned to prevent implicit type conversions in non-constant initializer lists.

* wtf/unicode/UTF8.cpp:
(Unicode):
Add static_casts to prevent implicit type conversions in non-constant initializer lists.

Tools:

* DumpRenderTree/mac/Configurations/Base.xcconfig:
* MiniBrowser/Configurations/Base.xcconfig:
* TestWebKitAPI/Configurations/Base.xcconfig:
* WebKitTestRunner/Configurations/Base.xcconfig:
Add CLANG_CXX_LANGUAGE_STANDARD=gnu++0x.

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

42 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Configurations/Base.xcconfig
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp
Source/JavaScriptCore/runtime/Identifier.cpp
Source/JavaScriptCore/runtime/Identifier.h
Source/JavaScriptCore/runtime/JSONObject.cpp
Source/JavaScriptCore/runtime/StringPrototype.cpp
Source/ThirdParty/ANGLE/ChangeLog
Source/ThirdParty/ANGLE/Configurations/Base.xcconfig
Source/WTF/ChangeLog
Source/WTF/Configurations/Base.xcconfig
Source/WTF/wtf/text/AtomicString.cpp
Source/WTF/wtf/unicode/UTF8.cpp
Source/WebCore/ChangeLog
Source/WebCore/Configurations/Base.xcconfig
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/graphics/FontPlatformData.h
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Source/WebCore/platform/graphics/filters/CustomFilterProgramInfo.cpp
Source/WebCore/platform/mac/ClipboardMac.mm
Source/WebCore/platform/mac/CookieJar.mm
Source/WebCore/platform/mac/CursorMac.mm
Source/WebCore/platform/mac/ScrollViewMac.mm
Source/WebCore/platform/mac/WebCoreNSURLExtras.h
Source/WebCore/platform/mac/WebCoreNSURLExtras.mm
Source/WebCore/platform/network/ProtectionSpaceHash.h
Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp
Source/WebCore/platform/network/mac/ResourceHandleMac.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Configurations/Base.xcconfig
Source/WebKit/mac/History/WebBackForwardList.mm
Source/WebKit/mac/History/WebHistoryItem.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Configurations/Base.xcconfig
Source/WebKit2/UIProcess/mac/WebCookieManagerProxyMac.mm
Source/WebKit2/WebProcess/Cookies/mac/WebCookieManagerMac.mm
Tools/ChangeLog
Tools/DumpRenderTree/mac/Configurations/Base.xcconfig
Tools/MiniBrowser/Configurations/Base.xcconfig
Tools/TestWebKitAPI/Configurations/Base.xcconfig
Tools/WebKitTestRunner/Configurations/Base.xcconfig

index f448b4f..1a6a2c9 100644 (file)
@@ -1,3 +1,28 @@
+2012-10-29  Anders Carlsson  <andersca@apple.com>
+
+        Build WebKit as C++11 on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=100720
+
+        Reviewed by Daniel Bates.
+
+        * Configurations/Base.xcconfig:
+        Add CLANG_CXX_LANGUAGE_STANDARD=gnu++0x.
+
+        * bytecompiler/BytecodeGenerator.cpp:
+        (JSC::BytecodeGenerator::generate):
+        (JSC::BytecodeGenerator::pushFinallyContext):
+        (JSC::BytecodeGenerator::beginSwitch):
+        * llint/LLIntOffsetsExtractor.cpp:
+        * runtime/Identifier.cpp:
+        (JSC::Identifier::add8):
+        * runtime/Identifier.h:
+        (JSC::Identifier::add):
+        * runtime/JSONObject.cpp:
+        (JSC::appendStringToStringBuilder):
+        * runtime/StringPrototype.cpp:
+        (JSC::replaceUsingStringSearch):
+        Add static_casts to prevent implicit type conversions in non-constant initializer lists.
+
 2012-10-28  Mark Rowe  <mrowe@apple.com>
 
         Simplify Xcode configuration settings that used to vary between OS versions.
index ae796db..2de8597 100644 (file)
@@ -21,6 +21,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 
+CLANG_CXX_LANGUAGE_STANDARD = gnu++0x;
 CLANG_CXX_LIBRARY = libc++;
 CLANG_WARN_CXX0X_EXTENSIONS = NO;
 DEBUG_INFORMATION_FORMAT = dwarf-with-dsym;
index 2282773..0b0af0c 100644 (file)
@@ -170,8 +170,8 @@ JSObject* BytecodeGenerator::generate()
         TryRange& range = m_tryRanges[i];
         ASSERT(range.tryData->targetScopeDepth != UINT_MAX);
         HandlerInfo info = {
-            range.start->bind(0, 0), range.end->bind(0, 0),
-            range.tryData->target->bind(0, 0), range.tryData->targetScopeDepth
+            static_cast<uint32_t>(range.start->bind(0, 0)), static_cast<uint32_t>(range.end->bind(0, 0)),
+            static_cast<uint32_t>(range.tryData->target->bind(0, 0)), static_cast<uint32_t>(range.tryData->targetScopeDepth)
 #if ENABLE(JIT)
             ,
 #if ENABLE(LLINT)
@@ -2131,11 +2131,11 @@ void BytecodeGenerator::pushFinallyContext(StatementNode* finallyBlock)
     scope.isFinallyBlock = true;
     FinallyContext context = {
         finallyBlock,
-        m_scopeContextStack.size(),
-        m_switchContextStack.size(),
-        m_forInContextStack.size(),
-        m_tryContextStack.size(),
-        m_labelScopes.size(),
+        static_cast<unsigned>(m_scopeContextStack.size()),
+        static_cast<unsigned>(m_switchContextStack.size()),
+        static_cast<unsigned>(m_forInContextStack.size()),
+        static_cast<unsigned>(m_tryContextStack.size()),
+        static_cast<unsigned>(m_labelScopes.size()),
         m_finallyDepth,
         m_dynamicScopeDepth
     };
@@ -2462,7 +2462,7 @@ void BytecodeGenerator::emitPushNameScope(const Identifier& property, RegisterID
 
 void BytecodeGenerator::beginSwitch(RegisterID* scrutineeRegister, SwitchInfo::SwitchType type)
 {
-    SwitchInfo info = { instructions().size(), type };
+    SwitchInfo info = { static_cast<uint32_t>(instructions().size()), type };
     switch (type) {
         case SwitchInfo::SwitchImmediate:
             emitOpcode(op_switch_imm);
index cbfff29..0087fe5 100644 (file)
@@ -53,7 +53,7 @@
 
 namespace JSC {
 
-#define OFFLINE_ASM_OFFSETOF(clazz, field) OBJECT_OFFSETOF(clazz, field)
+#define OFFLINE_ASM_OFFSETOF(clazz, field) (static_cast<unsigned>(OBJECT_OFFSETOF(clazz, field)))
 
 class LLIntOffsetsExtractor {
 public:
index 45dd0bb..583c12b 100644 (file)
@@ -128,7 +128,7 @@ PassRefPtr<StringImpl> Identifier::add8(JSGlobalData* globalData, const UChar* s
     
     if (!length)
         return StringImpl::empty();
-    CharBuffer<UChar> buf = {s, length}; 
+    CharBuffer<UChar> buf = { s, static_cast<unsigned>(length) };
     HashSet<StringImpl*>::AddResult addResult = globalData->identifierTable->add<CharBuffer<UChar>, IdentifierLCharFromUCharTranslator >(buf);
     
     // If the string is newly-translated, then we need to adopt it.
index bdcfbd1..dcb739e 100644 (file)
@@ -180,7 +180,7 @@ namespace JSC {
         
         if (!length)
             return StringImpl::empty();
-        CharBuffer<T> buf = {s, length}; 
+        CharBuffer<T> buf = { s, static_cast<unsigned>(length) };
         HashSet<StringImpl*>::AddResult addResult = globalData->identifierTable->add<CharBuffer<T>, IdentifierCharBufferTranslator<T> >(buf);
         
         // If the string is newly-translated, then we need to adopt it.
index fd93993..e051ec7 100644 (file)
@@ -294,7 +294,7 @@ static void appendStringToStringBuilder(StringBuilder& builder, const CharType*
         default:
             static const char hexDigits[] = "0123456789abcdef";
             UChar ch = data[i];
-            LChar hex[] = { '\\', 'u', hexDigits[(ch >> 12) & 0xF], hexDigits[(ch >> 8) & 0xF], hexDigits[(ch >> 4) & 0xF], hexDigits[ch & 0xF] };
+            LChar hex[] = { '\\', 'u', static_cast<LChar>(hexDigits[(ch >> 12) & 0xF]), static_cast<LChar>(hexDigits[(ch >> 8) & 0xF]), static_cast<LChar>(hexDigits[(ch >> 4) & 0xF]), static_cast<LChar>(hexDigits[ch & 0xF]) };
             builder.append(hex, WTF_ARRAY_LENGTH(hex));
             break;
         }
index 4d3ccfd..5aafe8b 100644 (file)
@@ -666,7 +666,7 @@ static inline EncodedJSValue replaceUsingStringSearch(ExecState* exec, JSString*
     String leftPart(StringImpl::create(stringImpl, 0, matchStart));
 
     size_t matchEnd = matchStart + searchString.impl()->length();
-    int ovector[2] = { matchStart,  matchEnd};
+    int ovector[2] = { static_cast<int>(matchStart),  static_cast<int>(matchEnd)};
     String middlePart = substituteBackreferences(replaceString, string, ovector, 0);
 
     size_t leftLength = stringImpl->length() - matchEnd;
index 22c3071..4f964e8 100644 (file)
@@ -1,3 +1,13 @@
+2012-10-29  Anders Carlsson  <andersca@apple.com>
+
+        Build WebKit as C++11 on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=100720
+
+        Reviewed by Daniel Bates.
+
+        * Configurations/Base.xcconfig:
+        Add CLANG_CXX_LANGUAGE_STANDARD=gnu++0x.
+
 2012-10-28  Mark Rowe  <mrowe@apple.com>
 
         Simplify Xcode configuration settings that used to vary between OS versions.
index 2b7e26a..742c8fc 100644 (file)
@@ -1,3 +1,4 @@
+CLANG_CXX_LANGUAGE_STANDARD = gnu++0x;
 CLANG_CXX_LIBRARY = libc++;
 DEAD_CODE_STRIPPING = YES;
 DEBUG_INFORMATION_FORMAT = dwarf-with-dsym;
index 4aefd10..ba5804f 100644 (file)
@@ -1,5 +1,23 @@
 2012-10-29  Anders Carlsson  <andersca@apple.com>
 
+        Build WebKit as C++11 on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=100720
+
+        Reviewed by Daniel Bates.
+
+        * Configurations/Base.xcconfig:
+        Add CLANG_CXX_LANGUAGE_STANDARD=gnu++0x.
+
+        * wtf/text/AtomicString.cpp:
+        (WTF::AtomicString::add):
+        Change the type of length to be unsigned to prevent implicit type conversions in non-constant initializer lists.
+
+        * wtf/unicode/UTF8.cpp:
+        (Unicode):
+        Add static_casts to prevent implicit type conversions in non-constant initializer lists.
+
+2012-10-29  Anders Carlsson  <andersca@apple.com>
+
         String::createCFString should return a RetainPtr
         https://bugs.webkit.org/show_bug.cgi?id=100419
 
index cf1519e..5f00c83 100644 (file)
@@ -21,6 +21,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 
+CLANG_CXX_LANGUAGE_STANDARD = gnu++0x;
 CLANG_CXX_LIBRARY = libc++;
 CLANG_WARN_CXX0X_EXTENSIONS = NO;
 DEBUG_INFORMATION_FORMAT = dwarf-with-dsym;
index 8c69e24..d637caa 100644 (file)
@@ -260,7 +260,7 @@ PassRefPtr<StringImpl> AtomicString::add(const UChar* s)
     if (!s)
         return 0;
 
-    int length = 0;
+    unsigned length = 0;
     while (s[length] != UChar(0))
         length++;
 
index db69e48..6e74f01 100644 (file)
@@ -275,8 +275,7 @@ static bool isLegalUTF8(const unsigned char* source, int length)
 // Magic values subtracted from a buffer value during UTF8 conversion.
 // This table contains as many values as there might be trailing bytes
 // in a UTF-8 sequence.
-static const UChar32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL, 
-            0x03C82080UL, 0xFA082080UL, 0x82082080UL };
+static const UChar32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL, 0x03C82080UL, static_cast<UChar32>(0xFA082080UL), static_cast<UChar32>(0x82082080UL) };
 
 static inline UChar32 readUTF8Sequence(const char*& sequence, unsigned length)
 {
index e3a2f12..fa468f9 100644 (file)
@@ -1,3 +1,47 @@
+2012-10-29  Anders Carlsson  <andersca@apple.com>
+
+        Build WebKit as C++11 on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=100720
+
+        Reviewed by Daniel Bates.
+
+        * Configurations/Base.xcconfig:
+        Add CLANG_CXX_LANGUAGE_STANDARD=gnu++0x.
+
+        * platform/graphics/FontPlatformData.h:
+        (WebCore::FontPlatformData::hash):
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        (WebCore::GraphicsContext::drawLine):
+        (WebCore::GraphicsContext::strokeArc):
+        * platform/graphics/filters/CustomFilterProgramInfo.cpp:
+        (WebCore::CustomFilterProgramInfo::hash):
+        (WebCore::ProtectionSpaceHash::hash):
+        * platform/network/cf/FormDataStreamCFNet.cpp:
+        (WebCore::setHTTPBody):
+        Add static_casts to prevent implicit type conversions in non-constant initializer lists.
+        
+        * platform/mac/ClipboardMac.mm:
+        (WebCore::ClipboardMac::createDragImage):
+        * platform/mac/CursorMac.mm:
+        (WebCore::createNamedCursor):
+        * platform/mac/ScrollViewMac.mm:
+        (WebCore::ScrollView::platformSetContentsSize):
+        Use NSMakePoint to prevent implicit type conversions in non-constant initializer lists.
+
+        * platform/mac/CookieJar.mm:
+        (WebCore::cookiesEnabled):
+        * platform/network/mac/ResourceHandleMac.mm:
+        (WebCore::shouldRelaxThirdPartyCookiePolicy):
+        Add explicit casts to NSHTTPCookieAcceptPolicy.
+
+        * platform/mac/WebCoreNSURLExtras.h:
+        * platform/mac/WebCoreNSURLExtras.mm:
+        (WebCore::URLByTruncatingOneCharacterBeforeComponent):
+        (WebCore::dataForURLComponentType):
+        * platform/network/ProtectionSpaceHash.h:
+        Use CFIndex instead of CFURLComponentType, the enum can be mangled differently in some cases, and these
+        functions are exported from WebCore.
+
 2012-10-30  Dan Bernstein  <mitz@apple.com>
 
         <rdar://problem/12395187> REGRESSION (r121299): OS X Text Replacement forces cursor out of text fields
index 9ca7e68..5816769 100644 (file)
@@ -21,6 +21,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 
+CLANG_CXX_LANGUAGE_STANDARD = gnu++0x;
 CLANG_CXX_LIBRARY = libc++;
 CLANG_WARN_CXX0X_EXTENSIONS = NO;
 DEBUG_INFORMATION_FORMAT = dwarf-with-dsym;
index 679d8df..66f3f39 100644 (file)
                5038BE401472AD980095E0D1 /* CachedShader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5038BE3E1472AD980095E0D1 /* CachedShader.cpp */; };
                5038BE411472AD980095E0D1 /* CachedShader.h in Headers */ = {isa = PBXBuildFile; fileRef = 5038BE3F1472AD980095E0D1 /* CachedShader.h */; };
                503D0CAA14B5B08700F32F57 /* CustomFilterProgram.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503D0CA714B5B08700F32F57 /* CustomFilterProgram.cpp */; };
-               503D0CAB14B5B08700F32F57 /* CustomFilterProgram.h in Headers */ = {isa = PBXBuildFile; fileRef = 503D0CA814B5B08700F32F57 /* CustomFilterProgram.h */; settings = {ATTRIBUTES = (); }; };
-               503D0CAC14B5B08700F32F57 /* CustomFilterProgramClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 503D0CA914B5B08700F32F57 /* CustomFilterProgramClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
                503D0CAA14B5B08700F32F58 /* CustomFilterRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 503D0CA714B5B08700F32F58 /* CustomFilterRenderer.cpp */; };
+               503D0CAB14B5B08700F32F57 /* CustomFilterProgram.h in Headers */ = {isa = PBXBuildFile; fileRef = 503D0CA814B5B08700F32F57 /* CustomFilterProgram.h */; settings = {ATTRIBUTES = (); }; };
                503D0CAB14B5B08700F32F58 /* CustomFilterRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 503D0CA814B5B08700F32F58 /* CustomFilterRenderer.h */; settings = {ATTRIBUTES = (); }; };
+               503D0CAC14B5B08700F32F57 /* CustomFilterProgramClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 503D0CA914B5B08700F32F57 /* CustomFilterProgramClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
                503D0CAE14B5B0BA00F32F57 /* StyleCustomFilterProgram.h in Headers */ = {isa = PBXBuildFile; fileRef = 503D0CAD14B5B0BA00F32F57 /* StyleCustomFilterProgram.h */; settings = {ATTRIBUTES = (); }; };
                5081E3C33CE580C16EF8B48B /* CachedResourceRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5081E3DF3CFC80C16EF8B48B /* CachedResourceRequest.cpp */; };
                5081E3E03CFF80C16EF8B48B /* CachedResourceRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 5081E3E13D0280C16EF8B48B /* CachedResourceRequest.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5038BE3E1472AD980095E0D1 /* CachedShader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedShader.cpp; sourceTree = "<group>"; };
                5038BE3F1472AD980095E0D1 /* CachedShader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedShader.h; sourceTree = "<group>"; };
                503D0CA714B5B08700F32F57 /* CustomFilterProgram.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CustomFilterProgram.cpp; path = filters/CustomFilterProgram.cpp; sourceTree = "<group>"; };
-               503D0CA814B5B08700F32F57 /* CustomFilterProgram.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CustomFilterProgram.h; path = filters/CustomFilterProgram.h; sourceTree = "<group>"; };
-               503D0CA914B5B08700F32F57 /* CustomFilterProgramClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CustomFilterProgramClient.h; path = filters/CustomFilterProgramClient.h; sourceTree = "<group>"; };
                503D0CA714B5B08700F32F58 /* CustomFilterRenderer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CustomFilterRenderer.cpp; path = filters/CustomFilterRenderer.cpp; sourceTree = "<group>"; };
+               503D0CA814B5B08700F32F57 /* CustomFilterProgram.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CustomFilterProgram.h; path = filters/CustomFilterProgram.h; sourceTree = "<group>"; };
                503D0CA814B5B08700F32F58 /* CustomFilterRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CustomFilterRenderer.h; path = filters/CustomFilterRenderer.h; sourceTree = "<group>"; };
+               503D0CA914B5B08700F32F57 /* CustomFilterProgramClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CustomFilterProgramClient.h; path = filters/CustomFilterProgramClient.h; sourceTree = "<group>"; };
                503D0CAD14B5B0BA00F32F57 /* StyleCustomFilterProgram.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StyleCustomFilterProgram.h; path = style/StyleCustomFilterProgram.h; sourceTree = "<group>"; };
                5081E3DF3CFC80C16EF8B48B /* CachedResourceRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CachedResourceRequest.cpp; sourceTree = "<group>"; };
                5081E3E13D0280C16EF8B48B /* CachedResourceRequest.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CachedResourceRequest.h; sourceTree = "<group>"; };
index f7af706..be82845 100644 (file)
@@ -181,7 +181,7 @@ public:
 #if USE(CG) || USE(SKIA_ON_MAC_CHROMIUM)
         ASSERT(m_font || !m_cgFont);
 #endif
-        uintptr_t hashCodes[3] = { (uintptr_t)m_font, m_widthVariant, m_isPrinterFont << 4 | m_textOrientation << 3 | m_orientation << 2 | m_syntheticBold << 1 | m_syntheticOblique };
+        uintptr_t hashCodes[3] = { (uintptr_t)m_font, m_widthVariant, static_cast<uintptr_t>(m_isPrinterFont << 4 | m_textOrientation << 3 | m_orientation << 2 | m_syntheticBold << 1 | m_syntheticOblique) };
         return StringHasher::hashMemory<sizeof(hashCodes)>(hashCodes);
 #elif USE(CAIRO)
         return PtrHash<cairo_scaled_font_t*>::hash(m_scaledFont);
index bd55385..1edab0c 100644 (file)
@@ -488,7 +488,7 @@ void GraphicsContext::drawLine(const IntPoint& point1, const IntPoint& point2)
             }
         }
 
-        const CGFloat dottedLine[2] = { patWidth, patWidth };
+        const CGFloat dottedLine[2] = { static_cast<CGFloat>(patWidth), static_cast<CGFloat>(patWidth) };
         CGContextSetLineDash(context, patternOffset, dottedLine, 2);
     }
 
@@ -596,7 +596,7 @@ void GraphicsContext::strokeArc(const IntRect& rect, int startAngle, int angleSp
             }
         }
 
-        const CGFloat dottedLine[2] = { patWidth, patWidth };
+        const CGFloat dottedLine[2] = { static_cast<CGFloat>(patWidth), static_cast<CGFloat>(patWidth) };
         CGContextSetLineDash(context, patternOffset, dottedLine, 2);
     }
 
index 9a39ea7..ddab9a7 100644 (file)
@@ -85,8 +85,8 @@ unsigned CustomFilterProgramInfo::hash() const
         hashPossiblyNullString(m_vertexShaderString),
         hashPossiblyNullString(m_fragmentShaderString),
         blendsElementTexture,
-        blendsElementTexture ? m_mixSettings.blendMode : 0,
-        blendsElementTexture ? m_mixSettings.compositeOperator : 0,
+        static_cast<uintptr_t>(blendsElementTexture ? m_mixSettings.blendMode : 0),
+        static_cast<uintptr_t>(blendsElementTexture ? m_mixSettings.compositeOperator : 0),
         m_meshType
     };
     return StringHasher::hashMemory<sizeof(hashCodes)>(&hashCodes);
index fd4ab99..0107732 100644 (file)
@@ -404,7 +404,7 @@ void ClipboardMac::declareAndWriteDragImage(Element* element, const KURL& url, c
     
 DragImageRef ClipboardMac::createDragImage(IntPoint& loc) const
 {
-    NSPoint nsloc = {loc.x(), loc.y()};
+    NSPoint nsloc = NSMakePoint(loc.x(), loc.y());
     DragImageRef result = dragNSImage(nsloc);
     loc = (IntPoint)nsloc;
     return result;
index 421d86d..e774944 100644 (file)
@@ -147,7 +147,7 @@ bool cookiesEnabled(const Document*)
     NSHTTPCookieAcceptPolicy cookieAcceptPolicy;
 #if USE(CFURLSTORAGESESSIONS)
     if (RetainPtr<CFHTTPCookieStorageRef> cfCookieStorage = currentCFHTTPCookieStorage())
-        cookieAcceptPolicy = wkGetHTTPCookieAcceptPolicy(cfCookieStorage.get());
+        cookieAcceptPolicy = static_cast<NSHTTPCookieAcceptPolicy>(wkGetHTTPCookieAcceptPolicy(cfCookieStorage.get()));
     else
 #endif
         cookieAcceptPolicy = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookieAcceptPolicy];
index ac24b88..13e7062 100644 (file)
@@ -61,10 +61,9 @@ static RetainPtr<NSCursor> createNamedCursor(const char* name, int x, int y)
     
     RetainPtr<NSCursor> cursor;
 
-    if (cursorImage) {
-        NSPoint hotSpotPoint = {x, y}; // workaround for 4213314
-        cursor.adoptNS([[NSCursor alloc] initWithImage:cursorImage.get() hotSpot:hotSpotPoint]);
-    }
+    if (cursorImage)
+        cursor = adoptNS([[NSCursor alloc] initWithImage:cursorImage.get() hotSpot:NSMakePoint(x, y)]);
+
     return cursor;
     END_BLOCK_OBJC_EXCEPTIONS;
     return nil;
index a560bc5..1e9fe3f 100644 (file)
@@ -123,8 +123,7 @@ void ScrollView::platformSetContentsSize()
     int w = m_contentsSize.width();
     int h = m_contentsSize.height();
     LOG(Frames, "%p %@ at w %d h %d\n", documentView(), [(id)[documentView() class] className], w, h);            
-    NSSize tempSize = { max(0, w), max(0, h) }; // workaround for 4213314
-    [documentView() setFrameSize:tempSize];
+    [documentView() setFrameSize:NSMakeSize(max(0, w), max(0, h))];
     END_BLOCK_OBJC_EXCEPTIONS;
 }
 
index b8cbfda..9403168 100644 (file)
@@ -47,10 +47,10 @@ NSString *decodeHostNameWithRange(NSString *, NSRange);
 NSString *encodeHostNameWithRange(NSString *, NSRange);
 NSString *decodeHostName(NSString *);
 NSString *encodeHostName(NSString *);
-NSURL *URLByTruncatingOneCharacterBeforeComponent(NSURL *, CFURLComponentType);
+NSURL *URLByTruncatingOneCharacterBeforeComponent(NSURL *, CFIndex);
 NSURL *URLWithData(NSData *, NSURL *baseURL);
 NSData *originalURLData(NSURL *);
-NSData *dataForURLComponentType(NSURL *, CFURLComponentType);
+NSData *dataForURLComponentType(NSURL *, CFIndex);
 BOOL isUserVisibleURL(NSString *);
     
 } // namespace WebCore
index 3b87d53..4612633 100644 (file)
@@ -510,12 +510,12 @@ static NSString *stringByTrimmingWhitespace(NSString *string)
     return trimmed;
 }
 
-NSURL *URLByTruncatingOneCharacterBeforeComponent(NSURL *URL, CFURLComponentType component)
+NSURL *URLByTruncatingOneCharacterBeforeComponent(NSURL *URL, CFIndex component)
 {
     if (!URL)
         return nil;
     
-    CFRange fragRg = CFURLGetByteRangeForComponent((CFURLRef)URL, component, NULL);
+    CFRange fragRg = CFURLGetByteRangeForComponent((CFURLRef)URL, static_cast<CFURLComponentType>(component), NULL);
     if (fragRg.location == kCFNotFound)
         return URL;
     
@@ -619,7 +619,7 @@ static BOOL hasQuestionMarkOnlyQueryString(NSURL *URL)
 
 #define completeURL (CFURLComponentType)-1
 
-NSData *dataForURLComponentType(NSURL *URL, CFURLComponentType componentType)
+NSData *dataForURLComponentType(NSURL *URL, CFIndex componentType)
 {
     static int URLComponentTypeBufferLength = 2048;
     
@@ -635,7 +635,7 @@ NSData *dataForURLComponentType(NSURL *URL, CFURLComponentType componentType)
     
     CFRange range;
     if (componentType != completeURL) {
-        range = CFURLGetByteRangeForComponent((CFURLRef)URL, componentType, NULL);
+        range = CFURLGetByteRangeForComponent((CFURLRef)URL, static_cast<CFURLComponentType>(componentType), NULL);
         if (range.location == kCFNotFound)
             return nil;
     } else {
index edd95db..2d56b31 100644 (file)
@@ -36,7 +36,7 @@ struct ProtectionSpaceHash {
     { 
         unsigned hashCodes[5] = {
             protectionSpace.host().impl() ? protectionSpace.host().impl()->hash() : 0, 
-            protectionSpace.port(), 
+            static_cast<unsigned>(protectionSpace.port()),
             protectionSpace.serverType(),
             protectionSpace.authenticationScheme(),
             protectionSpace.realm().impl() ? protectionSpace.realm().impl()->hash() : 0
index 3d3e8a3..233c8c7 100644 (file)
@@ -438,7 +438,7 @@ void setHTTPBody(CFMutableURLRequestRef request, PassRefPtr<FormData> prpFormDat
 #endif
 
     // Precompute the content length so NSURLConnection doesn't use chunked mode.
-    long long length = 0;
+    unsigned long long length = 0;
     for (size_t i = 0; i < count; ++i) {
         const FormDataElement& element = formData->elements()[i];
         if (element.m_type == FormDataElement::data)
index 7e226e2..01237ef 100644 (file)
@@ -157,7 +157,7 @@ static bool shouldRelaxThirdPartyCookiePolicy(const KURL& url)
 #if USE(CFURLSTORAGESESSIONS)
     RetainPtr<CFHTTPCookieStorageRef> cfCookieStorage = currentCFHTTPCookieStorage();
     if (cfCookieStorage)
-        cookieAcceptPolicy = wkGetHTTPCookieAcceptPolicy(cfCookieStorage.get());
+        cookieAcceptPolicy = static_cast<NSHTTPCookieAcceptPolicy>(wkGetHTTPCookieAcceptPolicy(cfCookieStorage.get()));
     else
 #endif
         cookieAcceptPolicy = [sharedStorage cookieAcceptPolicy];
index c22fc77..bac46af 100644 (file)
@@ -1,3 +1,19 @@
+2012-10-29  Anders Carlsson  <andersca@apple.com>
+
+        Build WebKit as C++11 on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=100720
+
+        Reviewed by Daniel Bates.
+
+        * Configurations/Base.xcconfig:
+        Add CLANG_CXX_LANGUAGE_STANDARD=gnu++0x.
+
+        * History/WebBackForwardList.mm:
+        (-[WebBackForwardList description]):
+        * History/WebHistoryItem.mm:
+        (-[WebHistoryItem description]):
+        Add static_casts to prevent implicit type conversions in non-constant initializer lists.
+
 2012-10-28  Mark Rowe  <mrowe@apple.com>
 
         Simplify Xcode configuration settings that used to vary between OS versions.
index b149adf..30068f1 100644 (file)
@@ -21,6 +21,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 
+CLANG_CXX_LANGUAGE_STANDARD = gnu++0x;
 CLANG_CXX_LIBRARY = libc++;
 CLANG_WARN_CXX0X_EXTENSIONS = NO;
 DEBUG_INFORMATION_FORMAT = dwarf-with-dsym;
index 64b1785..683b9a8 100644 (file)
@@ -282,7 +282,7 @@ static bool bumperCarBackForwardHackNeeded()
         [result appendString:[kit(entries[i].get()) description]];
 
         // shift all the contents over.  a bit slow, but this is for debugging
-        NSRange replRange = {currPos, [result length]-currPos};
+        NSRange replRange = { static_cast<NSUInteger>(currPos), [result length] - currPos };
         [result replaceOccurrencesOfString:@"\n" withString:@"\n        " options:0 range:replRange];
         
         [result appendString:@"\n"];
index f2374bd..7c10c6a 100644 (file)
@@ -232,7 +232,7 @@ void WKNotifyHistoryItemChanged(HistoryItem*)
             [result appendString:[child description]];
         }
         // shift all the contents over.  A bit slow, but hey, this is for debugging.
-        NSRange replRange = {currPos, [result length]-currPos};
+        NSRange replRange = { static_cast<NSUInteger>(currPos), [result length] - currPos };
         [result replaceOccurrencesOfString:@"\n" withString:@"\n    " options:0 range:replRange];
     }
     
index d5de455..1295d2a 100644 (file)
@@ -1,3 +1,19 @@
+2012-10-29  Anders Carlsson  <andersca@apple.com>
+
+        Build WebKit as C++11 on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=100720
+
+        Reviewed by Daniel Bates.
+
+        * Configurations/Base.xcconfig:
+        Add CLANG_CXX_LANGUAGE_STANDARD=gnu++0x.
+
+        * UIProcess/mac/WebCookieManagerProxyMac.mm:
+        (WebKit::WebCookieManagerProxy::persistHTTPCookieAcceptPolicy):
+        * WebProcess/Cookies/mac/WebCookieManagerMac.mm:
+        (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy):
+        Add explicit casts to NSHTTPCookieAcceptPolicy.
+
 2012-10-30  Sergio Villar Senin  <svillar@igalia.com>
 
         [WK2][Qt] Enable hover and mouse events in flickable WebView
index 2184e74..3605742 100644 (file)
@@ -21,6 +21,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 
+CLANG_CXX_LANGUAGE_STANDARD = gnu++0x;
 CLANG_CXX_LIBRARY = libc++;
 CLANG_WARN_CXX0X_EXTENSIONS = NO;
 DEBUG_INFORMATION_FORMAT = dwarf-with-dsym;
index 6a31346..6fd2f9a 100644 (file)
@@ -33,7 +33,7 @@ void WebCookieManagerProxy::persistHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy
     // FIXME: The sandbox appears to prevent persisting the new policy to disk, so we must set the
     // policy in the UI Process as well as in the Web Process (to make sure it gets set on any
     // Private Browsing Cookie Storage).
-    [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:policy];
+    [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:static_cast<NSHTTPCookieAcceptPolicy>(policy)];
 }
 
 } // namespace WebKit
index daf39cd..172b6bf 100644 (file)
@@ -34,7 +34,7 @@ namespace WebKit {
 
 void WebCookieManager::platformSetHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy policy)
 {
-    [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:policy];
+    [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:static_cast<NSHTTPCookieAcceptPolicy>(policy)];
 
 #if USE(CFURLSTORAGESESSIONS)
     if (RetainPtr<CFHTTPCookieStorageRef> cookieStorage = currentCFHTTPCookieStorage())
index 8001f90..5750f9b 100644 (file)
@@ -1,3 +1,16 @@
+2012-10-29  Anders Carlsson  <andersca@apple.com>
+
+        Build WebKit as C++11 on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=100720
+
+        Reviewed by Daniel Bates.
+
+        * DumpRenderTree/mac/Configurations/Base.xcconfig:
+        * MiniBrowser/Configurations/Base.xcconfig:
+        * TestWebKitAPI/Configurations/Base.xcconfig:
+        * WebKitTestRunner/Configurations/Base.xcconfig:
+        Add CLANG_CXX_LANGUAGE_STANDARD=gnu++0x.
+
 2012-10-30  Christophe Dumez  <christophe.dumez@intel.com>
 
         [EFL][JHBUILD] Update EFL libraries to v1.7.1 stable release
index 103bfce..be91f5e 100644 (file)
@@ -21,6 +21,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 
+CLANG_CXX_LANGUAGE_STANDARD = gnu++0x;
 CLANG_CXX_LIBRARY = libc++;
 CLANG_WARN_CXX0X_EXTENSIONS = NO;
 HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/usr/local/include ForwardingHeaders mac/InternalHeaders $(NEXT_ROOT)/usr/local/include/WebCoreTestSupport ${SRCROOT}/../../Source/JavaScriptCore/icu;
index a2f4bb9..c801d58 100644 (file)
@@ -21,6 +21,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 
+CLANG_CXX_LANGUAGE_STANDARD = gnu++0x;
 CLANG_CXX_LIBRARY = libc++;
 DEBUG_INFORMATION_FORMAT = dwarf-with-dsym;
 PREBINDING = NO
index 59b9774..1e029d4 100644 (file)
@@ -21,6 +21,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+CLANG_CXX_LANGUAGE_STANDARD = gnu++0x;
 CLANG_CXX_LIBRARY = libc++;
 CLANG_WARN_CXX0X_EXTENSIONS = NO;
 HEADER_SEARCH_PATHS = ${BUILT_PRODUCTS_DIR}/usr/local/include $(WEBCORE_PRIVATE_HEADERS_DIR)/ForwardingHeaders $(WEBCORE_PRIVATE_HEADERS_DIR)/icu;
index ce8a9a7..ef87ffe 100644 (file)
@@ -21,6 +21,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 
+CLANG_CXX_LANGUAGE_STANDARD = gnu++0x;
 CLANG_CXX_LIBRARY = libc++;
 CLANG_WARN_CXX0X_EXTENSIONS = NO;
 HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/usr/local/include $(WEBCORE_PRIVATE_HEADERS_DIR)/ForwardingHeaders ${SRCROOT}/../../Source/JavaScriptCore/icu $(NEXT_ROOT)/usr/local/include/WebCoreTestSupport;