Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(398)

Unified Diff: src/uri.cc

Issue 2135573002: Address compilation warnings for android build. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update comment. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parsing/scanner.h ('k') | test/cctest/interpreter/test-source-positions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/uri.cc
diff --git a/src/uri.cc b/src/uri.cc
index 0107721888a809f624dbf5a3031f45fff3cdee6a..de7bd9bf57749af9286a3484e3c75858ec5498e9 100644
--- a/src/uri.cc
+++ b/src/uri.cc
@@ -92,13 +92,14 @@ bool IntoTwoByte(int index, bool is_uri, int uri_length,
for (int k = index; k < uri_length; k++) {
uc16 code = uri_content->Get(k);
if (code == '%') {
- uc16 decoded;
+ int two_digits;
if (k + 2 >= uri_length ||
- (decoded = TwoDigitHex(uri_content->Get(k + 1),
- uri_content->Get(k + 2))) < 0) {
+ (two_digits = TwoDigitHex(uri_content->Get(k + 1),
+ uri_content->Get(k + 2))) < 0) {
return false;
}
k += 2;
+ uc16 decoded = static_cast<uc16>(two_digits);
if (decoded > unibrow::Utf8::kMaxOneByteChar) {
uint8_t octets[unibrow::Utf8::kMaxEncodedSize];
octets[0] = decoded;
@@ -108,15 +109,13 @@ bool IntoTwoByte(int index, bool is_uri, int uri_length,
if (number_of_continuation_bytes > 3 || k + 3 >= uri_length) {
return false;
}
-
- uc16 continuation_byte;
-
if (uri_content->Get(++k) != '%' ||
- (continuation_byte = TwoDigitHex(uri_content->Get(k + 1),
- uri_content->Get(k + 2))) < 0) {
+ (two_digits = TwoDigitHex(uri_content->Get(k + 1),
+ uri_content->Get(k + 2))) < 0) {
return false;
}
k += 2;
+ uc16 continuation_byte = static_cast<uc16>(two_digits);
octets[number_of_continuation_bytes] = continuation_byte;
}
@@ -143,13 +142,14 @@ bool IntoOneAndTwoByte(Handle<String> uri, bool is_uri,
for (int k = 0; k < uri_length; k++) {
uc16 code = uri_content.Get(k);
if (code == '%') {
- uc16 decoded;
+ int two_digits;
if (k + 2 >= uri_length ||
- (decoded = TwoDigitHex(uri_content.Get(k + 1),
- uri_content.Get(k + 2))) < 0) {
+ (two_digits = TwoDigitHex(uri_content.Get(k + 1),
+ uri_content.Get(k + 2))) < 0) {
return false;
}
+ uc16 decoded = static_cast<uc16>(two_digits);
if (decoded > unibrow::Utf8::kMaxOneByteChar) {
return IntoTwoByte(k, is_uri, uri_length, &uri_content,
two_byte_buffer);
« no previous file with comments | « src/parsing/scanner.h ('k') | test/cctest/interpreter/test-source-positions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698