aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/js/js_generator.cc
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xfxyjwf@gmail.com>2015-12-30 01:18:22 -0800
committerGravatar Feng Xiao <xfxyjwf@gmail.com>2015-12-30 01:18:22 -0800
commit17347e3d0d86413eb6bca6fa077bfc319818b32a (patch)
treeb32808e16f6ec26490817d59f96e8c4cb0d1a6dd /src/google/protobuf/compiler/js/js_generator.cc
parent283c40c8972e0096dd10c9d58685f71e8c19d783 (diff)
Fix for Visual Studio 2008.
Diffstat (limited to 'src/google/protobuf/compiler/js/js_generator.cc')
-rwxr-xr-xsrc/google/protobuf/compiler/js/js_generator.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/google/protobuf/compiler/js/js_generator.cc b/src/google/protobuf/compiler/js/js_generator.cc
index 3ffa9539..e6c3b36a 100755
--- a/src/google/protobuf/compiler/js/js_generator.cc
+++ b/src/google/protobuf/compiler/js/js_generator.cc
@@ -447,7 +447,7 @@ string JSOneofIndex(const OneofDescriptor* oneof) {
// Decodes a codepoint in \x0000 -- \xFFFF. Since JS strings are UTF-16, we only
// need to handle the BMP (16-bit range) here.
-uint16_t DecodeUTF8Codepoint(uint8_t* bytes, size_t* length) {
+uint16 DecodeUTF8Codepoint(uint8* bytes, size_t* length) {
if (*length == 0) {
return 0;
}
@@ -491,14 +491,14 @@ string EscapeJSString(const string& in, bool is_utf8) {
string result;
size_t decoded = 0;
for (size_t i = 0; i < in.size(); i += decoded) {
- uint16_t codepoint = 0;
+ uint16 codepoint = 0;
if (is_utf8) {
// Decode the next UTF-8 codepoint.
size_t have_bytes = in.size() - i;
- uint8_t bytes[3] = {
- static_cast<uint8_t>(in[i]),
- static_cast<uint8_t>(((i + 1) < in.size()) ? in[i + 1] : 0),
- static_cast<uint8_t>(((i + 2) < in.size()) ? in[i + 2] : 0),
+ uint8 bytes[3] = {
+ static_cast<uint8>(in[i]),
+ static_cast<uint8>(((i + 1) < in.size()) ? in[i + 1] : 0),
+ static_cast<uint8>(((i + 2) < in.size()) ? in[i + 2] : 0),
};
codepoint = DecodeUTF8Codepoint(bytes, &have_bytes);
if (have_bytes == 0) {
@@ -506,7 +506,7 @@ string EscapeJSString(const string& in, bool is_utf8) {
}
decoded = have_bytes;
} else {
- codepoint = static_cast<uint16_t>(static_cast<uint8_t>(in[i]));
+ codepoint = static_cast<uint16>(static_cast<uint8>(in[i]));
decoded = 1;
}