]> granicus.if.org Git - icu/commitdiff
ICU-12809 only .cpp files no .c in ICU library code
authorAndy Heninger <andy.heninger@gmail.com>
Wed, 7 Dec 2016 21:14:27 +0000 (21:14 +0000)
committerAndy Heninger <andy.heninger@gmail.com>
Wed, 7 Dec 2016 21:14:27 +0000 (21:14 +0000)
X-SVN-Rev: 39527

89 files changed:
icu4c/source/common/cmemory.cpp [moved from icu4c/source/common/cmemory.c with 100% similarity]
icu4c/source/common/common.vcxproj
icu4c/source/common/common.vcxproj.filters
icu4c/source/common/cstring.cpp [moved from icu4c/source/common/cstring.c with 100% similarity]
icu4c/source/common/cwchar.cpp [moved from icu4c/source/common/cwchar.c with 100% similarity]
icu4c/source/common/icudataver.cpp [moved from icu4c/source/common/icudataver.c with 100% similarity]
icu4c/source/common/locmap.cpp [moved from icu4c/source/common/locmap.c with 100% similarity]
icu4c/source/common/propsvec.cpp [moved from icu4c/source/common/propsvec.c with 99% similarity]
icu4c/source/common/uarrsort.cpp [moved from icu4c/source/common/uarrsort.c with 99% similarity]
icu4c/source/common/ubidi.cpp [moved from icu4c/source/common/ubidi.c with 98% similarity]
icu4c/source/common/ubidi_props.cpp [moved from icu4c/source/common/ubidi_props.c with 99% similarity]
icu4c/source/common/ubidiln.cpp [moved from icu4c/source/common/ubidiln.c with 100% similarity]
icu4c/source/common/ubiditransform.cpp [moved from icu4c/source/common/ubiditransform.c with 99% similarity]
icu4c/source/common/ubidiwrt.cpp [moved from icu4c/source/common/ubidiwrt.c with 100% similarity]
icu4c/source/common/ucat.cpp [moved from icu4c/source/common/ucat.c with 100% similarity]
icu4c/source/common/uchar.cpp [moved from icu4c/source/common/uchar.c with 99% similarity]
icu4c/source/common/ucmndata.cpp [moved from icu4c/source/common/ucmndata.c with 99% similarity]
icu4c/source/common/ucnv.cpp [moved from icu4c/source/common/ucnv.c with 100% similarity]
icu4c/source/common/ucnv_cb.cpp [moved from icu4c/source/common/ucnv_cb.c with 100% similarity]
icu4c/source/common/ucnv_cnv.cpp [moved from icu4c/source/common/ucnv_cnv.c with 97% similarity]
icu4c/source/common/ucnv_ct.cpp [moved from icu4c/source/common/ucnv_ct.c with 99% similarity]
icu4c/source/common/ucnv_err.cpp [moved from icu4c/source/common/ucnv_err.c with 98% similarity]
icu4c/source/common/ucnv_lmb.cpp [moved from icu4c/source/common/ucnv_lmb.c with 99% similarity]
icu4c/source/common/ucnv_set.cpp [moved from icu4c/source/common/ucnv_set.c with 100% similarity]
icu4c/source/common/ucnv_u16.cpp [moved from icu4c/source/common/ucnv_u16.c with 99% similarity]
icu4c/source/common/ucnv_u32.cpp [moved from icu4c/source/common/ucnv_u32.c with 99% similarity]
icu4c/source/common/ucnv_u7.cpp [moved from icu4c/source/common/ucnv_u7.c with 99% similarity]
icu4c/source/common/ucnv_u8.cpp [moved from icu4c/source/common/ucnv_u8.c with 100% similarity]
icu4c/source/common/ucnvdisp.cpp [moved from icu4c/source/common/ucnvdisp.c with 100% similarity]
icu4c/source/common/ucnvhz.cpp [moved from icu4c/source/common/ucnvhz.c with 99% similarity]
icu4c/source/common/ucnvisci.cpp [moved from icu4c/source/common/ucnvisci.c with 99% similarity]
icu4c/source/common/ucnvlat1.cpp [moved from icu4c/source/common/ucnvlat1.c with 99% similarity]
icu4c/source/common/ucnvscsu.cpp [moved from icu4c/source/common/ucnvscsu.c with 99% similarity]
icu4c/source/common/udatamem.cpp [moved from icu4c/source/common/udatamem.c with 98% similarity]
icu4c/source/common/udataswp.cpp [moved from icu4c/source/common/udataswp.c with 99% similarity]
icu4c/source/common/uenum.cpp [moved from icu4c/source/common/uenum.c with 100% similarity]
icu4c/source/common/uhash.cpp [moved from icu4c/source/common/uhash.c with 100% similarity]
icu4c/source/common/uinvchar.cpp [moved from icu4c/source/common/uinvchar.c with 99% similarity]
icu4c/source/common/ulist.cpp [moved from icu4c/source/common/ulist.c with 97% similarity]
icu4c/source/common/uloc_tag.cpp [moved from icu4c/source/common/uloc_tag.c with 99% similarity]
icu4c/source/common/umapfile.cpp [moved from icu4c/source/common/umapfile.c with 100% similarity]
icu4c/source/common/umath.cpp [moved from icu4c/source/common/umath.c with 100% similarity]
icu4c/source/common/unicode/umachine.h
icu4c/source/common/unicode/utf8.h
icu4c/source/common/unicode/utf_old.h
icu4c/source/common/ures_cnv.cpp [moved from icu4c/source/common/ures_cnv.c with 95% similarity]
icu4c/source/common/usc_impl.cpp [moved from icu4c/source/common/usc_impl.c with 99% similarity]
icu4c/source/common/uscript.cpp [moved from icu4c/source/common/uscript.c with 100% similarity]
icu4c/source/common/ustrfmt.cpp [moved from icu4c/source/common/ustrfmt.c with 100% similarity]
icu4c/source/common/utf_impl.cpp [moved from icu4c/source/common/utf_impl.c with 95% similarity]
icu4c/source/common/utrace.cpp [moved from icu4c/source/common/utrace.c with 98% similarity]
icu4c/source/common/utracimp.h
icu4c/source/common/utypes.cpp [moved from icu4c/source/common/utypes.c with 100% similarity]
icu4c/source/common/wintz.cpp [moved from icu4c/source/common/wintz.c with 100% similarity]
icu4c/source/i18n/decContext.cpp [moved from icu4c/source/i18n/decContext.c with 100% similarity]
icu4c/source/i18n/decNumber.cpp [moved from icu4c/source/i18n/decNumber.c with 99% similarity]
icu4c/source/i18n/i18n.vcxproj
icu4c/source/i18n/i18n.vcxproj.filters
icu4c/source/i18n/ulocdata.cpp [moved from icu4c/source/i18n/ulocdata.c with 100% similarity]
icu4c/source/i18n/utmscale.cpp [moved from icu4c/source/i18n/utmscale.c with 100% similarity]
icu4c/source/io/io.vcxproj
icu4c/source/io/io.vcxproj.filters
icu4c/source/io/sprintf.cpp [moved from icu4c/source/io/sprintf.c with 100% similarity]
icu4c/source/io/sscanf.cpp [moved from icu4c/source/io/sscanf.c with 100% similarity]
icu4c/source/io/ufile.cpp [moved from icu4c/source/io/ufile.c with 88% similarity]
icu4c/source/io/ufmt_cmn.cpp [moved from icu4c/source/io/ufmt_cmn.c with 100% similarity]
icu4c/source/io/ufmt_cmn.h
icu4c/source/io/uprntf_p.cpp [moved from icu4c/source/io/uprntf_p.c with 99% similarity]
icu4c/source/io/uscanf.cpp [moved from icu4c/source/io/uscanf.c with 100% similarity]
icu4c/source/io/uscanf_p.cpp [moved from icu4c/source/io/uscanf_p.c with 98% similarity]
icu4c/source/io/ustdio.cpp [moved from icu4c/source/io/ustdio.c with 100% similarity]
icu4c/source/stubdata/stubdata.cpp [moved from icu4c/source/stubdata/stubdata.c with 97% similarity]
icu4c/source/stubdata/stubdata.vcxproj
icu4c/source/stubdata/stubdata.vcxproj.filters
icu4c/source/test/cintltst/ccapitst.c
icu4c/source/test/intltest/intltest.vcxproj
icu4c/source/test/intltest/intltest.vcxproj.filters
icu4c/source/test/intltest/strtest.cpp
icu4c/source/tools/toolutil/filestrm.cpp [moved from icu4c/source/tools/toolutil/filestrm.c with 100% similarity]
icu4c/source/tools/toolutil/flagparser.cpp [moved from icu4c/source/tools/toolutil/flagparser.c with 96% similarity]
icu4c/source/tools/toolutil/pkg_genc.cpp [moved from icu4c/source/tools/toolutil/pkg_genc.c with 99% similarity]
icu4c/source/tools/toolutil/pkg_gencmn.cpp [moved from icu4c/source/tools/toolutil/pkg_gencmn.c with 99% similarity]
icu4c/source/tools/toolutil/toolutil.vcxproj
icu4c/source/tools/toolutil/ucm.cpp [moved from icu4c/source/tools/toolutil/ucm.c with 99% similarity]
icu4c/source/tools/toolutil/ucmstate.cpp [moved from icu4c/source/tools/toolutil/ucmstate.c with 99% similarity]
icu4c/source/tools/toolutil/unewdata.cpp [moved from icu4c/source/tools/toolutil/unewdata.c with 100% similarity]
icu4c/source/tools/toolutil/uoptions.cpp [moved from icu4c/source/tools/toolutil/uoptions.c with 100% similarity]
icu4c/source/tools/toolutil/uparse.cpp [moved from icu4c/source/tools/toolutil/uparse.c with 100% similarity]
icu4c/source/tools/toolutil/writesrc.cpp [moved from icu4c/source/tools/toolutil/writesrc.c with 100% similarity]

index e6c9acffb497c280c50cca9079e0dc436a6e37a0..952abc17fd5cfeb1d82935d61ebca80589f24755 100644 (file)
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="filteredbrk.cpp" />
-    <ClCompile Include="ubidi.c" />
-    <ClCompile Include="ubiditransform.c" />
-    <ClCompile Include="ubidi_props.c" />
-    <ClCompile Include="ubidiln.c" />
-    <ClCompile Include="ubidiwrt.c" />
+    <ClCompile Include="ubidi.cpp" />
+    <ClCompile Include="ubiditransform.cpp" />
+    <ClCompile Include="ubidi_props.cpp" />
+    <ClCompile Include="ubidiln.cpp" />
+    <ClCompile Include="ubidiwrt.cpp" />
     <ClCompile Include="uloc_keytype.cpp" />
     <ClCompile Include="ushape.cpp" />
     <ClCompile Include="brkeng.cpp">
       <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\i18n;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\i18n;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ClCompile>
-    <ClCompile Include="propsvec.c" />
-    <ClCompile Include="uarrsort.c" />
-    <ClCompile Include="uenum.c" />
-    <ClCompile Include="uhash.c" />
+    <ClCompile Include="propsvec.cpp" />
+    <ClCompile Include="uarrsort.cpp" />
+    <ClCompile Include="uenum.cpp" />
+    <ClCompile Include="uhash.cpp" />
     <ClCompile Include="uhash_us.cpp" />
-    <ClCompile Include="ulist.c" />
+    <ClCompile Include="ulist.cpp" />
     <ClCompile Include="ustack.cpp" />
     <ClCompile Include="ustrenum.cpp" />
     <ClCompile Include="utrie.cpp" />
     <ClCompile Include="uvectr32.cpp" />
     <ClCompile Include="uvectr64.cpp" />
     <ClCompile Include="errorcode.cpp" />
-    <ClCompile Include="icudataver.c" />
-    <ClCompile Include="locmap.c">
+    <ClCompile Include="icudataver.cpp" />
+    <ClCompile Include="locmap.cpp">
       <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</DisableLanguageExtensions>
       <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</DisableLanguageExtensions>
       <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</DisableLanguageExtensions>
       <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</DisableLanguageExtensions>
       <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</DisableLanguageExtensions>
     </ClCompile>
-    <ClCompile Include="umath.c" />
+    <ClCompile Include="umath.cpp" />
     <ClCompile Include="umutex.cpp">
       <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</DisableLanguageExtensions>
       <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</DisableLanguageExtensions>
       <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</DisableLanguageExtensions>
       <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</DisableLanguageExtensions>
     </ClCompile>
-    <ClCompile Include="utrace.c" />
-    <ClCompile Include="utypes.c" />
-    <ClCompile Include="wintz.c">
+    <ClCompile Include="utrace.cpp" />
+    <ClCompile Include="utypes.cpp" />
+    <ClCompile Include="wintz.cpp">
       <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</DisableLanguageExtensions>
       <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</DisableLanguageExtensions>
       <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</DisableLanguageExtensions>
       <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</DisableLanguageExtensions>
     </ClCompile>
-    <ClCompile Include="ucnv.c" />
+    <ClCompile Include="ucnv.cpp" />
     <ClCompile Include="ucnv2022.cpp" />
     <ClCompile Include="ucnv_bld.cpp">
     </ClCompile>
-    <ClCompile Include="ucnv_cb.c" />
-    <ClCompile Include="ucnv_cnv.c" />
-    <ClCompile Include="ucnv_ct.c" />
-    <ClCompile Include="ucnv_err.c" />
+    <ClCompile Include="ucnv_cb.cpp" />
+    <ClCompile Include="ucnv_cnv.cpp" />
+    <ClCompile Include="ucnv_ct.cpp" />
+    <ClCompile Include="ucnv_err.cpp" />
     <ClCompile Include="ucnv_ext.cpp" />
     <ClCompile Include="ucnv_io.cpp">
     </ClCompile>
-    <ClCompile Include="ucnv_lmb.c" />
-    <ClCompile Include="ucnv_set.c" />
-    <ClCompile Include="ucnv_u16.c" />
-    <ClCompile Include="ucnv_u32.c" />
-    <ClCompile Include="ucnv_u7.c" />
-    <ClCompile Include="ucnv_u8.c" />
+    <ClCompile Include="ucnv_lmb.cpp" />
+    <ClCompile Include="ucnv_set.cpp" />
+    <ClCompile Include="ucnv_u16.cpp" />
+    <ClCompile Include="ucnv_u32.cpp" />
+    <ClCompile Include="ucnv_u7.cpp" />
+    <ClCompile Include="ucnv_u8.cpp" />
     <ClCompile Include="ucnvbocu.cpp" />
-    <ClCompile Include="ucnvdisp.c" />
-    <ClCompile Include="ucnvhz.c" />
-    <ClCompile Include="ucnvisci.c" />
-    <ClCompile Include="ucnvlat1.c" />
+    <ClCompile Include="ucnvdisp.cpp" />
+    <ClCompile Include="ucnvhz.cpp" />
+    <ClCompile Include="ucnvisci.cpp" />
+    <ClCompile Include="ucnvlat1.cpp" />
     <ClCompile Include="ucnvmbcs.cpp" />
-    <ClCompile Include="ucnvscsu.c" />
+    <ClCompile Include="ucnvscsu.cpp" />
     <ClCompile Include="ucnvsel.cpp">
     </ClCompile>
-    <ClCompile Include="cmemory.c" />
+    <ClCompile Include="cmemory.cpp" />
     <ClCompile Include="ucln_cmn.cpp">
       <DisableLanguageExtensions>false</DisableLanguageExtensions>
     </ClCompile>
-    <ClCompile Include="ucmndata.c" />
+    <ClCompile Include="ucmndata.cpp" />
     <ClCompile Include="udata.cpp" />
-    <ClCompile Include="udatamem.c" />
-    <ClCompile Include="udataswp.c" />
+    <ClCompile Include="udatamem.cpp" />
+    <ClCompile Include="udataswp.cpp" />
     <ClCompile Include="uinit.cpp">
       <DisableLanguageExtensions>false</DisableLanguageExtensions>
     </ClCompile>
-    <ClCompile Include="umapfile.c">
+    <ClCompile Include="umapfile.cpp">
       <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</DisableLanguageExtensions>
       <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</DisableLanguageExtensions>
       <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</DisableLanguageExtensions>
     <ClCompile Include="uobject.cpp" />
     <ClCompile Include="dtintrv.cpp" />
     <ClCompile Include="parsepos.cpp" />
-    <ClCompile Include="ustrfmt.c" />
+    <ClCompile Include="ustrfmt.cpp" />
     <ClCompile Include="util.cpp" />
     <ClCompile Include="util_props.cpp" />
     <ClCompile Include="punycode.cpp" />
     <ClCompile Include="resbund.cpp">
     </ClCompile>
     <ClCompile Include="resbund_cnv.cpp" />
-    <ClCompile Include="ucat.c" />
+    <ClCompile Include="ucat.cpp" />
     <ClCompile Include="uloc.cpp" />
-    <ClCompile Include="uloc_tag.c" />
-    <ClCompile Include="ures_cnv.c" />
+    <ClCompile Include="uloc_tag.cpp" />
+    <ClCompile Include="ures_cnv.cpp" />
     <ClCompile Include="uresbund.cpp" />
     <ClCompile Include="uresdata.cpp" />
     <ClCompile Include="resource.cpp" />
     <ClCompile Include="ruleiter.cpp" />
     <ClCompile Include="ucase.cpp">
     </ClCompile>
-    <ClCompile Include="uchar.c" />
+    <ClCompile Include="uchar.cpp" />
     <ClCompile Include="unames.cpp" />
     <ClCompile Include="unifiedcache.cpp">
       <DisableLanguageExtensions>false</DisableLanguageExtensions>
     <ClCompile Include="uniset_props.cpp" />
     <ClCompile Include="unisetspan.cpp" />
     <ClCompile Include="uprops.cpp" />
-    <ClCompile Include="usc_impl.c" />
-    <ClCompile Include="uscript.c" />
+    <ClCompile Include="usc_impl.cpp" />
+    <ClCompile Include="uscript.cpp" />
     <ClCompile Include="uscript_props.cpp" />
     <ClCompile Include="uset.cpp" />
     <ClCompile Include="uset_props.cpp" />
     <ClCompile Include="bytestrieiterator.cpp" />
     <ClCompile Include="chariter.cpp" />
     <ClCompile Include="charstr.cpp" />
-    <ClCompile Include="cstring.c" />
+    <ClCompile Include="cstring.cpp" />
     <ClCompile Include="cstr.cpp" />
-    <ClCompile Include="cwchar.c" />
+    <ClCompile Include="cwchar.cpp" />
     <ClCompile Include="messagepattern.cpp" />
     <ClCompile Include="schriter.cpp" />
     <ClCompile Include="stringpiece.cpp" />
     <ClCompile Include="ucharstriebuilder.cpp" />
     <ClCompile Include="ucharstrieiterator.cpp" />
     <ClCompile Include="uchriter.cpp" />
-    <ClCompile Include="uinvchar.c" />
+    <ClCompile Include="uinvchar.cpp" />
     <ClCompile Include="uiter.cpp" />
     <ClCompile Include="unistr.cpp" />
     <ClCompile Include="unistr_case.cpp" />
     <ClCompile Include="ustring.cpp" />
     <ClCompile Include="ustrtrns.cpp" />
     <ClCompile Include="utext.cpp" />
-    <ClCompile Include="utf_impl.c" />
+    <ClCompile Include="utf_impl.cpp" />
     <ClCompile Include="listformatter.cpp" />
     <ClCompile Include="ulistformatter.cpp" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
index 56e8c12f04d276633769a6bc7d7df1ad76eb2dc6..8cf40fb1c0e12ec621b966b8121e782b42b87265 100644 (file)
     </Filter>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="ubidi.c">
+    <ClCompile Include="ubidi.cpp">
       <Filter>bidi</Filter>
     </ClCompile>
-    <ClCompile Include="ubidi_props.c">
+    <ClCompile Include="ubidi_props.cpp">
       <Filter>bidi</Filter>
     </ClCompile>
-    <ClCompile Include="ubidiln.c">
+    <ClCompile Include="ubidiln.cpp">
       <Filter>bidi</Filter>
     </ClCompile>
-    <ClCompile Include="ubidiwrt.c">
+    <ClCompile Include="ubidiwrt.cpp">
       <Filter>bidi</Filter>
     </ClCompile>
     <ClCompile Include="ushape.cpp">
     <ClCompile Include="pluralmap.cpp">
       <Filter>collections</Filter>
     </ClCompile>
-    <ClCompile Include="propsvec.c">
+    <ClCompile Include="propsvec.cpp">
       <Filter>collections</Filter>
     </ClCompile>
-    <ClCompile Include="uarrsort.c">
+    <ClCompile Include="uarrsort.cpp">
       <Filter>collections</Filter>
     </ClCompile>
-    <ClCompile Include="uenum.c">
+    <ClCompile Include="uenum.cpp">
       <Filter>collections</Filter>
     </ClCompile>
-    <ClCompile Include="uhash.c">
+    <ClCompile Include="uhash.cpp">
       <Filter>collections</Filter>
     </ClCompile>
     <ClCompile Include="uhash_us.cpp">
       <Filter>collections</Filter>
     </ClCompile>
-    <ClCompile Include="ulist.c">
+    <ClCompile Include="ulist.cpp">
       <Filter>collections</Filter>
     </ClCompile>
     <ClCompile Include="unifiedcache.cpp">
     <ClCompile Include="errorcode.cpp">
       <Filter>configuration</Filter>
     </ClCompile>
-    <ClCompile Include="icudataver.c">
+    <ClCompile Include="icudataver.cpp">
       <Filter>configuration</Filter>
     </ClCompile>
-    <ClCompile Include="locmap.c">
+    <ClCompile Include="locmap.cpp">
       <Filter>configuration</Filter>
     </ClCompile>
     <ClCompile Include="putil.cpp">
       <Filter>configuration</Filter>
     </ClCompile>
-    <ClCompile Include="umath.c">
+    <ClCompile Include="umath.cpp">
       <Filter>configuration</Filter>
     </ClCompile>
     <ClCompile Include="umutex.cpp">
       <Filter>configuration</Filter>
     </ClCompile>
-    <ClCompile Include="utrace.c">
+    <ClCompile Include="utrace.cpp">
       <Filter>configuration</Filter>
     </ClCompile>
-    <ClCompile Include="utypes.c">
+    <ClCompile Include="utypes.cpp">
       <Filter>configuration</Filter>
     </ClCompile>
-    <ClCompile Include="wintz.c">
+    <ClCompile Include="wintz.cpp">
       <Filter>configuration</Filter>
     </ClCompile>
-    <ClCompile Include="ucnv.c">
+    <ClCompile Include="ucnv.cpp">
       <Filter>conversion</Filter>
     </ClCompile>
     <ClCompile Include="ucnv2022.cpp">
     <ClCompile Include="ucnv_bld.cpp">
       <Filter>conversion</Filter>
     </ClCompile>
-    <ClCompile Include="ucnv_cb.c">
+    <ClCompile Include="ucnv_cb.cpp">
       <Filter>conversion</Filter>
     </ClCompile>
-    <ClCompile Include="ucnv_cnv.c">
+    <ClCompile Include="ucnv_cnv.cpp">
       <Filter>conversion</Filter>
     </ClCompile>
-    <ClCompile Include="ucnv_err.c">
+    <ClCompile Include="ucnv_err.cpp">
       <Filter>conversion</Filter>
     </ClCompile>
     <ClCompile Include="ucnv_ext.cpp">
     <ClCompile Include="ucnv_io.cpp">
       <Filter>conversion</Filter>
     </ClCompile>
-    <ClCompile Include="ucnv_lmb.c">
+    <ClCompile Include="ucnv_lmb.cpp">
       <Filter>conversion</Filter>
     </ClCompile>
-    <ClCompile Include="ucnv_set.c">
+    <ClCompile Include="ucnv_set.cpp">
       <Filter>conversion</Filter>
     </ClCompile>
-    <ClCompile Include="ucnv_u16.c">
+    <ClCompile Include="ucnv_u16.cpp">
       <Filter>conversion</Filter>
     </ClCompile>
-    <ClCompile Include="ucnv_u32.c">
+    <ClCompile Include="ucnv_u32.cpp">
       <Filter>conversion</Filter>
     </ClCompile>
-    <ClCompile Include="ucnv_u7.c">
+    <ClCompile Include="ucnv_u7.cpp">
       <Filter>conversion</Filter>
     </ClCompile>
-    <ClCompile Include="ucnv_u8.c">
+    <ClCompile Include="ucnv_u8.cpp">
       <Filter>conversion</Filter>
     </ClCompile>
     <ClCompile Include="ucnvbocu.cpp">
       <Filter>conversion</Filter>
     </ClCompile>
-    <ClCompile Include="ucnvdisp.c">
+    <ClCompile Include="ucnvdisp.cpp">
       <Filter>conversion</Filter>
     </ClCompile>
-    <ClCompile Include="ucnvhz.c">
+    <ClCompile Include="ucnvhz.cpp">
       <Filter>conversion</Filter>
     </ClCompile>
-    <ClCompile Include="ucnvisci.c">
+    <ClCompile Include="ucnvisci.cpp">
       <Filter>conversion</Filter>
     </ClCompile>
-    <ClCompile Include="ucnvlat1.c">
+    <ClCompile Include="ucnvlat1.cpp">
       <Filter>conversion</Filter>
     </ClCompile>
     <ClCompile Include="ucnvmbcs.cpp">
       <Filter>conversion</Filter>
     </ClCompile>
-    <ClCompile Include="ucnvscsu.c">
+    <ClCompile Include="ucnvscsu.cpp">
       <Filter>conversion</Filter>
     </ClCompile>
     <ClCompile Include="ucnvsel.cpp">
       <Filter>conversion</Filter>
     </ClCompile>
-    <ClCompile Include="cmemory.c">
+    <ClCompile Include="cmemory.cpp">
       <Filter>data &amp; memory</Filter>
     </ClCompile>
     <ClCompile Include="sharedobject.cpp">
     <ClCompile Include="ucln_cmn.cpp">
       <Filter>data &amp; memory</Filter>
     </ClCompile>
-    <ClCompile Include="ucmndata.c">
+    <ClCompile Include="ucmndata.cpp">
       <Filter>data &amp; memory</Filter>
     </ClCompile>
     <ClCompile Include="udata.cpp">
       <Filter>data &amp; memory</Filter>
     </ClCompile>
-    <ClCompile Include="udatamem.c">
+    <ClCompile Include="udatamem.cpp">
       <Filter>data &amp; memory</Filter>
     </ClCompile>
-    <ClCompile Include="udataswp.c">
+    <ClCompile Include="udataswp.cpp">
       <Filter>data &amp; memory</Filter>
     </ClCompile>
     <ClCompile Include="uinit.cpp">
       <Filter>data &amp; memory</Filter>
     </ClCompile>
-    <ClCompile Include="umapfile.c">
+    <ClCompile Include="umapfile.cpp">
       <Filter>data &amp; memory</Filter>
     </ClCompile>
     <ClCompile Include="uobject.cpp">
     <ClCompile Include="ucurr.cpp">
       <Filter>formatting</Filter>
     </ClCompile>
-    <ClCompile Include="ustrfmt.c">
+    <ClCompile Include="ustrfmt.cpp">
       <Filter>formatting</Filter>
     </ClCompile>
     <ClCompile Include="util.cpp">
     <ClCompile Include="resbund_cnv.cpp">
       <Filter>locales &amp; resources</Filter>
     </ClCompile>
-    <ClCompile Include="ucat.c">
+    <ClCompile Include="ucat.cpp">
       <Filter>locales &amp; resources</Filter>
     </ClCompile>
     <ClCompile Include="uloc.cpp">
       <Filter>locales &amp; resources</Filter>
     </ClCompile>
-    <ClCompile Include="uloc_tag.c">
+    <ClCompile Include="uloc_tag.cpp">
       <Filter>locales &amp; resources</Filter>
     </ClCompile>
-    <ClCompile Include="ures_cnv.c">
+    <ClCompile Include="ures_cnv.cpp">
       <Filter>locales &amp; resources</Filter>
     </ClCompile>
     <ClCompile Include="uresbund.cpp">
     <ClCompile Include="ucase.cpp">
       <Filter>properties &amp; sets</Filter>
     </ClCompile>
-    <ClCompile Include="uchar.c">
+    <ClCompile Include="uchar.cpp">
       <Filter>properties &amp; sets</Filter>
     </ClCompile>
     <ClCompile Include="unames.cpp">
     <ClCompile Include="uprops.cpp">
       <Filter>properties &amp; sets</Filter>
     </ClCompile>
-    <ClCompile Include="usc_impl.c">
+    <ClCompile Include="usc_impl.cpp">
       <Filter>properties &amp; sets</Filter>
     </ClCompile>
-    <ClCompile Include="uscript.c">
+    <ClCompile Include="uscript.cpp">
       <Filter>properties &amp; sets</Filter>
     </ClCompile>
     <ClCompile Include="uscript_props.cpp">
     <ClCompile Include="charstr.cpp">
       <Filter>strings</Filter>
     </ClCompile>
-    <ClCompile Include="cstring.c">
+    <ClCompile Include="cstring.cpp">
       <Filter>strings</Filter>
     </ClCompile>
     <ClCompile Include="cstr.cpp">
       <Filter>strings</Filter>
     </ClCompile>
-    <ClCompile Include="cwchar.c">
+    <ClCompile Include="cwchar.cpp">
       <Filter>strings</Filter>
     </ClCompile>
     <ClCompile Include="schriter.cpp">
     <ClCompile Include="uchriter.cpp">
       <Filter>strings</Filter>
     </ClCompile>
-    <ClCompile Include="uinvchar.c">
+    <ClCompile Include="uinvchar.cpp">
       <Filter>strings</Filter>
     </ClCompile>
     <ClCompile Include="uiter.cpp">
     <ClCompile Include="utext.cpp">
       <Filter>strings</Filter>
     </ClCompile>
-    <ClCompile Include="utf_impl.c">
+    <ClCompile Include="utf_impl.cpp">
       <Filter>strings</Filter>
     </ClCompile>
     <ClCompile Include="bytestrie.cpp">
     <ClCompile Include="dictionarydata.cpp">
       <Filter>break iteration</Filter>
     </ClCompile>
-    <ClCompile Include="ucnv_ct.c">
+    <ClCompile Include="ucnv_ct.cpp">
       <Filter>conversion</Filter>
     </ClCompile>
     <ClCompile Include="ucharstrie.cpp">
     <ClCompile Include="icuplug.cpp">
       <Filter>registration</Filter>
     </ClCompile>
-    <ClCompile Include="ubiditransform.c">
+    <ClCompile Include="ubiditransform.cpp">
       <Filter>bidi</Filter>
     </ClCompile>
   </ItemGroup>
       <Filter>collections</Filter>
     </CustomBuild>
   </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
