From 830d990771be4e9e19230f7a58422a952275974d Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 22 Oct 2014 17:47:36 +0200 Subject: [PATCH] Fix parsing of enum values in the lp_gen_wrappers. --- tools/genwrappers.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/genwrappers.cc b/tools/genwrappers.cc index 7c17a2554..5f942002f 100644 --- a/tools/genwrappers.cc +++ b/tools/genwrappers.cc @@ -339,7 +339,7 @@ static void parseEnum(Project *proj, XmlNode node){ int value = 0; for (it=enumValues.begin();it!=enumValues.end();++it){ string initializer = (*it).getChild("initializer").getText(); - if (initializer!="") value=atoi(initializer.c_str()); + if (initializer.length() > 1) value=atoi(initializer.substr(1).c_str()); ConstField *cf=new ConstField(Type::getType("int"),(*it).getChild("name").getText(),value); cf->setHelp((*it).getChild("detaileddescription").getChild("para").getText()); klass->addConstField(cf);