<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>189538</bug_id>
          
          <creation_ts>2018-09-11 23:38:19 -0700</creation_ts>
          <short_desc>[Win][Clang][WebKitLegacy] Fix compilation errors and warnings of WebPreferences.cpp</short_desc>
          <delta_ts>2018-09-12 19:16:32 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit Misc.</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>171618</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Fujii Hironori">fujii</reporter>
          <assigned_to name="Fujii Hironori">fujii</assigned_to>
          <cc>achristensen</cc>
    
    <cc>bfulgham</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>pvollan</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1458886</commentid>
    <comment_count>0</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-09-11 23:38:19 -0700</bug_when>
    <thetext>[Win][Clang][WebKitLegacy] Fix compilation errors and warnings of WebPreferences.cpp

While trying to build WebKit WinCairo port with the latest Clang (Bug 171618),
the following compilation errors and warnings are reported.

&gt; [8/31] Building CXX object Source\WebKitLegacy\CMakeFiles\WebKitLegacy.dir\win\WebPreferences.cpp.obj
&gt; FAILED: Source/WebKitLegacy/CMakeFiles/WebKitLegacy.dir/win/WebPreferences.cpp.obj 
&gt; C:\tools\llvm\bin\clang-cl.exe  (...) -c ..\..\Source\WebKitLegacy\win\WebPreferences.cpp
&gt; In file included from ..\..\Source\WebKitLegacy\win\WebPreferences.cpp:27:
&gt; ..\..\Source\WebKitLegacy\win/WebKitDLL.h(53,37):  warning: &apos;gClassNameCount&apos; has C-linkage specified, but returns user-defined type &apos;HashCountedSet&lt;WTF::String&gt; &amp;&apos; which is incompatible with C [-Wreturn-type-c-linkage]
&gt; extern HashCountedSet&lt;WTF::String&gt;&amp; gClassNameCount();
&gt;                                     ^
&gt; ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(518,26):  error: cannot initialize a variable of type &apos;CFPropertyListFormat&apos; with an rvalue of type &apos;long long&apos;
&gt;     CFPropertyListFormat format = kCFPropertyListBinaryFormat_v1_0 | kCFPropertyListXMLFormat_v1_0;
&gt;                          ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&gt; ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(1355,15):  warning: initialization of pointer of type &apos;BOOL *&apos; (aka &apos;int *&apos;) to null from a constant boolean expression [-Wbool-conversion]
&gt;     enabled = false;
&gt;               ^~~~~
&gt; ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(83,9):  error: no matching function for call to &apos;CFNumberGetValue&apos;
&gt;         CFNumberGetValue(static_cast&lt;CFNumberRef&gt;(value), CFNumberTraits&lt;NumberType&gt;::Type, &amp;val);
&gt;         ^~~~~~~~~~~~~~~~
&gt; ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(98,12):  note: in instantiation of function template specialization &apos;numberValueForPreferencesValue&lt;int&gt;&apos; requested here
&gt;     return numberValueForPreferencesValue&lt;int&gt;(value);
&gt;            ^
&gt; C:\webkit\ga\WebKitBuild\Debug\..\..\WebKitLibraries\win\include\CoreFoundation\CFNumber.h(133,9):  note: candidate function not viable: no known conversion from &apos;const unsigned int&apos; to &apos;CFNumberType&apos; for 2nd argument
&gt; Boolean CFNumberGetValue(CFNumberRef number, CFNumberType theType, void *valuePtr);
&gt;         ^
&gt; ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(83,9):  error: no matching function for call to &apos;CFNumberGetValue&apos;
&gt;         CFNumberGetValue(static_cast&lt;CFNumberRef&gt;(value), CFNumberTraits&lt;NumberType&gt;::Type, &amp;val);
&gt;         ^~~~~~~~~~~~~~~~
&gt; ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(409,12):  note: in instantiation of function template specialization &apos;numberValueForPreferencesValue&lt;float&gt;&apos; requested here
&gt;     return numberValueForPreferencesValue&lt;float&gt;(valueForKey(key).get());
&gt;            ^
&gt; C:\webkit\ga\WebKitBuild\Debug\..\..\WebKitLibraries\win\include\CoreFoundation\CFNumber.h(133,9):  note: candidate function not viable: no known conversion from &apos;const unsigned int&apos; to &apos;CFNumberType&apos; for 2nd argument
&gt; Boolean CFNumberGetValue(CFNumberRef number, CFNumberType theType, void *valuePtr);
&gt;         ^
&gt; ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(83,9):  error: no matching function for call to &apos;CFNumberGetValue&apos;
&gt;         CFNumberGetValue(static_cast&lt;CFNumberRef&gt;(value), CFNumberTraits&lt;NumberType&gt;::Type, &amp;val);
&gt;         ^~~~~~~~~~~~~~~~
&gt; ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(414,12):  note: in instantiation of function template specialization &apos;numberValueForPreferencesValue&lt;long long&gt;&apos; requested here
&gt;     return numberValueForPreferencesValue&lt;LONGLONG&gt;(valueForKey(key).get());
&gt;            ^
&gt; C:\webkit\ga\WebKitBuild\Debug\..\..\WebKitLibraries\win\include\CoreFoundation\CFNumber.h(133,9):  note: candidate function not viable: no known conversion from &apos;const unsigned int&apos; to &apos;CFNumberType&apos; for 2nd argument
&gt; Boolean CFNumberGetValue(CFNumberRef number, CFNumberType theType, void *valuePtr);
&gt;         ^
&gt; ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(93,20):  error: no matching function for call to &apos;CFNumberCreate&apos;
&gt;     return adoptCF(CFNumberCreate(0, CFNumberTraits&lt;NumberType&gt;::Type, &amp;value));
&gt;                    ^~~~~~~~~~~~~~
&gt; ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(435,25):  note: in instantiation of function template specialization &apos;cfNumber&lt;int&gt;&apos; requested here
&gt;     setValueForKey(key, cfNumber(value).get());
&gt;                         ^
&gt; C:\webkit\ga\WebKitBuild\Debug\..\..\WebKitLibraries\win\include\CoreFoundation\CFNumber.h(102,13):  note: candidate function not viable: no known conversion from &apos;const unsigned int&apos; to &apos;CFNumberType&apos; for 2nd argument
&gt; CFNumberRef CFNumberCreate(CFAllocatorRef allocator, CFNumberType theType, const void *valuePtr);
&gt;             ^
&gt; ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(93,20):  error: no matching function for call to &apos;CFNumberCreate&apos;
&gt;     return adoptCF(CFNumberCreate(0, CFNumberTraits&lt;NumberType&gt;::Type, &amp;value));
&gt;                    ^~~~~~~~~~~~~~
&gt; ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(445,25):  note: in instantiation of function template specialization &apos;cfNumber&lt;float&gt;&apos; requested here
&gt;     setValueForKey(key, cfNumber(value).get());
&gt;                         ^
&gt; C:\webkit\ga\WebKitBuild\Debug\..\..\WebKitLibraries\win\include\CoreFoundation\CFNumber.h(102,13):  note: candidate function not viable: no known conversion from &apos;const unsigned int&apos; to &apos;CFNumberType&apos; for 2nd argument
&gt; CFNumberRef CFNumberCreate(CFAllocatorRef allocator, CFNumberType theType, const void *valuePtr);
&gt;             ^
&gt; ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(93,20):  error: no matching function for call to &apos;CFNumberCreate&apos;
&gt;     return adoptCF(CFNumberCreate(0, CFNumberTraits&lt;NumberType&gt;::Type, &amp;value));
&gt;                    ^~~~~~~~~~~~~~
&gt; ..\..\Source\WebKitLegacy\win\WebPreferences.cpp(465,25):  note: in instantiation of function template specialization &apos;cfNumber&lt;long long&gt;&apos; requested here
&gt;     setValueForKey(key, cfNumber(value).get());
&gt;                         ^
&gt; C:\webkit\ga\WebKitBuild\Debug\..\..\WebKitLibraries\win\include\CoreFoundation\CFNumber.h(102,13):  note: candidate function not viable: no known conversion from &apos;const unsigned int&apos; to &apos;CFNumberType&apos; for 2nd argument
&gt; CFNumberRef CFNumberCreate(CFAllocatorRef allocator, CFNumberType theType, const void *valuePtr);
&gt;             ^
&gt; 2 warnings and 7 errors generated.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1458887</commentid>
    <comment_count>1</comment_count>
      <attachid>349527</attachid>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-09-11 23:58:20 -0700</bug_when>
    <thetext>Created attachment 349527
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1458888</commentid>
    <comment_count>2</comment_count>
    <who name="EWS Watchlist">ews-watchlist</who>
    <bug_when>2018-09-11 23:59:56 -0700</bug_when>
    <thetext>Attachment 349527 did not pass style-queue:


