aboutsummaryrefslogtreecommitdiffstats
path: root/generator/nanopb_generator.py
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@npb.mail.kapsi.fi>2011-09-13 16:14:08 +0000
committerPetteri Aimonen <jpa@npb.mail.kapsi.fi>2011-09-13 16:14:08 +0000
commitfcfc99f766f278564c062922a2857c21ac9af041 (patch)
treebad83fb95b48917d36ced09debc9e6e565ff7649 /generator/nanopb_generator.py
parentd4abb63c052dc9d4c23ce72e498b4c7483f3b7cb (diff)
Fixed a bunch of bugs related to callback fields.
Most importantly, callback fields in submessages were being overwritten with garbage, causing segfaults. Additionally, converted PB_LTYPE_FIXED to PB_LTYPE_FIXED32 and PB_LTYPE_FIXED64. This makes the interface a bit easier to use, and in addition runs faster. git-svn-id: https://svn.kapsi.fi/jpa/nanopb@975 e3a754e5-d11d-0410-8d38-ebb782a927b9
Diffstat (limited to 'generator/nanopb_generator.py')
-rw-r--r--generator/nanopb_generator.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py
index 22331f0..4d5aaac 100644
--- a/generator/nanopb_generator.py
+++ b/generator/nanopb_generator.py
@@ -8,10 +8,10 @@ import os.path
FieldD = descriptor.FieldDescriptorProto
datatypes = {
FieldD.TYPE_BOOL: ('bool', 'PB_LTYPE_VARINT'),
- FieldD.TYPE_DOUBLE: ('double', 'PB_LTYPE_FIXED'),
- FieldD.TYPE_FIXED32: ('uint32_t', 'PB_LTYPE_FIXED'),
- FieldD.TYPE_FIXED64: ('uint64_t', 'PB_LTYPE_FIXED'),
- FieldD.TYPE_FLOAT: ('float', 'PB_LTYPE_FIXED'),
+ FieldD.TYPE_DOUBLE: ('double', 'PB_LTYPE_FIXED64'),
+ FieldD.TYPE_FIXED32: ('uint32_t', 'PB_LTYPE_FIXED32'),
+ FieldD.TYPE_FIXED64: ('uint64_t', 'PB_LTYPE_FIXED64'),
+ FieldD.TYPE_FLOAT: ('float', 'PB_LTYPE_FIXED32'),
FieldD.TYPE_INT32: ('int32_t', 'PB_LTYPE_VARINT'),
FieldD.TYPE_INT64: ('int64_t', 'PB_LTYPE_VARINT'),
FieldD.TYPE_SFIXED32: ('int32_t', 'PB_LTYPE_FIXED'),