Skip to content

Commit

Permalink
Fixes for re-enabling more MSVC level 4 warnings: base/ edition chrom…
Browse files Browse the repository at this point in the history
…ium#2

This contains fixes for the following sorts of issues:
* Signedness mismatch

Defining UChar32 as a signed type may look wrong, but it's actually how the type
is already defined over in third_party/icu/.

BUG=81439
TEST=none

Review URL: https://codereview.chromium.org/380913003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282255 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
pkasting@chromium.org committed Jul 10, 2014
1 parent d6fb8ef commit 253a241
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions base/strings/string_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ void TruncateUTF8ToByteSize(const std::string& input,
// truncate the string to the end of that character.
while (char_index >= 0) {
int32 prev = char_index;
uint32 code_point = 0;
base_icu::UChar32 code_point = 0;
CBU8_NEXT(data, char_index, truncation_length, code_point);
if (!IsValidCharacter(code_point) ||
!IsValidCodepoint(code_point)) {
Expand Down Expand Up @@ -734,11 +734,11 @@ static void EatSameChars(const CHAR** pattern, const CHAR* pattern_end,
const CHAR* string_next = *string;
base_icu::UChar32 pattern_char = next(&pattern_next, pattern_end);
if (pattern_char == next(&string_next, string_end) &&
pattern_char != (base_icu::UChar32) CBU_SENTINEL) {
pattern_char != CBU_SENTINEL) {
*pattern = pattern_next;
*string = string_next;
} else {
// Uh ho, it did not match, we are done. If the last char was an
// Uh oh, it did not match, we are done. If the last char was an
// escapement, that means that it was an error to advance the ptr here,
// let's put it back where it was. This also mean that the MatchPattern
// function will return false because if we can't match an escape char
Expand Down
2 changes: 1 addition & 1 deletion base/third_party/icu/icu_utf.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace base_icu {

typedef uint32 UChar32;
typedef int32 UChar32;
typedef uint16 UChar;
typedef int8 UBool;

Expand Down

0 comments on commit 253a241

Please sign in to comment.