[Win][Clang][WebKitLegacy] Fix compilation errors and warnings of WebPreferences.cpp
authorHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Sep 2018 02:14:05 +0000 (02:14 +0000)
committerHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Sep 2018 02:14:05 +0000 (02:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189538

Reviewed by Per Arne Vollan.

* WebPreferences.cpp:
Changed the type of CFNumberTraits::Type from unsigned int to CFNumberType.
(WebPreferences::migrateWebKitPreferencesToCFPreferences):
Apply static_cast to the result of OR-ed CFPropertyListFormat.
(WebPreferences::screenFontSubstitutionEnabled):
Assign false to the content of the out variable 'enabled', not assigning 0 to the variable.

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

Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/WebPreferences.cpp

index 8d352ce..aadb4ae 100644 (file)
@@ -1,5 +1,19 @@
 2018-09-12  Fujii Hironori  <Hironori.Fujii@sony.com>
 
+        [Win][Clang][WebKitLegacy] Fix compilation errors and warnings of WebPreferences.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=189538
+
+        Reviewed by Per Arne Vollan.
+
+        * WebPreferences.cpp:
+        Changed the type of CFNumberTraits::Type from unsigned int to CFNumberType.
+        (WebPreferences::migrateWebKitPreferencesToCFPreferences):
+        Apply static_cast to the result of OR-ed CFPropertyListFormat.
+        (WebPreferences::screenFontSubstitutionEnabled):
+        Assign false to the content of the out variable 'enabled', not assigning 0 to the variable.
+
+2018-09-12  Fujii Hironori  <Hironori.Fujii@sony.com>
+
         [Win][Clang][WebKitLegacy] error: 'static' is invalid in friend declarations
         https://bugs.webkit.org/show_bug.cgi?id=189539
 
index f1d81d8..feed419 100644 (file)
@@ -61,10 +61,10 @@ static const String& oldPreferencesPath()
     return path;
 }
 
-template<typename NumberType> struct CFNumberTraits { static const unsigned Type; };
-template<> struct CFNumberTraits<int> { static const unsigned Type = kCFNumberSInt32Type; };
-template<> struct CFNumberTraits<LONGLONG> { static const unsigned Type = kCFNumberLongLongType; };
-template<> struct CFNumberTraits<float> { static const unsigned Type = kCFNumberFloat32Type; };
+template<typename NumberType> struct CFNumberTraits { static const CFNumberType Type; };
+template<> struct CFNumberTraits<int> { static const CFNumberType Type = kCFNumberSInt32Type; };
+template<> struct CFNumberTraits<LONGLONG> { static const CFNumberType Type = kCFNumberLongLongType; };
+template<> struct CFNumberTraits<float> { static const CFNumberType Type = kCFNumberFloat32Type; };
 
 template<typename NumberType>
 static NumberType numberValueForPreferencesValue(CFPropertyListRef value)
@@ -515,7 +515,7 @@ void WebPreferences::migrateWebKitPreferencesToCFPreferences()
     if (!CFReadStreamOpen(stream.get()))
         return;
 
-    CFPropertyListFormat format = kCFPropertyListBinaryFormat_v1_0 | kCFPropertyListXMLFormat_v1_0;
+    auto format = static_cast<CFPropertyListFormat>(kCFPropertyListBinaryFormat_v1_0 | kCFPropertyListXMLFormat_v1_0);
     RetainPtr<CFPropertyListRef> plist = adoptCF(CFPropertyListCreateFromStream(0, stream.get(), 0, kCFPropertyListMutableContainersAndLeaves, &format, 0));
     CFReadStreamClose(stream.get());
 
@@ -1352,7 +1352,7 @@ HRESULT WebPreferences::screenFontSubstitutionEnabled(_Out_ BOOL* enabled)
 {
     if (!enabled)
         return E_POINTER;
-    enabled = false;
+    *enabled = false;
     return S_OK;
 }