diff options
author | Michi Henning <michi@zeroc.com> | 2005-06-08 05:45:24 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2005-06-08 05:45:24 +0000 |
commit | fb8f3ba00fce45f779698266b750687db6756380 (patch) | |
tree | fb75f956d6b617e1e06a04a150ca6e7de1822c0f /cpp/src/slice2cs/Gen.cpp | |
parent | Changed optimization from -O2 to -O3 for FreeBSD. (diff) | |
download | ice-fb8f3ba00fce45f779698266b750687db6756380.tar.bz2 ice-fb8f3ba00fce45f779698266b750687db6756380.tar.xz ice-fb8f3ba00fce45f779698266b750687db6756380.zip |
Fixed bug reported in
http://www.zeroc.com/vbulletin/showthread.php?p=6308#post6308
Diffstat (limited to 'cpp/src/slice2cs/Gen.cpp')
-rwxr-xr-x | cpp/src/slice2cs/Gen.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp index 4d6ad7d09b2..89ec7724928 100755 --- a/cpp/src/slice2cs/Gen.cpp +++ b/cpp/src/slice2cs/Gen.cpp @@ -2783,26 +2783,24 @@ Slice::Gen::TypesVisitor::visitConst(const ConstPtr& p) static const string basicSourceChars = "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "0123456789" - "_{}[]#()<>%:;,?*+=/^&|~!=,\\\"' \t"; + "_{}[]#()<>%:;.?*+-/^&|~!=,\\\"' "; static const set<char> charSet(basicSourceChars.begin(), basicSourceChars.end()); _out << "\""; // Opening " - ios_base::fmtflags originalFlags = _out.flags(); // Save stream state - streamsize originalWidth = _out.width(); - ostream::char_type originalFill = _out.fill(); - const string val = p->value(); for(string::const_iterator c = val.begin(); c != val.end(); ++c) { if(charSet.find(*c) == charSet.end()) { unsigned char uc = *c; // char may be signed, so make it positive - _out << "\\u"; // Print as unicode if not in basic source character set - _out.flags(ios_base::hex); - _out.width(4); - _out.fill('0'); - _out << static_cast<unsigned>(uc); + ostringstream s; + s << "\\u"; // Print as unicode if not in basic source character set + s << hex; + s.width(4); + s.fill('0'); + s << static_cast<unsigned>(uc); + _out << s.str(); } else { @@ -2810,10 +2808,6 @@ Slice::Gen::TypesVisitor::visitConst(const ConstPtr& p) } } - _out.fill(originalFill); // Restore stream state - _out.width(originalWidth); - _out.flags(originalFlags); - _out << "\""; // Closing " } else if(bp && bp->kind() == Builtin::KindLong) |