similarity index 99%
rename from icu4c/source/common/propsvec.c
rename to icu4c/source/common/propsvec.cpp
index ed4d89954b872f72fa66e67def7ff4d8eaa2a517..6067adf3cf241d544eec3765b8f0f99a09b477c8 100644 (file)
@@ -499,6 +499,8 @@ upvec_compactToUTrie2Handler(void *context,
                              UChar32 start, UChar32 end,
                              int32_t rowIndex, uint32_t *row, int32_t columns,
                              UErrorCode *pErrorCode) {
+    (void)row;
+    (void)columns;
     UPVecToUTrie2Context *toUTrie2=(UPVecToUTrie2Context *)context;
     if(start<UPVEC_FIRST_SPECIAL_CP) {
         utrie2_setRange32(toUTrie2->trie, start, end, (uint32_t)rowIndex, TRUE, pErrorCode);
similarity index 99%
rename from icu4c/source/common/uarrsort.c
rename to icu4c/source/common/uarrsort.cpp
index bb1b5bdd785febe0374a9fd0cd67f98fd41506f1..4d5d8ee08c01f683196a9ad17df3cf9b94323f72 100644 (file)
@@ -38,16 +38,19 @@ enum {
 
 U_CAPI int32_t U_EXPORT2
 uprv_uint16Comparator(const void *context, const void *left, const void *right) {
+    (void)context;
     return (int32_t)*(const uint16_t *)left - (int32_t)*(const uint16_t *)right;
 }
 
 U_CAPI int32_t U_EXPORT2
 uprv_int32Comparator(const void *context, const void *left, const void *right) {
+    (void)context;
     return *(const int32_t *)left - *(const int32_t *)right;
 }
 
 U_CAPI int32_t U_EXPORT2
 uprv_uint32Comparator(const void *context, const void *left, const void *right) {
+    (void)context;
     uint32_t l=*(const uint32_t *)left, r=*(const uint32_t *)right;
 
     /* compare directly because (l-r) would overflow the int32_t result */
similarity index 98%
rename from icu4c/source/common/ubidi.c
rename to icu4c/source/common/ubidi.cpp
index 3c9497862639ba70fad44c4449c281540fb12cfa..60d5a0997465bf85b37208b2f1f53b145ebb21f0 100644 (file)
@@ -447,12 +447,12 @@ getDirProps(UBiDi *pBiDi) {
     UBool removeBiDiControls = (UBool)(pBiDi->reorderingOptions &
                                        UBIDI_OPTION_REMOVE_CONTROLS);
 
-    typedef enum {
+    enum State {
          NOT_SEEKING_STRONG,            /* 0: not contextual paraLevel, not after FSI */
          SEEKING_STRONG_FOR_PARA,       /* 1: looking for first strong char in para */
          SEEKING_STRONG_FOR_FSI,        /* 2: looking for first strong after FSI */
          LOOKING_FOR_PDI                /* 3: found strong after FSI, looking for PDI */
-    } State;
+    };
     State state;
     DirProp lastStrong=ON;              /* for default level & inverse BiDi */
     /* The following stacks are used to manage isolate sequences. Those
@@ -466,7 +466,7 @@ getDirProps(UBiDi *pBiDi) {
     int32_t isolateStartStack[UBIDI_MAX_EXPLICIT_LEVEL+1];
     /* The following stack contains the last known state before
        encountering the initiator of an isolate sequence */
-    int8_t  previousStateStack[UBIDI_MAX_EXPLICIT_LEVEL+1];
+    State  previousStateStack[UBIDI_MAX_EXPLICIT_LEVEL+1];
     int32_t stackLast=-1;
 
     if(pBiDi->reorderingOptions & UBIDI_OPTION_STREAMING)
@@ -677,7 +677,9 @@ bracketInit(UBiDi *pBiDi, BracketData *bd) {
     bd->isoRuns[0].start=0;
     bd->isoRuns[0].limit=0;
     bd->isoRuns[0].level=GET_PARALEVEL(pBiDi, 0);
-    bd->isoRuns[0].lastStrong=bd->isoRuns[0].lastBase=bd->isoRuns[0].contextDir=GET_PARALEVEL(pBiDi, 0)&1;
+    UBiDiLevel t = GET_PARALEVEL(pBiDi, 0) & 1;
+    bd->isoRuns[0].lastStrong = bd->isoRuns[0].lastBase = t;
+    bd->isoRuns[0].contextDir = (UBiDiDirection)t;
     bd->isoRuns[0].contextPos=0;
     if(pBiDi->openingsMemory) {
         bd->openings=pBiDi->openingsMemory;
@@ -696,7 +698,8 @@ bracketProcessB(BracketData *bd, UBiDiLevel level) {
     bd->isoRunLast=0;
     bd->isoRuns[0].limit=0;
     bd->isoRuns[0].level=level;
-    bd->isoRuns[0].lastStrong=bd->isoRuns[0].lastBase=bd->isoRuns[0].contextDir=level&1;
+    bd->isoRuns[0].lastStrong=bd->isoRuns[0].lastBase=level&1;
+    bd->isoRuns[0].contextDir=(UBiDiDirection)(level&1);
     bd->isoRuns[0].contextPos=0;
 }
 
@@ -712,8 +715,9 @@ bracketProcessBoundary(BracketData *bd, int32_t lastCcPos,
         contextLevel=embeddingLevel;
     pLastIsoRun->limit=pLastIsoRun->start;
     pLastIsoRun->level=embeddingLevel;
-    pLastIsoRun->lastStrong=pLastIsoRun->lastBase=pLastIsoRun->contextDir=contextLevel&1;
-    pLastIsoRun->contextPos=lastCcPos;
+    pLastIsoRun->lastStrong=pLastIsoRun->lastBase=contextLevel&1;
+    pLastIsoRun->contextDir=(UBiDiDirection)(contextLevel&1);
+    pLastIsoRun->contextPos=(UBiDiDirection)lastCcPos;
 }
 
 /* LRI or RLI */
@@ -727,7 +731,8 @@ bracketProcessLRI_RLI(BracketData *bd, UBiDiLevel level) {
     pLastIsoRun++;
     pLastIsoRun->start=pLastIsoRun->limit=lastLimit;
     pLastIsoRun->level=level;
-    pLastIsoRun->lastStrong=pLastIsoRun->lastBase=pLastIsoRun->contextDir=level&1;
+    pLastIsoRun->lastStrong=pLastIsoRun->lastBase=level&1;
+    pLastIsoRun->contextDir=(UBiDiDirection)(level&1);
     pLastIsoRun->contextPos=0;
 }
 
@@ -801,7 +806,7 @@ bracketProcessClosing(BracketData *bd, int32_t openIdx, int32_t position) {
     UBool stable;
     DirProp newProp;
     pOpening=&bd->openings[openIdx];
-    direction=pLastIsoRun->level&1;
+    direction=(UBiDiDirection)(pLastIsoRun->level&1);
     stable=TRUE;            /* assume stable until proved otherwise */
 
     /* The stable flag is set when brackets are paired and their
@@ -894,7 +899,7 @@ bracketProcessChar(BracketData *bd, int32_t position) {
                 break;
             }
             pLastIsoRun->lastBase=ON;
-            pLastIsoRun->contextDir=newProp;
+            pLastIsoRun->contextDir=(UBiDiDirection)newProp;
             pLastIsoRun->contextPos=position;
             level=bd->pBiDi->levels[position];
             if(level&UBIDI_LEVEL_OVERRIDE) {    /* X4, X5 */
@@ -942,14 +947,14 @@ bracketProcessChar(BracketData *bd, int32_t position) {
             dirProps[position]=newProp;
         pLastIsoRun->lastBase=newProp;
         pLastIsoRun->lastStrong=newProp;
-        pLastIsoRun->contextDir=newProp;
+        pLastIsoRun->contextDir=(UBiDiDirection)newProp;
         pLastIsoRun->contextPos=position;
     }
     else if(dirProp<=R || dirProp==AL) {
         newProp=DIR_FROM_STRONG(dirProp);
         pLastIsoRun->lastBase=dirProp;
         pLastIsoRun->lastStrong=dirProp;
-        pLastIsoRun->contextDir=newProp;
+        pLastIsoRun->contextDir=(UBiDiDirection)newProp;
         pLastIsoRun->contextPos=position;
     }
     else if(dirProp==EN) {
@@ -958,7 +963,7 @@ bracketProcessChar(BracketData *bd, int32_t position) {
             newProp=L;                  /* W7 */
             if(!bd->isNumbersSpecial)
                 dirProps[position]=ENL;
-            pLastIsoRun->contextDir=L;
+            pLastIsoRun->contextDir=(UBiDiDirection)L;
             pLastIsoRun->contextPos=position;
         }
         else {
@@ -967,14 +972,14 @@ bracketProcessChar(BracketData *bd, int32_t position) {
                 dirProps[position]=AN;  /* W2 */
             else
                 dirProps[position]=ENR;
-            pLastIsoRun->contextDir=R;
+            pLastIsoRun->contextDir=(UBiDiDirection)R;
             pLastIsoRun->contextPos=position;
         }
     }
     else if(dirProp==AN) {
         newProp=R;                      /* N0 */
         pLastIsoRun->lastBase=AN;
-        pLastIsoRun->contextDir=R;
+        pLastIsoRun->contextDir=(UBiDiDirection)R;
         pLastIsoRun->contextPos=position;
     }
     else if(dirProp==NSM) {
@@ -1313,7 +1318,7 @@ resolveExplicitLevels(UBiDi *pBiDi, UErrorCode *pErrorCode) {
                 previousLevel=embeddingLevel;
                 levels[i]=embeddingLevel;
                 if(!bracketProcessChar(&bracketData, i))
-                    return -1;
+                    return (UBiDiDirection)-1;
                 /* the dirProp may have been changed in bracketProcessChar() */
                 flags|=DIRPROP_FLAG(dirProps[i]);
                 break;
@@ -1772,7 +1777,7 @@ addPoint(UBiDi *pBiDi, int32_t pos, int32_t flag)
 
     if (pInsertPoints->capacity == 0)
     {
-        pInsertPoints->points=uprv_malloc(sizeof(Point)*FIRSTALLOC);
+        pInsertPoints->points=static_cast<Point *>(uprv_malloc(sizeof(Point)*FIRSTALLOC));
         if (pInsertPoints->points == NULL)
         {
             pInsertPoints->errorCode=U_MEMORY_ALLOCATION_ERROR;
@@ -1782,9 +1787,9 @@ addPoint(UBiDi *pBiDi, int32_t pos, int32_t flag)
     }
     if (pInsertPoints->size >= pInsertPoints->capacity) /* no room for new point */
     {
-        void * savePoints=pInsertPoints->points;
-        pInsertPoints->points=uprv_realloc(pInsertPoints->points,
-                                           pInsertPoints->capacity*2*sizeof(Point));
+        Point * savePoints=pInsertPoints->points;
+        pInsertPoints->points=static_cast<Point *>(uprv_realloc(pInsertPoints->points,
+                                           pInsertPoints->capacity*2*sizeof(Point)));
         if (pInsertPoints->points == NULL)
         {
             pInsertPoints->points=savePoints;
@@ -2342,7 +2347,7 @@ setParaSuccess(UBiDi *pBiDi) {
 static void
 setParaRunsOnly(UBiDi *pBiDi, const UChar *text, int32_t length,
                 UBiDiLevel paraLevel, UErrorCode *pErrorCode) {
-    void *runsOnlyMemory = NULL;
+    int32_t *runsOnlyMemory = NULL;
     int32_t *visualMap;
     UChar *visualText;
     int32_t saveLength, saveTrailingWSStart;
@@ -2363,7 +2368,7 @@ setParaRunsOnly(UBiDi *pBiDi, const UChar *text, int32_t length,
         goto cleanup3;
     }
     /* obtain memory for mapping table and visual text */
-    runsOnlyMemory=uprv_malloc(length*(sizeof(int32_t)+sizeof(UChar)+sizeof(UBiDiLevel)));
+    runsOnlyMemory=static_cast<int32_t *>(uprv_malloc(length*(sizeof(int32_t)+sizeof(UChar)+sizeof(UBiDiLevel))));
     if(runsOnlyMemory==NULL) {
         *pErrorCode=U_MEMORY_ALLOCATION_ERROR;
         goto cleanup3;
@@ -2558,7 +2563,7 @@ ubidi_setPara(UBiDi *pBiDi, const UChar *text, int32_t length,
     pBiDi->text=text;
     pBiDi->length=pBiDi->originalLength=pBiDi->resultLength=length;
     pBiDi->paraLevel=paraLevel;
-    pBiDi->direction=paraLevel&1;
+    pBiDi->direction=(UBiDiDirection)(paraLevel&1);
     pBiDi->paraCount=1;
 
     pBiDi->dirProps=NULL;
@@ -3009,7 +3014,7 @@ ubidi_getCustomizedClass(UBiDi *pBiDi, UChar32 c)
         dir = ubidi_getClass(pBiDi->bdp, c);
     }
     if(dir >= U_CHAR_DIRECTION_COUNT) {
-        dir = ON;
+        dir = (UCharDirection)ON;
     }
     return dir;
 }
similarity index 99%
rename from icu4c/source/common/ubidi_props.c
rename to icu4c/source/common/ubidi_props.cpp
index 7c7a6ce25efef023af074cba344a48037837ce60..121a1ff37cc1bd6537994d3240573280e29e6e68 100644 (file)
@@ -55,6 +55,8 @@ ubidi_getSingleton() {
 
 static UBool U_CALLCONV
 _enumPropertyStartsRange(const void *context, UChar32 start, UChar32 end, uint32_t value) {
+    (void)end;
+    (void)value;
     /* add the start code point to the USet */
     const USetAdder *sa=(const USetAdder *)context;
     sa->add(sa->set, start);
similarity index 99%
rename from icu4c/source/common/ubiditransform.c
rename to icu4c/source/common/ubiditransform.cpp
index 5f83a2b5a62e77008b1e6cfd124d84bd4f3b1d8f..4b19717e2dc62b99bb133f29696a6b17abf88b45 100644 (file)
@@ -165,6 +165,7 @@ action_reorder(UBiDiTransform *pTransform, UErrorCode *pErrorCode)
 static UBool
 action_setInverse(UBiDiTransform *pTransform, UErrorCode *pErrorCode)
 {
+    (void)pErrorCode;
     ubidi_setInverse(pTransform->pBidi, TRUE);
     ubidi_setReorderingMode(pTransform->pBidi, UBIDI_REORDER_INVERSE_LIKE_DIRECT);
     return FALSE;
@@ -183,6 +184,7 @@ action_setInverse(UBiDiTransform *pTransform, UErrorCode *pErrorCode)
 static UBool
 action_setRunsOnly(UBiDiTransform *pTransform, UErrorCode *pErrorCode)
 {
+    (void)pErrorCode;
     ubidi_setReorderingMode(pTransform->pBidi, UBIDI_REORDER_RUNS_ONLY);
     return FALSE;
 }
similarity index 99%
rename from icu4c/source/common/uchar.c
rename to icu4c/source/common/uchar.cpp
index 496df86f4ce1bf37f55a7df0465f6feded7b8522..fcd1f8c732bbf8afccb6b204a04c63c8be44e0ca 100644 (file)
@@ -68,6 +68,7 @@ struct _EnumTypeCallback {
 
 static uint32_t U_CALLCONV
 _enumTypeValue(const void *context, uint32_t value) {
+    (void)context;
     return GET_CATEGORY(value);
 }
 
@@ -654,6 +655,8 @@ _enumPropertyStartsRange(const void *context, UChar32 start, UChar32 end, uint32
     /* add the start code point to the USet */
     const USetAdder *sa=(const USetAdder *)context;
     sa->add(sa->set, start);
+    (void)end;
+    (void)value;
     return TRUE;
 }
 
similarity index 99%
rename from icu4c/source/common/ucmndata.c
rename to icu4c/source/common/ucmndata.cpp
index 6b7d78d104d186602fb9c0e75979d1e57f63b8a1..fdb21b305709ce5ae907a055d6845764208bd1de 100644 (file)
@@ -221,6 +221,7 @@ offsetTOCLookupFn(const UDataMemory *pData,
                   const char *tocEntryName,
                   int32_t *pLength,
                   UErrorCode *pErrorCode) {
+    (void)pErrorCode;
     const UDataOffsetTOC  *toc = (UDataOffsetTOC *)pData->toc;
     if(toc!=NULL) {
         const char *base=(const char *)toc;
@@ -272,6 +273,7 @@ static const DataHeader *pointerTOCLookupFn(const UDataMemory *pData,
                    const char *name,
                    int32_t *pLength,
                    UErrorCode *pErrorCode) {
+    (void)pErrorCode;
     if(pData->toc!=NULL) {
         const PointerTOC *toc = (PointerTOC *)pData->toc;
         int32_t number, count=(int32_t)toc->count;
similarity index 97%
rename from icu4c/source/common/ucnv_cnv.c
rename to icu4c/source/common/ucnv_cnv.cpp
index 01f84829dd3f7d939e72392bd8e529ae5ba50dc6..6e1c53fd8b7e52a9634c3b168b6bfde01daa1302 100644 (file)
@@ -33,6 +33,9 @@ ucnv_getCompleteUnicodeSet(const UConverter *cnv,
                    const USetAdder *sa,
                    UConverterUnicodeSet which,
                    UErrorCode *pErrorCode) {
+    (void)cnv;
+    (void)which;
+    (void)pErrorCode;
     sa->addRange(sa->set, 0, 0x10ffff);
 }
 
@@ -41,6 +44,9 @@ ucnv_getNonSurrogateUnicodeSet(const UConverter *cnv,
                                const USetAdder *sa,
                                UConverterUnicodeSet which,
                                UErrorCode *pErrorCode) {
+    (void)cnv;
+    (void)which;
+    (void)pErrorCode;
     sa->addRange(sa->set, 0, 0xd7ff);
     sa->addRange(sa->set, 0xe000, 0x10ffff);
 }
similarity index 99%
rename from icu4c/source/common/ucnv_ct.c
rename to icu4c/source/common/ucnv_ct.cpp
index f76919c4a54f305380ca77b43f924ff56cf86ab0..c59c0c6bf54ac2c37b15de5f16448ffb1ff034bb 100644 (file)
@@ -264,7 +264,7 @@ _CompoundTextOpen(UConverter *cnv, UConverterLoadArgs *pArgs, UErrorCode *errorC
         UConverterDataCompoundText *myConverterData = (UConverterDataCompoundText *) cnv->extraInfo;
 
         UConverterNamePieces stackPieces;
-        UConverterLoadArgs stackArgs={ (int32_t)sizeof(UConverterLoadArgs) };
+        UConverterLoadArgs stackArgs=UCNV_LOAD_ARGS_INITIALIZER;
 
         myConverterData->myConverterArray[COMPOUND_TEXT_SINGLE_0] = NULL;
         myConverterData->myConverterArray[COMPOUND_TEXT_SINGLE_1] = ucnv_loadSharedData("icu-internal-compound-s1", &stackPieces, &stackArgs, errorCode);
@@ -319,10 +319,13 @@ _CompoundTextClose(UConverter *converter) {
 
 static void
 _CompoundTextReset(UConverter *converter, UConverterResetChoice choice) {
+    (void)converter;
+    (void)choice;
 }
 
 static const char*
 _CompoundTextgetName(const UConverter* cnv){
+    (void)cnv;
     return "x11-compound-text";
 }
 
@@ -613,7 +616,9 @@ static const UConverterImpl _CompoundTextImpl = {
     _CompoundTextgetName,
     NULL,
     NULL,
-    _CompoundText_GetUnicodeSet
+    _CompoundText_GetUnicodeSet,
+    NULL,
+    NULL
 };
 static const UConverterStaticData _CompoundTextStaticData = {
     sizeof(UConverterStaticData),
similarity index 98%
rename from icu4c/source/common/ucnv_err.c
rename to icu4c/source/common/ucnv_err.cpp
index c609bed4bd9f47fd96d245fb2e548950bc772f44..5fb9b655a150a4b7c5ec430adc99ee7ff1adcd17 100644 (file)
@@ -107,6 +107,10 @@ UCNV_FROM_U_CALLBACK_STOP (
                   UConverterCallbackReason reason,
                   UErrorCode * err)
 {
+    (void)context;
+    (void)fromUArgs;
+    (void)codeUnits;
+    (void)length;
     if (reason == UCNV_UNASSIGNED && IS_DEFAULT_IGNORABLE_CODE_POINT(codePoint))
     {
         /*
@@ -130,6 +134,7 @@ UCNV_TO_U_CALLBACK_STOP (
                    UErrorCode * err)
 {
     /* the caller must have set the error code accordingly */
+    (void)context; (void)toUArgs; (void)codePoints; (void)length; (void)reason; (void)err;
     return;
 }
 
@@ -143,6 +148,9 @@ UCNV_FROM_U_CALLBACK_SKIP (
                   UConverterCallbackReason reason,
                   UErrorCode * err)
 {
+    (void)fromUArgs;
+    (void)codeUnits;
+    (void)length;
     if (reason <= UCNV_IRREGULAR)
     {
         if (reason == UCNV_UNASSIGNED && IS_DEFAULT_IGNORABLE_CODE_POINT(codePoint))
@@ -171,6 +179,8 @@ UCNV_FROM_U_CALLBACK_SUBSTITUTE (
                   UConverterCallbackReason reason,
                   UErrorCode * err)
 {
+    (void)codeUnits;
+    (void)length;
     if (reason <= UCNV_IRREGULAR)
     {
         if (reason == UCNV_UNASSIGNED && IS_DEFAULT_IGNORABLE_CODE_POINT(codePoint))
@@ -368,6 +378,9 @@ UCNV_TO_U_CALLBACK_SKIP (
                  UConverterCallbackReason reason,
                  UErrorCode * err)
 {
+    (void)toArgs;
+    (void)codeUnits;
+    (void)length;
     if (reason <= UCNV_IRREGULAR)
     {
         if (context == NULL || (*((char*)context) == UCNV_PRV_STOP_ON_ILLEGAL && reason == UCNV_UNASSIGNED))
@@ -388,6 +401,8 @@ UCNV_TO_U_CALLBACK_SUBSTITUTE (
                  UConverterCallbackReason reason,
                  UErrorCode * err)
 {
+    (void)codeUnits;
+    (void)length;
     if (reason <= UCNV_IRREGULAR)
     {
         if (context == NULL || (*((char*)context) == UCNV_PRV_STOP_ON_ILLEGAL && reason == UCNV_UNASSIGNED))
similarity index 99%
rename from icu4c/source/common/ucnv_lmb.c
rename to icu4c/source/common/ucnv_lmb.cpp
index e4277909fe8ff5ba2470bcef989a9bf65979adbc..14c837323566e90a764184742eb7dce39e363ac1 100644 (file)
@@ -600,7 +600,9 @@ static const UConverterImpl _LMBCSImpl##n={\
     NULL,\
     NULL,\
     _LMBCSSafeClone,\
-    ucnv_getCompleteUnicodeSet\
+    ucnv_getCompleteUnicodeSet,\
+    NULL,\
+    NULL\
 };\
 static const UConverterStaticData _LMBCSStaticData##n={\
   sizeof(UConverterStaticData),\
@@ -629,12 +631,12 @@ _LMBCSOpenWorker(UConverter*  _this,
                  UErrorCode*  err,
                  ulmbcs_byte_t OptGroup)
 {
-    UConverterDataLMBCS * extraInfo = _this->extraInfo =
-        (UConverterDataLMBCS*)uprv_malloc (sizeof (UConverterDataLMBCS));
+    UConverterDataLMBCS * extraInfo = (UConverterDataLMBCS*)uprv_malloc (sizeof (UConverterDataLMBCS));
+    _this->extraInfo = extraInfo;
     if(extraInfo != NULL)
     {
         UConverterNamePieces stackPieces;
-        UConverterLoadArgs stackArgs={ (int32_t)sizeof(UConverterLoadArgs) };
+        UConverterLoadArgs stackArgs= UCNV_LOAD_ARGS_INITIALIZER;
         ulmbcs_byte_t i;
 
         uprv_memset(extraInfo, 0, sizeof(UConverterDataLMBCS));
@@ -691,6 +693,7 @@ _LMBCSSafeClone(const UConverter *cnv,
                 void *stackBuffer, 
                 int32_t *pBufferSize, 
                 UErrorCode *status) {
+    (void)status;
     LMBCSClone *newLMBCS;
     UConverterDataLMBCS *extraInfo;
     int32_t i;
similarity index 99%
rename from icu4c/source/common/ucnv_u16.c
rename to icu4c/source/common/ucnv_u16.cpp
index 1458a8a4b320423a652d1db4d3782e148792a935..d07bc42fa901b348be5b1a2d47b25cb22112eb25 100644 (file)
@@ -21,6 +21,7 @@
 #if !UCONFIG_NO_CONVERSION
 
 #include "unicode/ucnv.h"
+#include "unicode/uversion.h"
 #include "ucnv_bld.h"
 #include "ucnv_cnv.h"
 #include "cmemory.h"
@@ -587,6 +588,7 @@ static void
 _UTF16BEOpen(UConverter *cnv,
              UConverterLoadArgs *pArgs,
              UErrorCode *pErrorCode) {
+    (void)pArgs;
     if(UCNV_GET_VERSION(cnv)<=1) {
         _UTF16BEReset(cnv, UCNV_RESET_BOTH);
     } else {
@@ -1186,6 +1188,7 @@ static void
 _UTF16LEOpen(UConverter *cnv,
              UConverterLoadArgs *pArgs,
              UErrorCode *pErrorCode) {
+    (void)pArgs;
     if(UCNV_GET_VERSION(cnv)<=1) {
         _UTF16LEReset(cnv, UCNV_RESET_BOTH);
     } else {
@@ -1281,7 +1284,7 @@ _UTF16Reset(UConverter *cnv, UConverterResetChoice choice) {
     }
 }
 
-static const UConverterSharedData _UTF16v2Data;
+extern const UConverterSharedData _UTF16v2Data;
 
 static void
 _UTF16Open(UConverter *cnv,
@@ -1315,7 +1318,7 @@ _UTF16GetName(const UConverter *cnv) {
     }
 }
 
-const UConverterSharedData _UTF16Data;
+extern const UConverterSharedData _UTF16Data;
 
 #define IS_UTF16BE(cnv) ((cnv)->sharedData==&_UTF16BEData)
 #define IS_UTF16LE(cnv) ((cnv)->sharedData==&_UTF16LEData)
@@ -1557,7 +1560,7 @@ static const UConverterStaticData _UTF16v2StaticData = {
     { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */
 };
 
-static const UConverterSharedData _UTF16v2Data =
+const UConverterSharedData _UTF16v2Data =
         UCNV_IMMUTABLE_SHARED_DATA_INITIALIZER(&_UTF16v2StaticData, &_UTF16v2Impl);
 
 #endif
similarity index 99%
rename from icu4c/source/common/ucnv_u32.c
rename to icu4c/source/common/ucnv_u32.cpp
index b0a0fe28529ed2a04a100d5a87e095874b9ded2c..10a2b3018854213ca263a03af1c37e15736f5031 100644 (file)
@@ -1038,6 +1038,8 @@ static void
 _UTF32Open(UConverter *cnv,
            UConverterLoadArgs *pArgs,
            UErrorCode *pErrorCode) {
+    (void)pArgs;
+    (void)pErrorCode;
     _UTF32Reset(cnv, UCNV_RESET_BOTH);
 }
 
similarity index 99%
rename from icu4c/source/common/ucnv_u7.c
rename to icu4c/source/common/ucnv_u7.cpp
index c3b4d74b9a914959b9e8cf85276c409170f26267..ae464a27ead4bab87a2fa5f6d5da464c61e0c206 100644 (file)
@@ -196,6 +196,7 @@ static void
 _UTF7Open(UConverter *cnv,
           UConverterLoadArgs *pArgs,
           UErrorCode *pErrorCode) {
+    (void)pArgs;
     if(UCNV_GET_VERSION(cnv)<=1) {
         /* TODO(markus): Should just use cnv->options rather than copying the version number. */
         cnv->fromUnicodeStatus=UCNV_GET_VERSION(cnv)<<28;
@@ -1462,7 +1463,9 @@ static const UConverterImpl _IMAPImpl={
     NULL,
     NULL, /* we don't need writeSub() because we never call a callback at fromUnicode() */
     NULL,
-    ucnv_getCompleteUnicodeSet
+    ucnv_getCompleteUnicodeSet,
+    NULL,
+    NULL
 };
 
 static const UConverterStaticData _IMAPStaticData={
similarity index 99%
rename from icu4c/source/common/ucnvhz.c
rename to icu4c/source/common/ucnvhz.cpp
index d35551628b03982c120fecfd8cdca69a8bd120c9..3848ed31343779b26090c6224cd8b74bc0f6c211 100644 (file)
@@ -604,7 +604,9 @@ static const UConverterImpl _HZImpl={
     NULL,
     _HZ_WriteSub,
     _HZ_SafeClone,
-    _HZ_GetUnicodeSet
+    _HZ_GetUnicodeSet,
+    NULL,
+    NULL
 };
 
 static const UConverterStaticData _HZStaticData={
similarity index 99%
rename from icu4c/source/common/ucnvisci.c
rename to icu4c/source/common/ucnvisci.cpp
index b520fc244e30034510671298ef5916e36a30f4c2..e8e676ae929cbee28b869506ecff0c8f667190f1 100644 (file)
@@ -1432,7 +1432,7 @@ static void UConverter_toUnicode_ISCII_OFFSETS_LOGIC(UConverterToUnicodeArgs *ar
             if (*toUnicodeStatus != missingCharMarker) {
                 /* Check to make sure that consonant clusters are handled correct for Gurmukhi script. */
                 if (data->currentDeltaToUnicode == PNJ_DELTA && data->prevToUnicodeStatus != 0 && isPNJConsonant(data->prevToUnicodeStatus) &&
-                        (*toUnicodeStatus + PNJ_DELTA) == PNJ_SIGN_VIRAMA && (targetUniChar + PNJ_DELTA) == data->prevToUnicodeStatus) {
+                        (*toUnicodeStatus + PNJ_DELTA) == PNJ_SIGN_VIRAMA && ((UChar32)(targetUniChar + PNJ_DELTA) == data->prevToUnicodeStatus)) {
                     /* Consonant clusters C + HALANT + C should be encoded as ADHAK + C */
                     offset = (int)(source-args->source - 3);
                     tempTargetUniChar = PNJ_ADHAK; /* This is necessary to avoid some compiler warnings. */
@@ -1556,6 +1556,9 @@ _ISCIIGetUnicodeSet(const UConverter *cnv,
                     UConverterUnicodeSet which,
                     UErrorCode *pErrorCode)
 {
+    (void)cnv;
+    (void)which;
+    (void)pErrorCode;
     int32_t idx, script;
     uint8_t mask;
 
@@ -1598,7 +1601,9 @@ static const UConverterImpl _ISCIIImpl={
     _ISCIIgetName,
     NULL,
     _ISCII_SafeClone,
-    _ISCIIGetUnicodeSet
+    _ISCIIGetUnicodeSet,
+    NULL,
+    NULL
 };
 
 static const UConverterStaticData _ISCIIStaticData={
similarity index 99%
rename from icu4c/source/common/ucnvlat1.c
rename to icu4c/source/common/ucnvlat1.cpp
index f17777f066cfc87ca28d9830f237cd593ab628cb..2579e7f7114096a11137193d6fe9df82ed3c36d5 100644 (file)
@@ -421,6 +421,9 @@ _Latin1GetUnicodeSet(const UConverter *cnv,
                      const USetAdder *sa,
                      UConverterUnicodeSet which,
                      UErrorCode *pErrorCode) {
+    (void)cnv;
+    (void)which;
+    (void)pErrorCode;
     sa->addRange(sa->set, 0, 0xff);
 }
 
@@ -695,6 +698,9 @@ _ASCIIGetUnicodeSet(const UConverter *cnv,
                     const USetAdder *sa,
                     UConverterUnicodeSet which,
                     UErrorCode *pErrorCode) {
+    (void)cnv;
+    (void)which;
+    (void)pErrorCode;
     sa->addRange(sa->set, 0, 0x7f);
 }
 
similarity index 99%
rename from icu4c/source/common/ucnvscsu.c
rename to icu4c/source/common/ucnvscsu.cpp
index 9849cdebbbb80ae2019344c6a0f99c39f1675f7c..4827456e39a757c6cdcfd105a391d57f18d245f3 100644 (file)
@@ -2017,7 +2017,9 @@ static const UConverterImpl _SCSUImpl={
     _SCSUGetName,
     NULL,
     _SCSUSafeClone,
-    ucnv_getCompleteUnicodeSet
+    ucnv_getCompleteUnicodeSet,
+    NULL,
+    NULL
 };
 
 static const UConverterStaticData _SCSUStaticData={
similarity index 98%
rename from icu4c/source/common/udatamem.c
rename to icu4c/source/common/udatamem.cpp
index daa919373b71bb5e980aebea5832f2891d7c08db..5f3b4695a8da4bda9060f694e474b7b6aa787a1f 100644 (file)
@@ -44,7 +44,7 @@ U_CFUNC UDataMemory *UDataMemory_createNewInstance(UErrorCode *pErr) {
     if (U_FAILURE(*pErr)) {
         return NULL;
     }
-    This = uprv_malloc(sizeof(UDataMemory));
+    This = (UDataMemory *)uprv_malloc(sizeof(UDataMemory));
     if (This == NULL) {
         *pErr = U_MEMORY_ALLOCATION_ERROR; }
     else {
similarity index 99%
rename from icu4c/source/common/udataswp.c
rename to icu4c/source/common/udataswp.cpp
index f47ac1f5e06f355b2a457a8cdff2062873c6bd35..e195984138f435f4022483883b553745903d9b74 100644 (file)
@@ -374,7 +374,7 @@ udata_openSwapper(UBool inIsBigEndian, uint8_t inCharset,
     }
 
     /* allocate the swapper */
-    swapper=uprv_malloc(sizeof(UDataSwapper));
+    swapper=(UDataSwapper *)uprv_malloc(sizeof(UDataSwapper));
     if(swapper==NULL) {
         *pErrorCode=U_MEMORY_ALLOCATION_ERROR;
         return NULL;
@@ -435,7 +435,7 @@ udata_openSwapperForInputData(const void *data, int32_t length,
     }
 
     pHeader=(const DataHeader *)data;
-    if( (length>=0 && length<sizeof(DataHeader)) ||
+    if( (length>=0 && length<(int32_t)sizeof(DataHeader)) ||
         pHeader->dataHeader.magic1!=0xda ||
         pHeader->dataHeader.magic2!=0x27 ||
         pHeader->info.sizeofUChar!=2
similarity index 99%
rename from icu4c/source/common/uinvchar.c
rename to icu4c/source/common/uinvchar.cpp
index 79dd05143f03e5a566fd8dc996d462c5ec6f9a83..f4919c4a417d189d5d55799753b748799fef66ad 100644 (file)
@@ -451,6 +451,7 @@ U_CFUNC int32_t
 uprv_compareInvAscii(const UDataSwapper *ds,
                      const char *outString, int32_t outLength,
                      const UChar *localString, int32_t localLength) {
+    (void)ds;
     int32_t minLength;
     UChar32 c1, c2;
     uint8_t c;
@@ -496,6 +497,7 @@ U_CFUNC int32_t
 uprv_compareInvEbcdic(const UDataSwapper *ds,
                       const char *outString, int32_t outLength,
                       const UChar *localString, int32_t localLength) {
+    (void)ds;
     int32_t minLength;
     UChar32 c1, c2;
     uint8_t c;
similarity index 97%
rename from icu4c/source/common/ulist.c
rename to icu4c/source/common/ulist.cpp
index a31c60408335c326fc309110690be520bccdc13d..511a17aee4f37ae55c1a1ba2c9607fafa92c0129 100644 (file)
@@ -158,7 +158,7 @@ U_CAPI UBool U_EXPORT2 ulist_containsString(const UList *list, const char *data,
     if (list != NULL) {
         const UListNode *pointer;
         for (pointer = list->head; pointer != NULL; pointer = pointer->next) {
-            if (length == uprv_strlen(pointer->data)) {
+            if (length == (int32_t)uprv_strlen((const char *)pointer->data)) {
                 if (uprv_memcmp(data, pointer->data, length) == 0) {
                     return TRUE;
                 }
@@ -172,7 +172,7 @@ U_CAPI UBool U_EXPORT2 ulist_removeString(UList *list, const char *data) {
     if (list != NULL) {
         UListNode *pointer;
         for (pointer = list->head; pointer != NULL; pointer = pointer->next) {
-            if (uprv_strcmp(data, pointer->data) == 0) {
+            if (uprv_strcmp(data, (const char *)pointer->data) == 0) {
                 ulist_removeItem(list, pointer);
                 // Remove only the first occurrence, like Java LinkedList.remove(Object).
                 return TRUE;
similarity index 99%
rename from icu4c/source/common/uloc_tag.c
rename to icu4c/source/common/uloc_tag.cpp
index 224470ad89c66e92b74f667b4dc83ef5eb017ee8..b82aeacdccdc1776e5c69f176198ae5a183e3cbe 100644 (file)
@@ -823,7 +823,7 @@ _appendVariantsToLanguageTag(const char* localeID, char* appendAt, int32_t capac
 
                     /* validate */
                     if (_isVariantSubtag(pVar, -1)) {
-                        if (uprv_strcmp(pVar,POSIX_VALUE) || len != uprv_strlen(POSIX_VALUE)) {
+                        if (uprv_strcmp(pVar,POSIX_VALUE) || len != (int32_t)uprv_strlen(POSIX_VALUE)) {
                             /* emit the variant to the list */
                             var = (VariantListEntry*)uprv_malloc(sizeof(VariantListEntry));
                             if (var == NULL) {
@@ -1371,7 +1371,7 @@ _appendLDMLExtensionAsKeywords(const char* ldmlext, ExtensionListEntry** appendT
 
                 U_ASSERT(pBcpKey != NULL);
 
-                if (bcpKeyLen >= sizeof(bcpKeyBuf)) {
+                if (bcpKeyLen >= (int32_t)sizeof(bcpKeyBuf)) {
                     /* the BCP key is invalid */
                     *status = U_ILLEGAL_ARGUMENT_ERROR;
                     goto cleanup;
@@ -1406,7 +1406,7 @@ _appendLDMLExtensionAsKeywords(const char* ldmlext, ExtensionListEntry** appendT
 
                 if (pBcpType) {
                     char bcpTypeBuf[128];       /* practically long enough even considering multiple subtag type */
-                    if (bcpTypeLen >= sizeof(bcpTypeBuf)) {
+                    if (bcpTypeLen >= (int32_t)sizeof(bcpTypeBuf)) {
                         /* the BCP type is too long */
                         *status = U_ILLEGAL_ARGUMENT_ERROR;
                         goto cleanup;
@@ -1642,6 +1642,7 @@ _appendKeywords(ULanguageTag* langtag, char* appendAt, int32_t capacity, UErrorC
 
 static int32_t
 _appendPrivateuseToLanguageTag(const char* localeID, char* appendAt, int32_t capacity, UBool strict, UBool hadPosix, UErrorCode* status) {
+    (void)hadPosix;
     char buf[ULOC_FULLNAME_CAPACITY];
     char tmpAppend[ULOC_FULLNAME_CAPACITY];
     UErrorCode tmpStatus = U_ZERO_ERROR;
index 51581c7dcdc187120105481dbbcbab1a06aaf044..547ef1ec499107b7e0b6d9c5a0f2d64074541fcb 100644 (file)
  *     When defined, force use of char16_t for UChar.
  *     Note: char16_t is expected to become the default and required in the future,
  *           and this option will be removed.
+ *
+ *     Note: for plain C, #include <uchar.h> should define char16_t,
+ *           but Macintosh Xcode does not yet implement it.
  *     @internal
  */
 #ifdef U_USE_CHAR16_T
+#ifdef __cplusplus
 #ifdef UCHAR_TYPE
 #undef UCHAR_TYPE
 #endif
 #define UCHAR_TYPE char16_t
-
-/*
- * In plain C, <uchar.h> is needed for the definition of char16_t
- */
-#ifndef __cplusplus
-#include <uchar.h>
-#endif
-#endif
+#endif  /* __cpluplus  */
+#endif  /* U_USE_CHAR16_t */
 #endif  /* U_HIDE_INTERNAL_API */
 
 /*==========================================================================*/
index 55f7b9d21d862ebc533a7625f843573b54496cc7..50871ccdb6a0d1c0e4068ed044ad5b7c385cbed0 100644 (file)
 
 /* internal definitions ----------------------------------------------------- */
 
-/**
- * \var utf8_countTrailBytes
- * Internal array with numbers of trail bytes for any given byte used in
- * lead byte position.
- *
- * This is internal since it is not meant to be called directly by external clients;
- * however it is called by public macros in this file and thus must remain stable,
- * and should not be hidden when other internal functions are hidden (otherwise
- * public macros would fail to compile).
- * @internal
- */
-#ifdef U_UTF8_IMPL
-U_EXPORT const uint8_t 
-#elif defined(U_STATIC_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION)
-U_CFUNC const uint8_t
-#else
-U_CFUNC U_IMPORT const uint8_t /* U_IMPORT2? */ /*U_IMPORT*/ 
-#endif
-utf8_countTrailBytes[256];
+
 
 /**
  * Counts the trail bytes for a UTF-8 lead byte.
index c7d5145a231cd64ad9cd69927e372c630f6550d4..b7f39f1044bd90205600df56d9aa2888802f616d 100644 (file)
 */
 
 /**
- * \file 
+ * \file
  * \brief C API: Deprecated macros for Unicode string handling
  */
 
 /**
- * 
+ *
  * The macros in utf_old.h are all deprecated and their use discouraged.
  * Some of the design principles behind the set of UTF macros
  * have changed or proved impractical.
@@ -267,6 +267,25 @@ typedef int32_t UTextOffset;
 
 /* Formerly utf8.h ---------------------------------------------------------- */
 
+/**
+* \var utf8_countTrailBytes
+* Internal array with numbers of trail bytes for any given byte used in
+* lead byte position.
+*
+* This is internal since it is not meant to be called directly by external clients;
+* however it is called by public macros in this file and thus must remain stable,
+* and should not be hidden when other internal functions are hidden (otherwise
+* public macros would fail to compile).
+* @internal
+*/
+#ifdef U_UTF8_IMPL
+// No forward declaration if compiling utf_impl.cpp, which defines utf8_countTrailBytes.
+#elif defined(U_STATIC_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION)
+U_CFUNC const uint8_t utf8_countTrailBytes[];
+#else
+U_CFUNC U_IMPORT const uint8_t utf8_countTrailBytes[];    /* U_IMPORT2? */ /*U_IMPORT*/
+#endif
+
 /**
  * Count the trail bytes for a UTF-8 lead byte.
  * @deprecated ICU 2.4. Renamed to U8_COUNT_TRAIL_BYTES, see utf_old.h.
similarity index 95%
rename from icu4c/source/common/ures_cnv.c
rename to icu4c/source/common/ures_cnv.cpp
index 58c6cd0746fb930acbae0cc0e1fe02d6fadbea39..43926339896fe2c510c1d2a306c5fc834a234a62 100644 (file)
@@ -43,7 +43,7 @@ ures_openU(const UChar *myPath,
     }
     else {
         length=u_strlen(myPath);
-        if(length>=sizeof(pathBuffer)) {
+        if(length>=(int32_t)sizeof(pathBuffer)) {
             *status=U_ILLEGAL_ARGUMENT_ERROR;
             return NULL;
         } else if(uprv_isInvariantUString(myPath, length)) {
@@ -61,7 +61,7 @@ ures_openU(const UChar *myPath,
             if(U_FAILURE(*status)) {
                 return NULL;
             }
-            if(length>=sizeof(pathBuffer)) {
+            if(length>=(int32_t)sizeof(pathBuffer)) {
                 /* not NUL-terminated - path too long */
                 *status=U_ILLEGAL_ARGUMENT_ERROR;
                 return NULL;
similarity index 99%
rename from icu4c/source/common/usc_impl.c
rename to icu4c/source/common/usc_impl.cpp
index 1fff0c4482d7f34e8afa4950b6c086a935596e03..b1559101fde30a919956ffe732a8f040d765ae87 100644 (file)
@@ -197,7 +197,7 @@ uscript_openRun(const UChar *src, int32_t length, UErrorCode *pErrorCode)
         return NULL;
     }
 
-    result = uprv_malloc(sizeof (UScriptRun));
+    result = (UScriptRun *)uprv_malloc(sizeof (UScriptRun));
 
     if (result == NULL) {
         *pErrorCode = U_MEMORY_ALLOCATION_ERROR;
similarity index 95%
rename from icu4c/source/common/utf_impl.c
rename to icu4c/source/common/utf_impl.cpp
index c4c881213807e1ebf9f11ec022b7f6af8a608de9..f5ee2344a6492c3ea461737f7b345e44c9820bfd 100644 (file)
 #include "uassert.h"
 
 /*
+ * Table of the number of utf8 trail bytes, indexed by the lead byte.
+ * Used by the deprecated macro UTF8_COUNT_TRAIL_BYTES, defined in utf_old.h
+ *
+ * The current macro, U8_COUNT_TRAIL_BYTES, does _not_ use this table.
+ *
+ * Note that this table cannot be removed, even if UTF8_COUNT_TRAIL_BYTES were
+ * changed to no longer use it. References to the table from expansions of UTF8_COUNT_TRAIL_BYTES
+ * may exist in old client code that must continue to run with newer icu library versions.
+ *
  * This table could be replaced on many machines by
  * a few lines of assembler code using an
  * "index of first 0-bit from msb" instruction and
@@ -51,7 +60,7 @@
  * lead bytes above 0xf4 are illegal.
  * We keep them in this table for skipping long ISO 10646-UTF-8 sequences.
  */
-U_EXPORT const uint8_t 
+extern "C" U_EXPORT const uint8_t
 utf8_countTrailBytes[256]={
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
similarity index 98%
rename from icu4c/source/common/utrace.c
rename to icu4c/source/common/utrace.cpp
index ca4dddfa1a38fbd7917a560803b8d9dacef1f6be..0adc414b96b9b43300bd8608805bedc63142694f 100644 (file)
@@ -11,7 +11,6 @@
 *   indentation:4
 */
 
-#define   UTRACE_IMPL
 #include "unicode/utrace.h"
 #include "utracimp.h"
 #include "cstring.h"
@@ -24,7 +23,11 @@ static UTraceExit      *pTraceExitFunc  = NULL;
 static UTraceData      *pTraceDataFunc  = NULL;
 static const void      *gTraceContext   = NULL;
 
-U_EXPORT int32_t
+/**
+ * \var utrace_level
+ * Trace level variable. Negative for "off".
+ */
+static int32_t
 utrace_level = UTRACE_ERROR;
 
 U_CAPI void U_EXPORT2
@@ -134,7 +137,7 @@ static void outputHexBytes(int64_t val, int32_t charsToOutput,
 
 /* Output a pointer value in hex.  Work with any size of pointer   */
 static void outputPtrBytes(void *val, char *outBuf, int32_t *outIx, int32_t capacity) {
-    int32_t  i;
+    uint32_t  i;
     int32_t  incVal = 1;              /* +1 for big endian, -1 for little endian          */
     char     *p     = (char *)&val;   /* point to current byte to output in the ptr val  */
 
@@ -230,7 +233,7 @@ utrace_vformat(char *outBuf, int32_t capacity, int32_t indent, const char *fmt,
 
         case 'S':
             /* UChar * string, with length, len==-1 for null terminated. */
-            ptrArg = va_arg(args, void *);             /* Ptr    */
+            ptrArg = va_arg(args, char *);             /* Ptr    */
             intArg =(int32_t)va_arg(args, int32_t);    /* Length */
             outputUString((const UChar *)ptrArg, intArg, outBuf, &outIx, capacity, indent);
             break;
@@ -261,7 +264,7 @@ utrace_vformat(char *outBuf, int32_t capacity, int32_t indent, const char *fmt,
             
         case 'p':
             /*  Pointers.   */
-            ptrArg = va_arg(args, void *);
+            ptrArg = va_arg(args, char *);
             outputPtrBytes(ptrArg, outBuf, &outIx, capacity);
             break;
 
@@ -332,7 +335,7 @@ utrace_vformat(char *outBuf, int32_t capacity, int32_t indent, const char *fmt,
                             break;
                         case 's':
                             charsToOutput = 0;
-                            outputString(*ptrPtr, outBuf, &outIx, capacity, indent);
+                            outputString((const char *)*ptrPtr, outBuf, &outIx, capacity, indent);
                             outputChar('\n', outBuf, &outIx, capacity, indent);
                             longArg = *ptrPtr==NULL? 0: 1;   /* for test for null term. array. */
                             ptrPtr++;
index c1786f55b2afdcb9e85ed4e643c0ce7032d73d0a..8852aa5f881d3772525b8612c9c9fd536fb9dc9c 100644 (file)
 
 U_CDECL_BEGIN
 
-/**
- * \var utrace_level
- * Trace level variable. Negative for "off".
- * Use only via UTRACE_ macros.
- * @internal
- */
-#ifdef UTRACE_IMPL
-U_EXPORT int32_t
-#else
-U_CFUNC U_COMMON_API int32_t
-#endif
-utrace_level;
-
-
 /** 
  *   Traced Function Exit return types.  
  *   Flags indicating the number and types of varargs included in a call
similarity index 99%
rename from icu4c/source/i18n/decNumber.c
rename to icu4c/source/i18n/decNumber.cpp
index 2604c37ebe88db15da33e2c9439e68429b6b5cae..3b72c1eac1f5e2e47110b47d104ad93cb8e025d8 100644 (file)
@@ -5007,7 +5007,7 @@ static decNumber * decMultiplyOp(decNumber *res, const decNumber *lhs,
 
       /* Make sure no signed int overflow below. This is always true */
       /* if the given numbers have less digits than DEC_MAX_DIGITS. */
-      U_ASSERT(iacc <= INT32_MAX/sizeof(uLong));
+      U_ASSERT((uint32_t)iacc <= INT32_MAX/sizeof(uLong));
       needbytes=iacc*sizeof(uLong);
       #if DECDPUN==1
       zoff=(iacc+7)/8;        /* items to offset by  */
index 869d3a95181d57f63196505b7b63b9e8e223f1de..73e0f2422a58a2f0b24f91edc754827a4c1c284f 100644 (file)
     <ClCompile Include="datefmt.cpp" />
     <ClCompile Include="dayperiodrules.cpp" />
     <ClCompile Include="dcfmtsym.cpp" />
-    <ClCompile Include="decContext.c" />
+    <ClCompile Include="decContext.cpp" />
     <ClCompile Include="decfmtst.cpp" />
     <ClCompile Include="decimalformatpattern.cpp" />
     <ClCompile Include="decimfmt.cpp" />
-    <ClCompile Include="decNumber.c" />
+    <ClCompile Include="decNumber.cpp" />
     <ClCompile Include="digitlst.cpp" />
     <ClCompile Include="dtfmtsym.cpp" />
     <ClCompile Include="dtitvfmt.cpp" />
     <ClCompile Include="udateintervalformat.cpp" />
     <ClCompile Include="udatpg.cpp" />
     <ClCompile Include="ufieldpositer.cpp" />
-    <ClCompile Include="ulocdata.c" />
+    <ClCompile Include="ulocdata.cpp" />
     <ClCompile Include="umsg.cpp" />
     <ClCompile Include="unum.cpp" />
     <ClCompile Include="unumsys.cpp" />
     <ClCompile Include="upluralrules.cpp" />
     <ClCompile Include="utf16collationiterator.cpp" />
     <ClCompile Include="utf8collationiterator.cpp" />
-    <ClCompile Include="utmscale.c" />
+    <ClCompile Include="utmscale.cpp" />
     <ClCompile Include="vtzone.cpp" />
     <ClCompile Include="vzone.cpp" />
     <ClCompile Include="windtfmt.cpp">
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
index 57bf52f28d148d3f8498cbe589aced57305cf3c0..c7b477ce46b5aa5d1725e3558ab1409aebd3a81b 100644 (file)
     <ClCompile Include="dcfmtsym.cpp">
       <Filter>formatting</Filter>
     </ClCompile>
-    <ClCompile Include="decContext.c">
+    <ClCompile Include="decContext.cpp">
       <Filter>formatting</Filter>
     </ClCompile>
     <ClCompile Include="decfmtst.cpp">
     <ClCompile Include="decimfmt.cpp">
       <Filter>formatting</Filter>
     </ClCompile>
-    <ClCompile Include="decNumber.c">
+    <ClCompile Include="decNumber.cpp">
       <Filter>formatting</Filter>
     </ClCompile>
     <ClCompile Include="digitlst.cpp">
     <ClCompile Include="ufieldpositer.cpp">
       <Filter>formatting</Filter>
     </ClCompile>
-    <ClCompile Include="ulocdata.c">
+    <ClCompile Include="ulocdata.cpp">
       <Filter>formatting</Filter>
     </ClCompile>
     <ClCompile Include="umsg.cpp">
     <ClCompile Include="upluralrules.cpp">
       <Filter>formatting</Filter>
     </ClCompile>
-    <ClCompile Include="utmscale.c">
+    <ClCompile Include="utmscale.cpp">
       <Filter>formatting</Filter>
     </ClCompile>
     <ClCompile Include="vtzone.cpp">
index 3173e920809bd0a86ed59e6400e20c0f2edd3115..128ec83f68b6af0c58dbed0a4209da3b75f015d3 100644 (file)
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="locbund.cpp" />
-    <ClCompile Include="sprintf.c" />
-    <ClCompile Include="sscanf.c" />
+    <ClCompile Include="sprintf.cpp" />
+    <ClCompile Include="sscanf.cpp" />
     <ClCompile Include="ucln_io.cpp">
       <DisableLanguageExtensions>false</DisableLanguageExtensions>
     </ClCompile>
-    <ClCompile Include="ufile.c" />
-    <ClCompile Include="ufmt_cmn.c" />
+    <ClCompile Include="ufile.cpp" />
+    <ClCompile Include="ufmt_cmn.cpp" />
     <ClCompile Include="uprintf.cpp" />
-    <ClCompile Include="uprntf_p.c" />
-    <ClCompile Include="uscanf.c" />
-    <ClCompile Include="uscanf_p.c" />
-    <ClCompile Include="ustdio.c" />
+    <ClCompile Include="uprntf_p.cpp" />
+    <ClCompile Include="uscanf.cpp" />
+    <ClCompile Include="uscanf_p.cpp" />
+    <ClCompile Include="ustdio.cpp" />
     <ClCompile Include="ustream.cpp">
       <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</DisableLanguageExtensions>
       <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</DisableLanguageExtensions>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
index 61252bff3a09be6b4c58b7dcec746d0b3956f4f5..4a6841ba2869059f952215f361d47bc39922cb21 100644 (file)
     <ClCompile Include="locbund.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="sprintf.c">
+    <ClCompile Include="sprintf.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="sscanf.c">
+    <ClCompile Include="sscanf.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="ucln_io.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="ufile.c">
+    <ClCompile Include="ufile.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="ufmt_cmn.c">
+    <ClCompile Include="ufmt_cmn.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="uprintf.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="uprntf_p.c">
+    <ClCompile Include="uprntf_p.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="uscanf.c">
+    <ClCompile Include="uscanf.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="uscanf_p.c">
+    <ClCompile Include="uscanf_p.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="ustdio.c">
+    <ClCompile Include="ustdio.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="ustream.cpp">
similarity index 88%
rename from icu4c/source/io/ufile.c
rename to icu4c/source/io/ufile.cpp
index 87ed3f1e9693c47e6523d85abdd81160d018c8a8..8fb11ba19a23d36da0ef95d0b4f0eade0f3b05c8 100644 (file)
@@ -8,7 +8,7 @@
 *
 ******************************************************************************
 *
-* File ufile.c
+* File ufile.cpp
 *
 * Modification History:
 *
 ******************************************************************************
 */
 
-/*
- * fileno is not declared when building with GCC in strict mode.
- */
-#if defined(__GNUC__) && defined(__STRICT_ANSI__)
-#undef __STRICT_ANSI__
-#endif
-
 #include "locmap.h"
 #include "unicode/ustdio.h"
 
@@ -64,33 +57,7 @@ finit_owner(FILE         *f,
 
     uprv_memset(result, 0, sizeof(UFILE));
     result->fFileno = fileno(f);
-
-#if U_PLATFORM_USES_ONLY_WIN32_API && _MSC_VER < 1900
-    /*
-     * Below is a very old workaround (ICU ticket:231).
-     *
-     * Previously, 'FILE*' from inside and outside ICU's DLL
-     * were different, because they pointed into local copies
-     * of the io block. At least by VS 2015 the implementation
-     * is something like:
-     *    stdio = _acrt_iob_func(0)
-     * .. which is a function call, so should return the same pointer
-     * regardless of call site.
-     * As of _MSC_VER 1900 this patch is retired, at 16 years old.
-     */
-    if (0 <= result->fFileno && result->fFileno <= 2) {
-        /* stdin, stdout and stderr need to be special cased for Windows 98 */
-#if _MSC_VER >= 1400
-        result->fFile = &__iob_func()[_fileno(f)];
-#else
-        result->fFile = &_iob[_fileno(f)];
-#endif
-    }
-    else
-#endif
-    {
-        result->fFile = f;
-    }
+    result->fFile = f;
 
     result->str.fBuffer = result->fUCBuffer;
     result->str.fPos    = result->fUCBuffer;
index 97079ed9d281845bf7accb98980f5d36f3a83991..f79ec8b03c1ec29bb4cd36b53ae3164066d3b2f4 100644 (file)
@@ -26,7 +26,7 @@
 #include "unicode/utf16.h"
 
 #define UFMT_DEFAULT_BUFFER_SIZE 128
-#define MAX_UCHAR_BUFFER_SIZE(buffer) (sizeof(buffer)/(U16_MAX_LENGTH*sizeof(UChar)))
+#define MAX_UCHAR_BUFFER_SIZE(buffer) ((int32_t)(sizeof(buffer)/(U16_MAX_LENGTH*sizeof(UChar))))
 #define MAX_UCHAR_BUFFER_NEEDED(strLen) ((strLen+1)*U16_MAX_LENGTH*sizeof(UChar))
 
 /** 
similarity index 99%
rename from icu4c/source/io/uprntf_p.c
rename to icu4c/source/io/uprntf_p.cpp
index 9890b29b964b2110640ffee4501409723b2b098d..794c944ec7cc7736e4003294a62cdb947c83eaeb 100644 (file)
@@ -184,6 +184,9 @@ u_printf_simple_percent_handler(const u_printf_stream_handler  *handler,
                                 const u_printf_spec_info       *info,
                                 const ufmt_args                *args)
 {
+    (void)formatBundle;
+    (void)info;
+    (void)args;
     static const UChar PERCENT[] = { UP_PERCENT };
 
     /* put a single '%' onto the output */
@@ -198,6 +201,7 @@ u_printf_string_handler(const u_printf_stream_handler  *handler,
                         const u_printf_spec_info       *info,
                         const ufmt_args                *args)
 {
+    (void)formatBundle;
     UChar *s;
     UChar buffer[UFMT_DEFAULT_BUFFER_SIZE];
     int32_t len, written;
@@ -248,6 +252,7 @@ u_printf_char_handler(const u_printf_stream_handler  *handler,
                       const u_printf_spec_info       *info,
                       const ufmt_args                *args)
 {
+    (void)formatBundle;
     UChar s[U16_MAX_LENGTH+1];
     int32_t len = 1, written;
     unsigned char arg = (unsigned char)(args[0].int64Value);
@@ -418,6 +423,7 @@ u_printf_hex_handler(const u_printf_stream_handler  *handler,
                      const u_printf_spec_info       *info,
                      const ufmt_args                *args)
 {
+    (void)formatBundle;
     int64_t         num        = args[0].int64Value;
     UChar           result[UPRINTF_BUFFER_SIZE];
     int32_t         len        = UPRINTF_BUFFER_SIZE;
@@ -453,6 +459,7 @@ u_printf_octal_handler(const u_printf_stream_handler  *handler,
                        const u_printf_spec_info       *info,
                        const ufmt_args                *args)
 {
+    (void)formatBundle;
     int64_t         num        = args[0].int64Value;
     UChar           result[UPRINTF_BUFFER_SIZE];
     int32_t         len        = UPRINTF_BUFFER_SIZE;
@@ -539,7 +546,8 @@ u_printf_pointer_handler(const u_printf_stream_handler  *handler,
                          ULocaleBundle                  *formatBundle,
                          const u_printf_spec_info       *info,
                          const ufmt_args                *args)
-{
+{ 
+    (void)formatBundle;
     UChar           result[UPRINTF_BUFFER_SIZE];
     int32_t         len  = UPRINTF_BUFFER_SIZE;
 
@@ -751,6 +759,7 @@ u_printf_ustring_handler(const u_printf_stream_handler  *handler,
                          const u_printf_spec_info       *info,
                          const ufmt_args                *args)
 {
+    (void)formatBundle;
     int32_t len, written;
     const UChar *arg = (const UChar*)(args[0].ptrValue);
 
@@ -779,6 +788,7 @@ u_printf_uchar_handler(const u_printf_stream_handler  *handler,
                        const u_printf_spec_info       *info,
                        const ufmt_args                *args)
 {
+    (void)formatBundle;
     int32_t written = 0;
     UChar arg = (UChar)(args[0].int64Value);
 
@@ -858,6 +868,9 @@ u_printf_count_handler(const u_printf_stream_handler  *handler,
                        const u_printf_spec_info       *info,
                        const ufmt_args                *args)
 {
+    (void)handler;
+    (void)context;
+    (void)formatBundle;
     int32_t *count = (int32_t*)(args[0].ptrValue);
 
     /* in the special case of count, the u_printf_spec_info's width */
similarity index 98%
rename from icu4c/source/io/uscanf_p.c
rename to icu4c/source/io/uscanf_p.cpp
index ded984cef2df4fc27a55ae7761aea733c282009b..14b3dc546349478669a7239ac91b5094b0ab699f 100644 (file)
@@ -380,6 +380,11 @@ u_scanf_simple_percent_handler(UFILE        *input,
                                int32_t      *fmtConsumed,
                                int32_t      *argConverted)
 {
+    (void)info;
+    (void)args;
+    (void)fmt;
+    (void)fmtConsumed;
+
     /* make sure the next character in the input is a percent */
     *argConverted = 0;
     if(u_fgetc(input) != 0x0025) {
@@ -396,6 +401,10 @@ u_scanf_count_handler(UFILE         *input,
                       int32_t       *fmtConsumed,
                       int32_t       *argConverted)
 {
+    (void)input;
+    (void)fmt;
+    (void)fmtConsumed;
+
     /* in the special case of count, the u_scanf_spec_info's width */
     /* will contain the # of items converted thus far */
     if (!info->fSkipArg) {
@@ -420,6 +429,9 @@ u_scanf_double_handler(UFILE        *input,
                        int32_t      *fmtConsumed,
                        int32_t      *argConverted)
 {
+    (void)fmt;
+    (void)fmtConsumed;
+
     int32_t         len;
     double          num;
     UNumberFormat   *format;
@@ -485,6 +497,9 @@ u_scanf_scientific_handler(UFILE        *input,
                            int32_t      *fmtConsumed,
                            int32_t      *argConverted)
 {
+    (void)fmt;
+    (void)fmtConsumed;
+
     int32_t         len;
     double          num;
     UNumberFormat   *format;
@@ -582,6 +597,9 @@ u_scanf_scidbl_handler(UFILE        *input,
                        int32_t      *fmtConsumed,
                        int32_t      *argConverted)
 {
+    (void)fmt;
+    (void)fmtConsumed;
+
     int32_t       len;
     double        num;
     UNumberFormat *scientificFormat, *genericFormat;
@@ -672,6 +690,9 @@ u_scanf_integer_handler(UFILE       *input,
                         int32_t     *fmtConsumed,
                         int32_t     *argConverted)
 {
+    (void)fmt;
+    (void)fmtConsumed;
+
     int32_t         len;
     void            *num        = (void*) (args[0].ptrValue);
     UNumberFormat   *format;
@@ -745,6 +766,9 @@ u_scanf_percent_handler(UFILE       *input,
                         int32_t     *fmtConsumed,
                         int32_t     *argConverted)
 {
+    (void)fmt;
+    (void)fmtConsumed;
+
     int32_t         len;
     double          num;
     UNumberFormat   *format;
@@ -802,6 +826,9 @@ u_scanf_string_handler(UFILE        *input,
                        int32_t      *fmtConsumed,
                        int32_t      *argConverted)
 {
+    (void)fmt;
+    (void)fmtConsumed;
+
     const UChar *source;
     UConverter  *conv;
     char        *arg    = (char*)(args[0].ptrValue);
@@ -900,6 +927,9 @@ u_scanf_ustring_handler(UFILE       *input,
                         int32_t     *fmtConsumed,
                         int32_t     *argConverted)
 {
+    (void)fmt;
+    (void)fmtConsumed;
+
     UChar   *arg     = (UChar*)(args[0].ptrValue);
     UChar   *alias     = arg;
     int32_t count;
@@ -969,6 +999,9 @@ u_scanf_spellout_handler(UFILE          *input,
                          int32_t        *fmtConsumed,
                          int32_t        *argConverted)
 {
+    (void)fmt;
+    (void)fmtConsumed;
+
     int32_t         len;
     double          num;
     UNumberFormat   *format;
@@ -1028,6 +1061,9 @@ u_scanf_hex_handler(UFILE       *input,
                     int32_t     *fmtConsumed,
                     int32_t     *argConverted)
 {
+    (void)fmt;
+    (void)fmtConsumed;
+
     int32_t     len;
     int32_t     skipped;
     void        *num    = (void*) (args[0].ptrValue);
@@ -1084,6 +1120,9 @@ u_scanf_octal_handler(UFILE         *input,
                       int32_t       *fmtConsumed,
                       int32_t       *argConverted)
 {
+    (void)fmt;
+    (void)fmtConsumed;
+
     int32_t     len;
     int32_t     skipped;
     void        *num         = (void*) (args[0].ptrValue);
@@ -1131,6 +1170,9 @@ u_scanf_pointer_handler(UFILE       *input,
                         int32_t     *fmtConsumed,
                         int32_t     *argConverted)
 {
+    (void)fmt;
+    (void)fmtConsumed;
+
     int32_t len;
     int32_t skipped;
     void    *result;
similarity index 97%
rename from icu4c/source/stubdata/stubdata.c
rename to icu4c/source/stubdata/stubdata.cpp
index 6493ac4b84421de7df0cef368b7a7498a65011e2..1b10f34bac583095c896676d3877e21711789d2b 100644 (file)
@@ -40,7 +40,7 @@ typedef struct {
                                    /*        pointerTOC to OffsetTOC.     */
 } ICU_Data_Header;
 
-U_EXPORT const ICU_Data_Header U_ICUDATA_ENTRY_POINT = {
+extern "C" U_EXPORT const ICU_Data_Header U_ICUDATA_ENTRY_POINT = {
     32,          /* headerSize */
     0xda,        /* magic1,  (see struct MappedData in udata.c)  */
     0x27,        /* magic2     */
index 36291a34518e736eca2da3c7eb99b277b617be1f..0ca6f49eee2d8a5ffd8aa8250ad1ec7c77407b6a 100644 (file)
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
-    <ClCompile Include="stubdata.c" />
+    <ClCompile Include="stubdata.cpp" />
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="..\data\misc\icudata.rc">
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
index f2742598d9cd3eed2e2ecf9b41b0542f3bd4de94..da86a1b2f0169899447054976aed7dd169202c16 100644 (file)
@@ -15,7 +15,7 @@
     </Filter>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="stubdata.c">
+    <ClCompile Include="stubdata.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
@@ -24,4 +24,4 @@
       <Filter>Resource Files</Filter>
     </ResourceCompile>
   </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
index 2f6dc7a59eef69a630924b4107c4ce60c23445c9..a3cf62376ed09f9a80a51b98a128f1681cf632ac 100644 (file)
@@ -24,6 +24,7 @@
 #include "unicode/putil.h"
 #include "unicode/uset.h"
 #include "unicode/ustring.h"
+#include "unicode/utf8.h"
 #include "ucnv_bld.h" /* for sizeof(UConverter) */
 #include "cmemory.h"  /* for UAlignedMemory */
 #include "cintltst.h"
index 9571c1342244a3cec63604214a05d73ee81747e9..d14bb4f60ecbba57e768441f28b3fd4df9efd640 100644 (file)
     <ClCompile Include="sfwdchit.cpp" />
     <ClCompile Include="strcase.cpp" />
     <ClCompile Include="ustrtest.cpp">
-      <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</DisableLanguageExtensions>
-      <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</DisableLanguageExtensions>
-      <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</DisableLanguageExtensions>
-      <DisableLanguageExtensions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</DisableLanguageExtensions>
+      <DisableLanguageExtensions>false</DisableLanguageExtensions>
     </ClCompile>
     <ClCompile Include="utxttest.cpp" />
     <ClCompile Include="cpdtrtst.cpp" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
index 65ef6b9bd6855f0cf4649c20debdc1f566dec846..c490d90fdfb749bfb09e185ccddb7fc3d46cafea 100644 (file)
     <ClCompile Include="simplethread.cpp">
       <Filter>configuration</Filter>
     </ClCompile>
-    <ClCompile Include="strtest.cpp">
-      <Filter>configuration</Filter>
-    </ClCompile>
     <ClCompile Include="tsmthred.cpp">
       <Filter>configuration</Filter>
     </ClCompile>
     <ClCompile Include="strcase.cpp">
       <Filter>strings</Filter>
     </ClCompile>
+    <ClCompile Include="strtest.cpp">
+      <Filter>strings</Filter>
+    </ClCompile>
     <ClCompile Include="ustrtest.cpp">
       <Filter>strings</Filter>
     </ClCompile>
     <ClInclude Include="simplethread.h">
       <Filter>configuration</Filter>
     </ClInclude>
-    <ClInclude Include="strtest.h">
-      <Filter>configuration</Filter>
-    </ClInclude>
     <ClInclude Include="tsmthred.h">
       <Filter>configuration</Filter>
     </ClInclude>
     <ClInclude Include="sfwdchit.h">
       <Filter>strings</Filter>
     </ClInclude>
+    <ClInclude Include="strtest.h">
+      <Filter>strings</Filter>
+    </ClInclude>
     <ClInclude Include="ustrtest.h">
       <Filter>strings</Filter>
     </ClInclude>
index f621631c5a94478d6d0cdd84552a7ce4c84ed201..fd809b5bf99cd57c93e69601e9879e7609096620 100644 (file)
@@ -22,6 +22,8 @@
 #include "unicode/stringpiece.h"
 #include "unicode/unistr.h"
 #include "unicode/ustring.h"
+#include "unicode/utf_old.h"    // for UTF8_COUNT_TRAIL_BYTES
+#include "unicode/utf8.h"
 #include "charstr.h"
 #include "cstr.h"
 #include "intltest.h"
@@ -148,8 +150,18 @@ StringTest::Test_UTF8_COUNT_TRAIL_BYTES() {
         || UTF8_COUNT_TRAIL_BYTES(0xF0) != 3)
     {
         errln("Test_UTF8_COUNT_TRAIL_BYTES: UTF8_COUNT_TRAIL_BYTES does not work right! "
-              "See utf8.h.");
-    }
+              "See utf_old.h.");
+    }
+       // Note: U8_COUNT_TRAIL_BYTES (current) and UTF8_COUNT_TRAIL_BYTES (deprecated)
+       //       have completely different implementations.
+       if (U8_COUNT_TRAIL_BYTES(0x7F) != 0
+               || U8_COUNT_TRAIL_BYTES(0xC0) != 1
+               || U8_COUNT_TRAIL_BYTES(0xE0) != 2
+               || U8_COUNT_TRAIL_BYTES(0xF0) != 3)
+       {
+               errln("Test_UTF8_COUNT_TRAIL_BYTES: U8_COUNT_TRAIL_BYTES does not work right! "
+                       "See utf8.h.");
+       }
 }
 
 void StringTest::runIndexedTest(int32_t index, UBool exec, const char *&name, char * /*par*/) {
similarity index 96%
rename from icu4c/source/tools/toolutil/flagparser.c
rename to icu4c/source/tools/toolutil/flagparser.cpp
index 0ffc3715bfdab1e72872a40e3ad56ae865ac38b5..69d1c1f50787e82b70ce71357b2f684be3b8e7d8 100644 (file)
@@ -34,9 +34,9 @@ parseFlagsFile(const char *fileName, char **flagBuffer, int32_t flagBufferSize,
         *status = U_FILE_ACCESS_ERROR;
         goto parseFlagsFile_cleanup;
     }
-    
-    buffer = uprv_malloc(sizeof(char) * currentBufferSize);
-    tmpFlagBuffer = uprv_malloc(sizeof(char) * flagBufferSize);
+
+    buffer = (char *)uprv_malloc(sizeof(char) * currentBufferSize);
+    tmpFlagBuffer = (char *)uprv_malloc(sizeof(char) * flagBufferSize);
 
     if (buffer == NULL || tmpFlagBuffer == NULL) {
         *status = U_MEMORY_ALLOCATION_ERROR;
@@ -48,7 +48,7 @@ parseFlagsFile(const char *fileName, char **flagBuffer, int32_t flagBufferSize,
             allocateMoreSpace = FALSE;
             currentBufferSize *= 2;
             uprv_free(buffer);
-            buffer = uprv_malloc(sizeof(char) * currentBufferSize);
+            buffer = (char *)uprv_malloc(sizeof(char) * currentBufferSize);
             if (buffer == NULL) {
                 *status = U_MEMORY_ALLOCATION_ERROR;
                 goto parseFlagsFile_cleanup;
similarity index 99%
rename from icu4c/source/tools/toolutil/pkg_genc.c
rename to icu4c/source/tools/toolutil/pkg_genc.cpp
index f0dbd4ca36d3aab96ce44ce0825cb12a746e6a24..2b98cfed0f41e18a7ed19c95f6b147b3c2dfc593 100644 (file)
@@ -708,7 +708,7 @@ getArchitecture(uint16_t *pCPU, uint16_t *pBits, UBool *pIsBigEndian, const char
     length=T_FileStream_read(in, buffer.bytes, sizeof(buffer.bytes));
 
 #ifdef U_ELF
-    if(length<sizeof(Elf32_Ehdr)) {
+    if(length<(int32_t)sizeof(Elf32_Ehdr)) {
         fprintf(stderr, "genccode: match-arch file %s is too short\n", filename);
         exit(U_UNSUPPORTED_ERROR);
     }
@@ -806,7 +806,7 @@ writeObjectCode(const char *filename, const char *destdir, const char *optEntryP
     /* 32-bit Elf section header table */
     static Elf32_Shdr sectionHeaders32[5]={
         { /* SHN_UNDEF */
-            0
+            0, 0, 0, 0, 0, 0, 0, 0, 0, 0
         },
         { /* .symtab */
             1, /* sh_name */
@@ -862,7 +862,7 @@ writeObjectCode(const char *filename, const char *destdir, const char *optEntryP
     /* symbol table */
     static Elf32_Sym symbols32[2]={
         { /* STN_UNDEF */
-            0
+            0, 0, 0, 0, 0, 0
         },
         { /* data entry point */
             1, /* st_name */
@@ -923,7 +923,7 @@ writeObjectCode(const char *filename, const char *destdir, const char *optEntryP
     /* 64-bit Elf section header table */
     static Elf64_Shdr sectionHeaders64[5]={
         { /* SHN_UNDEF */
-            0
+            0, 0, 0, 0, 0, 0, 0, 0, 0, 0
         },
         { /* .symtab */
             1, /* sh_name */
@@ -982,7 +982,7 @@ writeObjectCode(const char *filename, const char *destdir, const char *optEntryP
      */
     static Elf64_Sym symbols64[2]={
         { /* STN_UNDEF */
-            0
+            0, 0, 0, 0, 0, 0
         },
         { /* data entry point */
             1, /* st_name */
similarity index 99%
rename from icu4c/source/tools/toolutil/pkg_gencmn.c
rename to icu4c/source/tools/toolutil/pkg_gencmn.cpp
index 38cc820a176d3bff0cbf5b692e2aa42e3d269ccc..86c63dfdc53e70fcc10341f4a3b1e30feca165f1 100644 (file)
@@ -410,7 +410,7 @@ addFile(const char *filename, const char *name, const char *source, UBool source
 
     if(fileCount==fileMax) {
       fileMax += CHUNK_FILE_COUNT;
-      files = uprv_realloc(files, fileMax*sizeof(files[0])); /* note: never freed. */
+      files = (File *)uprv_realloc(files, fileMax*sizeof(files[0])); /* note: never freed. */
       if(files==NULL) {
         fprintf(stderr, "pkgdata/gencmn: Could not allocate %u bytes for %d files\n", (unsigned int)(fileMax*sizeof(files[0])), fileCount);
         exit(U_MEMORY_ALLOCATION_ERROR);
@@ -515,7 +515,7 @@ pathToFullPath(const char *path, const char *source) {
 
     length = (uint32_t)(uprv_strlen(path) + 1);
     newLength = (length + 1 + (int32_t)uprv_strlen(source));
-    fullPath = uprv_malloc(newLength);
+    fullPath = (char *)uprv_malloc(newLength);
     if(source != NULL) {
         uprv_strcpy(fullPath, source);
         uprv_strcat(fullPath, U_FILE_SEP_STRING);
@@ -557,6 +557,7 @@ compareFiles(const void *file1, const void *file2) {
 static void
 fixDirToTreePath(char *s)
 {
+    (void)s;
 #if (U_FILE_SEP_CHAR != U_TREE_ENTRY_SEP_CHAR) || ((U_FILE_ALT_SEP_CHAR != U_FILE_SEP_CHAR) && (U_FILE_ALT_SEP_CHAR != U_TREE_ENTRY_SEP_CHAR))
     char *t;
 #endif
index 6567fae1229692154d6d65098341fde45fdcb808..5ddbd33a63357cae3f8d986ea02a02e0250566e0 100644 (file)
       <DisableLanguageExtensions>false</DisableLanguageExtensions>
     </ClCompile>
     <ClCompile Include="denseranges.cpp" />
-    <ClCompile Include="filestrm.c" />
+    <ClCompile Include="filestrm.cpp" />
     <ClCompile Include="filetools.cpp" />
-    <ClCompile Include="flagparser.c" />
+    <ClCompile Include="flagparser.cpp" />
     <ClCompile Include="package.cpp" />
-    <ClCompile Include="pkg_genc.c">
+    <ClCompile Include="pkg_genc.cpp">
       <DisableLanguageExtensions>false</DisableLanguageExtensions>
     </ClCompile>
-    <ClCompile Include="pkg_gencmn.c">
+    <ClCompile Include="pkg_gencmn.cpp">
       <DisableLanguageExtensions>false</DisableLanguageExtensions>
     </ClCompile>
     <ClCompile Include="pkg_icu.cpp" />
       <DisableLanguageExtensions>false</DisableLanguageExtensions>
     </ClCompile>
     <ClCompile Include="ucbuf.cpp" />
-    <ClCompile Include="ucm.c" />
-    <ClCompile Include="ucmstate.c" />
-    <ClCompile Include="unewdata.c" />
-    <ClCompile Include="uoptions.c" />
-    <ClCompile Include="uparse.c" />
-    <ClCompile Include="writesrc.c" />
+    <ClCompile Include="ucm.cpp" />
+    <ClCompile Include="ucmstate.cpp" />
+    <ClCompile Include="unewdata.cpp" />
+    <ClCompile Include="uoptions.cpp" />
+    <ClCompile Include="uparse.cpp" />
+    <ClCompile Include="writesrc.cpp" />
     <ClCompile Include="xmlparser.cpp">
       <DisableLanguageExtensions>false</DisableLanguageExtensions>
     </ClCompile>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
similarity index 99%
rename from icu4c/source/tools/toolutil/ucm.c
rename to icu4c/source/tools/toolutil/ucm.cpp
index 8d4cdfc40f1e45286931a2ab79263f61913f1ec0..9ff42dc9b06edf48ea7ea9bceecb96214ad9d959 100644 (file)
@@ -310,6 +310,8 @@ enum {
 static uint8_t
 checkBaseExtUnicode(UCMStates *baseStates, UCMTable *base, UCMTable *ext,
                     UBool moveToExt, UBool intersectBase) {
+    (void)baseStates;
+
     UCMapping *mb, *me, *mbLimit, *meLimit;
     int32_t cmp;
     uint8_t result;
@@ -1043,6 +1045,7 @@ ucm_mappingType(UCMStates *baseStates,
                 UCMapping *m,
                 UChar32 codePoints[UCNV_EXT_MAX_UCHARS],
                 uint8_t bytes[UCNV_EXT_MAX_BYTES]) {
+    (void)codePoints;
     /* check validity of the bytes and count the characters in them */
     int32_t count=ucm_countChars(baseStates, bytes, m->bLen);
     if(count<1) {
similarity index 99%
rename from icu4c/source/tools/toolutil/ucmstate.c
rename to icu4c/source/tools/toolutil/ucmstate.cpp
index 1aabbfbf6a9fecbc4400761a92edbcfeafee6ebb..669b16d9bcede5fa1e32fe94f9542e686780bc51 100644 (file)
@@ -918,6 +918,7 @@ compactToUnicodeHelper(UCMStates *states,
 
 static int32_t
 compareFallbacks(const void *context, const void *fb1, const void *fb2) {
+    (void)context;
     return ((const _MBCSToUFallback *)fb1)->offset-((const _MBCSToUFallback *)fb2)->offset;
 }