diff options
author | Michi Henning <michi@zeroc.com> | 2002-07-05 04:05:42 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2002-07-05 04:05:42 +0000 |
commit | bb1b84d1436f26eb8c1941eedb97e943e81947bb (patch) | |
tree | 0dd48ac1ce692218bcb9e6578e6d7f5bee1ea2ba /cpp/src/slice2cpp | |
parent | Added "i64" suffix for 64-bit integer literals. (diff) | |
download | ice-bb1b84d1436f26eb8c1941eedb97e943e81947bb.tar.bz2 ice-bb1b84d1436f26eb8c1941eedb97e943e81947bb.tar.xz ice-bb1b84d1436f26eb8c1941eedb97e943e81947bb.zip |
Changed the way 64-bit literals are done in the generated code. The
approach used now (a macro) makes the generated source more readable
than the previous one.
Diffstat (limited to 'cpp/src/slice2cpp')
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index db6643bf6ba..06bec36200c 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -214,6 +214,8 @@ Slice::Gen::generate(const UnitPtr& unit) _dllExport += " "; } + printDefInt64Macro(H); + ProxyDeclVisitor proxyDeclVisitor(H, C, _dllExport); unit->visit(&proxyDeclVisitor); @@ -263,6 +265,8 @@ Slice::Gen::generate(const UnitPtr& unit) ImplVisitor implVisitor(implH, implC, _dllExport); unit->visit(&implVisitor); } + + printUndefInt64Macro(H); } Slice::Gen::TypesVisitor::TypesVisitor(Output& h, Output& c, const string& dllExport) : @@ -935,11 +939,7 @@ Slice::Gen::TypesVisitor::visitConstDef(const ConstDefPtr& p) H << nl << "const " << typeToString(p->type()) << " " << p->name() << " = "; BuiltinPtr bp = BuiltinPtr::dynamicCast(p->type()); - if(bp && bp->kind() != Builtin::KindString) - { - H << p->value(); - } - else + if(bp && bp->kind() == Builtin::KindString) { // // Expand strings into the basic source character set. We can't use isalpha() and the like @@ -981,6 +981,14 @@ Slice::Gen::TypesVisitor::visitConstDef(const ConstDefPtr& p) H << "\""; // Closing " } + else if(bp && bp->kind() == Builtin::KindLong) + { + H << "INT64LITERAL(" << p->value() << ")"; + } + else + { + H << p->value(); + } H << ";"; } |