blob: 8141437153d942b1b236edd08874a81f91f7ca67 [file] [log] [blame]
diff --git a/source/common/locmap.c b/source/common/locmap.c
index 59809c6..927041b 100644
--- a/source/common/locmap.c
+++ b/source/common/locmap.c
@@ -29,6 +29,7 @@
#include "cstring.h"
#include "cmemory.h"
+#if 0
#if U_PLATFORM == U_PF_WINDOWS && defined(_MSC_VER) && (_MSC_VER >= 1500)
/*
* TODO: It seems like we should widen this to
@@ -40,6 +41,7 @@
*/
#define USE_WINDOWS_LOCALE_API
#endif
+#endif
#ifdef USE_WINDOWS_LOCALE_API
#include <windows.h>
diff --git a/source/common/stringpiece.cpp b/source/common/stringpiece.cpp
index 0fb2b3e..007713e 100644
--- a/source/common/stringpiece.cpp
+++ b/source/common/stringpiece.cpp
@@ -68,6 +68,14 @@ operator==(const StringPiece& x, const StringPiece& y) {
}
+/* Microsoft Visual Studio (even 2013) complains about redefinition of this
+ * static const class variable. However, the C++ standard states that this
+ * definition is correct. Perhaps there is a bug in the Microsoft compiler.
+ * This is not an issue on any other compilers (that we know of).
+ * Cygwin with MSVC 9.0 also complains here about redefinition.
+ */
+#if (!defined(_MSC_VER) || (_MSC_VER > 1800)) && !defined(CYGWINMSVC)
const int32_t StringPiece::npos = 0x7fffffff;
+#endif
U_NAMESPACE_END
diff --git a/source/i18n/collationfastlatin.cpp b/source/i18n/collationfastlatin.cpp
index 0b26d1d..dc654a3 100644
--- a/source/i18n/collationfastlatin.cpp
+++ b/source/i18n/collationfastlatin.cpp
@@ -39,10 +39,10 @@ CollationFastLatin::getOptions(const CollationData *data, const CollationSetting
uint32_t v1 = settings.variableTop >> 24;
int32_t headerLength = *table & 0xff;
int32_t i = headerLength - 1;
- if(i <= 0 || v1 > (table[i] & 0x7f)) {
+ if(i <= 0 || v1 > (table[i] & 0x7fu)) {
return -1; // variableTop >= digits, should not occur
}
- while(i > 1 && v1 <= (table[i - 1] & 0x7f)) { --i; }
+ while(i > 1 && v1 <= (table[i - 1] & 0x7fu)) { --i; }
// In the table header, the miniVarTop is in bits 15..7, with 4 zero bits 19..16 implied.
// Shift right to make it comparable with long mini primaries in bits 15..3.
miniVarTop = (table[i] & 0xff80) >> 4;
diff --git a/source/i18n/decimfmt.cpp b/source/i18n/decimfmt.cpp
index da1f8d2..825651b 100644
--- a/source/i18n/decimfmt.cpp
+++ b/source/i18n/decimfmt.cpp
@@ -1450,7 +1450,7 @@ DecimalFormat::_format(int64_t number,
// Slide the number to the start of the output str
U_ASSERT(destIdx >= 0);
int32_t length = MAX_IDX - destIdx -1;
- /*int32_t prefixLen = */ appendAffix(appendTo, number, handler, number<0, TRUE);
+ /*int32_t prefixLen = */ appendAffix(appendTo, static_cast<double>(number), handler, number<0, TRUE);
int32_t maxIntDig = getMaximumIntegerDigits();
int32_t destlength = length<=maxIntDig?length:maxIntDig; // dest length pinned to max int digits
@@ -1474,7 +1474,7 @@ DecimalFormat::_format(int64_t number,
destlength);
handler.addAttribute(kIntegerField, intBegin, appendTo.length());
- /*int32_t suffixLen =*/ appendAffix(appendTo, number, handler, number<0, FALSE);
+ /*int32_t suffixLen =*/ appendAffix(appendTo, static_cast<double>(number), handler, number<0, FALSE);
//outputStr[length]=0;
diff --git a/source/i18n/digitlst.cpp b/source/i18n/digitlst.cpp
index b0e6010..8de7324 100644
--- a/source/i18n/digitlst.cpp
+++ b/source/i18n/digitlst.cpp
@@ -704,7 +704,7 @@ DigitList::set(int64_t source)
U_ASSERT(uprv_strlen(str) < sizeof(str));
uprv_decNumberFromString(fDecNumber, str, &fContext);
- internalSetDouble(source);
+ internalSetDouble(static_cast<double>(source));
}
/**
diff --git a/source/i18n/regexcmp.cpp b/source/i18n/regexcmp.cpp
index 0c2196f..ea01d5a 100644
--- a/source/i18n/regexcmp.cpp
+++ b/source/i18n/regexcmp.cpp
@@ -3471,7 +3471,7 @@ int32_t RegexCompile::maxMatchLength(int32_t start, int32_t end) {
break;
}
- int32_t maxLoopCount = fRXPat->fCompiledPat->elementAti(loc+3);
+ int32_t maxLoopCount = static_cast<int32_t>(fRXPat->fCompiledPat->elementAti(loc+3));
if (maxLoopCount == -1) {
// Unbounded Loop. No upper bound on match length.
currentLen = INT32_MAX;