ERROR: Source/WebKitLegacy/win/WebPreferences.cpp:64:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WebKitLegacy/win/WebPreferences.cpp:65:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WebKitLegacy/win/WebPreferences.cpp:66:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WebKitLegacy/win/WebPreferences.cpp:67:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 4 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1458966</commentid>
    <comment_count>3</comment_count>
      <attachid>349527</attachid>
    <who name="Per Arne Vollan">pvollan</who>
    <bug_when>2018-09-12 09:06:52 -0700</bug_when>
    <thetext>Comment on attachment 349527
Patch

R=me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1459225</commentid>
    <comment_count>4</comment_count>
      <attachid>349527</attachid>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-09-12 19:15:00 -0700</bug_when>
    <thetext>Comment on attachment 349527
Patch

Clearing flags on attachment: 349527

Committed r235966: &lt;https://trac.webkit.org/changeset/235966&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1459226</commentid>
    <comment_count>5</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2018-09-12 19:15:03 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1459230</commentid>
    <comment_count>6</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-09-12 19:16:32 -0700</bug_when>
    <thetext>&lt;rdar://problem/44403488&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>349527</attachid>
            <date>2018-09-11 23:58:20 -0700</date>
            <delta_ts>2018-09-12 19:15:00 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-189538-20180912155819.patch</filename>
            <type>text/plain</type>
            <size>3124</size>
            <attacher name="Fujii Hironori">fujii</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjM1OTI5CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViS2l0TGVn
YWN5L3dpbi9DaGFuZ2VMb2cgYi9Tb3VyY2UvV2ViS2l0TGVnYWN5L3dpbi9DaGFuZ2VMb2cKaW5k
ZXggNWVkMThhMzE0ZTgxYWFhODVlOTI3ZTU3ZmZkZTk1MDdhNTU3NDRiYi4uMjdjOTI2NDIyODEx
Yjk2MDY4OGIwZjY2ZDU1MmIzYmEzZGIyMzE1YSAxMDA2NDQKLS0tIGEvU291cmNlL1dlYktpdExl
Z2FjeS93aW4vQ2hhbmdlTG9nCisrKyBiL1NvdXJjZS9XZWJLaXR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