summaryrefslogtreecommitdiff
path: root/cpp/src/slice2php/Main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/slice2php/Main.cpp')
-rw-r--r--cpp/src/slice2php/Main.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/cpp/src/slice2php/Main.cpp b/cpp/src/slice2php/Main.cpp
index dc2453fb77c..2209bee48b4 100644
--- a/cpp/src/slice2php/Main.cpp
+++ b/cpp/src/slice2php/Main.cpp
@@ -926,10 +926,7 @@ CodeVisitor::visitEnum(const EnumPtr& p)
long i = 0;
for(EnumeratorList::iterator q = enums.begin(); q != enums.end(); ++q, ++i)
{
- string fixedEnum = fixIdent((*q)->name());
- ostringstream idx;
- idx << i;
- _out << nl << "const " << fixedEnum << " = " << idx.str() << ';';
+ _out << nl << "const " << fixIdent((*q)->name()) << " = " << (*q)->value() << ';';
}
}
@@ -945,7 +942,7 @@ CodeVisitor::visitEnum(const EnumPtr& p)
{
_out << ", ";
}
- _out << "'" << (*q)->name() << "'";
+ _out << "'" << (*q)->name() << "', " << (*q)->value();
}
_out << "));";