summaryrefslogtreecommitdiffstats
path: root/generator/nanopb_generator.py
diff options
context:
space:
mode:
Diffstat (limited to 'generator/nanopb_generator.py')
-rwxr-xr-xgenerator/nanopb_generator.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py
index 36cbbdfa..066ef936 100755
--- a/generator/nanopb_generator.py
+++ b/generator/nanopb_generator.py
@@ -208,21 +208,21 @@ class Enum:
result += '\n#define %s %s' % (self.value_longnames[i], x[0])
if self.options.enum_to_string:
- result += '\nconst char *%s_Name(%s v);\n' % (self.names, self.names)
+ result += '\nconst char *%s_name(%s v);\n' % (self.names, self.names)
return result
- def enum_definition(self):
+ def enum_to_string_definition(self):
if not self.options.enum_to_string:
return ""
- result = 'const char *%s_Name(%s v) {\n' % (self.names, self.names)
+ result = 'const char *%s_name(%s v) {\n' % (self.names, self.names)
result += ' switch (v) {\n'
for ((enumname, _), strname) in zip(self.values, self.value_longnames):
# Strip off the leading type name from the string value.
strval = str(strname)[len(str(self.names)) + 1:]
- result += ' case %s: return "%s";\n' % (enumname, strval)
+ result += ' case %s: return "%s";\n' % (enumname, strval)
result += ' }\n'
result += ' return "unknown";\n'
@@ -1242,7 +1242,7 @@ class ProtoFile:
yield ext.extension_def() + '\n'
for enum in self.enums:
- yield enum.enum_definition() + '\n'
+ yield enum.enum_to_string_definition() + '\n'
# Add checks for numeric limits
if self.messages: