summaryrefslogtreecommitdiff
path: root/cpp/src/Slice
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2016-03-08 18:27:54 +0100
committerJose <jose@zeroc.com>2016-03-08 18:27:54 +0100
commit0e7e446475ebb6cf3a9382d54f0a28c04fa6e776 (patch)
tree3370c718e1acab6fc5b7a9a3ffb2db01c56e46bf /cpp/src/Slice
parentrenaming man pages for icegriddb/icestormdb (diff)
downloadice-0e7e446475ebb6cf3a9382d54f0a28c04fa6e776.tar.bz2
ice-0e7e446475ebb6cf3a9382d54f0a28c04fa6e776.tar.xz
ice-0e7e446475ebb6cf3a9382d54f0a28c04fa6e776.zip
String literals Windows fixes
Diffstat (limited to 'cpp/src/Slice')
-rw-r--r--cpp/src/Slice/PythonUtil.cpp14
-rw-r--r--cpp/src/Slice/RubyUtil.cpp14
2 files changed, 14 insertions, 14 deletions
diff --git a/cpp/src/Slice/PythonUtil.cpp b/cpp/src/Slice/PythonUtil.cpp
index 92f657e8221..38619b6db3e 100644
--- a/cpp/src/Slice/PythonUtil.cpp
+++ b/cpp/src/Slice/PythonUtil.cpp
@@ -1902,7 +1902,7 @@ Slice::Python::CodeVisitor::writeConstantValue(const TypePtr& type, const Syntax
}
s += "\\";
}
-
+
//
// An even number of slash \ will escape the backslash and
// the codepoint will be interpreted as its charaters
@@ -1916,16 +1916,16 @@ Slice::Python::CodeVisitor::writeConstantValue(const TypePtr& type, const Syntax
// Convert codepoint to UTF8 bytes and write the escaped bytes
//
_out << s.substr(0, s.size() - 1);
-
+
size_t sz = value[j] == 'U' ? 8 : 4;
string codepoint = value.substr(j + 1, sz);
assert(codepoint.size() == sz);
IceUtil::Int64 v = IceUtilInternal::strToInt64(codepoint.c_str(), 0, 16);
-
+
vector<unsigned int> u32buffer;
- u32buffer.push_back(v);
-
+ u32buffer.push_back(static_cast<unsigned int>(v));
+
vector<unsigned char> u8buffer;
IceUtilInternal::ConversionResult result = convertUTF32ToUTF8(u32buffer, u8buffer, IceUtil::lenientConversion);
switch(result)
@@ -1942,7 +1942,7 @@ Slice::Python::CodeVisitor::writeConstantValue(const TypePtr& type, const Syntax
throw IceUtil::IllegalConversionException(__FILE__, __LINE__);
}
}
-
+
ostringstream s;
for(vector<unsigned char>::const_iterator q = u8buffer.begin(); q != u8buffer.end(); ++q)
{
@@ -1953,7 +1953,7 @@ Slice::Python::CodeVisitor::writeConstantValue(const TypePtr& type, const Syntax
s << static_cast<unsigned int>(*q);
}
_out << s.str();
-
+
i = j + 1 + sz;
}
else
diff --git a/cpp/src/Slice/RubyUtil.cpp b/cpp/src/Slice/RubyUtil.cpp
index fbed4764bbe..796bdd5cd57 100644
--- a/cpp/src/Slice/RubyUtil.cpp
+++ b/cpp/src/Slice/RubyUtil.cpp
@@ -1493,7 +1493,7 @@ Slice::Ruby::CodeVisitor::writeConstantValue(const TypePtr& type, const SyntaxTr
}
s += "\\";
}
-
+
//
// An even number of slash \ will escape the backslash and
// the codepoint will be interpreted as its charaters
@@ -1507,15 +1507,15 @@ Slice::Ruby::CodeVisitor::writeConstantValue(const TypePtr& type, const SyntaxTr
// Convert codepoint to UTF8 bytes and write the escaped bytes
//
_out << s.substr(0, s.size() - 1);
-
+
size_t sz = value[j] == 'U' ? 8 : 4;
string codepoint = value.substr(j + 1, sz);
assert(codepoint.size() == sz);
IceUtil::Int64 v = IceUtilInternal::strToInt64(codepoint.c_str(), 0, 16);
-
+
vector<unsigned int> u32buffer;
- u32buffer.push_back(v);
-
+ u32buffer.push_back(static_cast<unsigned int>(v));
+
vector<unsigned char> u8buffer;
IceUtilInternal::ConversionResult result = convertUTF32ToUTF8(u32buffer, u8buffer, IceUtil::lenientConversion);
switch(result)
@@ -1532,7 +1532,7 @@ Slice::Ruby::CodeVisitor::writeConstantValue(const TypePtr& type, const SyntaxTr
throw IceUtil::IllegalConversionException(__FILE__, __LINE__);
}
}
-
+
ostringstream s;
for(vector<unsigned char>::const_iterator q = u8buffer.begin(); q != u8buffer.end(); ++q)
{
@@ -1543,7 +1543,7 @@ Slice::Ruby::CodeVisitor::writeConstantValue(const TypePtr& type, const SyntaxTr
s << static_cast<unsigned int>(*q);
}
_out << s.str();
-
+
i = j + 1 + sz;
}
else