diff options
author | Mark Spruiell <mes@zeroc.com> | 2001-12-14 16:07:31 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2001-12-14 16:07:31 +0000 |
commit | 50183347d26460637be8731a9e3253591ac5054a (patch) | |
tree | fd9d9323aae381895a341c184fdba2192fb1b4a4 /cpp/src/slice2cpp/Gen.cpp | |
parent | minor fix (diff) | |
download | ice-50183347d26460637be8731a9e3253591ac5054a.tar.bz2 ice-50183347d26460637be8731a9e3253591ac5054a.tar.xz ice-50183347d26460637be8731a9e3253591ac5054a.zip |
removing support for 64-bit enums
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 47473c432c7..167f2c0aed2 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -590,6 +590,7 @@ Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) string scope = p->scope(); int sz = enumerators.size(); + assert(sz <= 0x7fffffff); // 64-bit enums are not supported H << sp << nl << _dllExport << "void __write(::IceInternal::BasicStream*, " << name << ");"; H << nl << _dllExport << "void __read(::IceInternal::BasicStream*, " << name << "&);"; @@ -604,13 +605,9 @@ Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) { C << nl << "__os->write(static_cast< ::Ice::Short>(v));"; } - else if (sz <= 0x7fffffff) - { - C << nl << "__os->write(static_cast< ::Ice::Int>(v));"; - } else { - C << nl << "__os->write(static_cast< ::Ice::Long>(v));"; + C << nl << "__os->write(static_cast< ::Ice::Int>(v));"; } C << eb; C << sp << nl << "void" << nl << scope.substr(2) << "__read(::IceInternal::BasicStream* __is, " << scoped @@ -628,15 +625,9 @@ Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) C << nl << "__is->read(val);"; C << nl << "v = static_cast< " << scoped << ">(val);"; } - else if (sz <= 0x7fffffff) - { - C << nl << "::Ice::Int val;"; - C << nl << "__is->read(val);"; - C << nl << "v = static_cast< " << scoped << ">(val);"; - } else { - C << nl << "::Ice::Long val;"; + C << nl << "::Ice::Int val;"; C << nl << "__is->read(val);"; C << nl << "v = static_cast< " << scoped << ">(val);"; } |