Commit 8c15b1d5 authored by miloyip@gmail.com's avatar miloyip@gmail.com

Fixed gcc compilation errors.

git-svn-id: https://rapidjson.googlecode.com/svn/trunk@43 c5894555-1306-4e8d-425f-1f6f381ee07c
parent 3b1a995d
...@@ -247,7 +247,7 @@ struct UTF16LE : UTF16<CharType> { ...@@ -247,7 +247,7 @@ struct UTF16LE : UTF16<CharType> {
} }
template <typename OutputStream> template <typename OutputStream>
static void Put(OutputStream& os, Ch c) { static void Put(OutputStream& os, CharType c) {
os.Put(c & 0xFFu); os.Put(c & 0xFFu);
os.Put((c >> 8) & 0xFFu); os.Put((c >> 8) & 0xFFu);
} }
...@@ -274,7 +274,7 @@ struct UTF16BE : UTF16<CharType> { ...@@ -274,7 +274,7 @@ struct UTF16BE : UTF16<CharType> {
} }
template <typename OutputStream> template <typename OutputStream>
static void Put(OutputStream& os, Ch c) { static void Put(OutputStream& os, CharType c) {
os.Put((c >> 8) & 0xFFu); os.Put((c >> 8) & 0xFFu);
os.Put(c & 0xFFu); os.Put(c & 0xFFu);
} }
...@@ -336,7 +336,7 @@ struct UTF32LE : UTF32<CharType> { ...@@ -336,7 +336,7 @@ struct UTF32LE : UTF32<CharType> {
} }
template <typename OutputStream> template <typename OutputStream>
static void Put(OutputStream& os, Ch c) { static void Put(OutputStream& os, CharType c) {
os.Put(c & 0xFFu); os.Put(c & 0xFFu);
os.Put((c >> 8) & 0xFFu); os.Put((c >> 8) & 0xFFu);
os.Put((c >> 16) & 0xFFu); os.Put((c >> 16) & 0xFFu);
...@@ -367,7 +367,7 @@ struct UTF32BE : UTF32<CharType> { ...@@ -367,7 +367,7 @@ struct UTF32BE : UTF32<CharType> {
} }
template <typename OutputStream> template <typename OutputStream>
static void Put(OutputStream& os, Ch c) { static void Put(OutputStream& os, CharType c) {
os.Put((c >> 24) & 0xFFu); os.Put((c >> 24) & 0xFFu);
os.Put((c >> 16) & 0xFFu); os.Put((c >> 16) & 0xFFu);
os.Put((c >> 8) & 0xFFu); os.Put((c >> 8) & 0xFFu);
......
...@@ -121,7 +121,7 @@ protected: ...@@ -121,7 +121,7 @@ protected:
AutoUTFOutputStream<unsigned, FileWriteStream> eos(os, type, putBOM); AutoUTFOutputStream<unsigned, FileWriteStream> eos(os, type, putBOM);
StringStream s(json_); StringStream s(json_);
while (s.Peek() != '\0') { while (s.Peek() != '\0') {
bool success = Transcoder<UTF8<>, AutoUTF<unsigned>>::Transcode(s, eos); bool success = Transcoder<UTF8<>, AutoUTF<unsigned> >::Transcode(s, eos);
EXPECT_TRUE(success); EXPECT_TRUE(success);
} }
eos.Flush(); eos.Flush();
...@@ -136,16 +136,16 @@ protected: ...@@ -136,16 +136,16 @@ protected:
}; };
TEST_F(EncodingsTest, EncodedInputStream) { TEST_F(EncodingsTest, EncodedInputStream) {
TestEncodedInputStream<UTF8<>, UTF8<>>("utf8.json"); TestEncodedInputStream<UTF8<>, UTF8<> >("utf8.json");
TestEncodedInputStream<UTF8<>, UTF8<>>("utf8bom.json"); TestEncodedInputStream<UTF8<>, UTF8<> >("utf8bom.json");
TestEncodedInputStream<UTF16LE<>, UTF16<>>("utf16le.json"); TestEncodedInputStream<UTF16LE<>, UTF16<> >("utf16le.json");
TestEncodedInputStream<UTF16LE<>, UTF16<>>("utf16lebom.json"); TestEncodedInputStream<UTF16LE<>, UTF16<> >("utf16lebom.json");
TestEncodedInputStream<UTF16BE<>, UTF16<>>("utf16be.json"); TestEncodedInputStream<UTF16BE<>, UTF16<> >("utf16be.json");
TestEncodedInputStream<UTF16BE<>, UTF16<>>("utf16bebom.json"); TestEncodedInputStream<UTF16BE<>, UTF16<> >("utf16bebom.json");
TestEncodedInputStream<UTF32LE<>, UTF32<>>("utf32le.json"); TestEncodedInputStream<UTF32LE<>, UTF32<> >("utf32le.json");
TestEncodedInputStream<UTF32LE<>, UTF32<>>("utf32lebom.json"); TestEncodedInputStream<UTF32LE<>, UTF32<> >("utf32lebom.json");
TestEncodedInputStream<UTF32BE<>, UTF32<>>("utf32be.json"); TestEncodedInputStream<UTF32BE<>, UTF32<> >("utf32be.json");
TestEncodedInputStream<UTF32BE<>, UTF32<>>("utf32bebom.json"); TestEncodedInputStream<UTF32BE<>, UTF32<> >("utf32bebom.json");
} }
TEST_F(EncodingsTest, AutoUTFInputStream) { TEST_F(EncodingsTest, AutoUTFInputStream) {
...@@ -158,16 +158,16 @@ TEST_F(EncodingsTest, AutoUTFInputStream) { ...@@ -158,16 +158,16 @@ TEST_F(EncodingsTest, AutoUTFInputStream) {
} }
TEST_F(EncodingsTest, EncodedOutputStream) { TEST_F(EncodingsTest, EncodedOutputStream) {
TestEncodedOutputStream<UTF8<>, UTF8<>>("utf8.json", false); TestEncodedOutputStream<UTF8<>, UTF8<> >("utf8.json", false);
TestEncodedOutputStream<UTF8<>, UTF8<>>("utf8bom.json", true); TestEncodedOutputStream<UTF8<>, UTF8<> >("utf8bom.json", true);
TestEncodedOutputStream<UTF16LE<>, UTF16<>>("utf16le.json", false); TestEncodedOutputStream<UTF16LE<>, UTF16<> >("utf16le.json", false);
TestEncodedOutputStream<UTF16LE<>, UTF16<>>("utf16lebom.json", true); TestEncodedOutputStream<UTF16LE<>, UTF16<> >("utf16lebom.json", true);
TestEncodedOutputStream<UTF16BE<>, UTF16<>>("utf16be.json", false); TestEncodedOutputStream<UTF16BE<>, UTF16<> >("utf16be.json", false);
TestEncodedOutputStream<UTF16BE<>, UTF16<>>("utf16bebom.json", true); TestEncodedOutputStream<UTF16BE<>, UTF16<> >("utf16bebom.json", true);
TestEncodedOutputStream<UTF32LE<>, UTF32<>>("utf32le.json", false); TestEncodedOutputStream<UTF32LE<>, UTF32<> >("utf32le.json", false);
TestEncodedOutputStream<UTF32LE<>, UTF32<>>("utf32lebom.json", true); TestEncodedOutputStream<UTF32LE<>, UTF32<> >("utf32lebom.json", true);
TestEncodedOutputStream<UTF32BE<>, UTF32<>>("utf32be.json", false); TestEncodedOutputStream<UTF32BE<>, UTF32<> >("utf32be.json", false);
TestEncodedOutputStream<UTF32BE<>, UTF32<>>("utf32bebom.json", true); TestEncodedOutputStream<UTF32BE<>, UTF32<> >("utf32bebom.json", true);
} }
TEST_F(EncodingsTest, AutoUTFOutputStream) { TEST_F(EncodingsTest, AutoUTFOutputStream) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment