aboutsummaryrefslogtreecommitdiffstats
path: root/asn1
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2016-01-05 12:55:13 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-01-05 13:39:22 +0100
commitc13ebf78c850ce163d4c9059dffa6791dea13a59 (patch)
treeba3838af7a6c973bbf74ae12ec8d9213df2c5438 /asn1
parent8f2007c1bd8ac483f2a551c16667f177732617d4 (diff)
asn1tostruct.py: don't generate unused local struct instances.
Diffstat (limited to 'asn1')
-rwxr-xr-xasn1/utils/asn1tostruct.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/asn1/utils/asn1tostruct.py b/asn1/utils/asn1tostruct.py
index c3d5e17..862839f 100755
--- a/asn1/utils/asn1tostruct.py
+++ b/asn1/utils/asn1tostruct.py
@@ -288,7 +288,7 @@ for key in iesDefs:
f.write(" %s_t *%s,\n" % (prefix + re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key))))
f.write(" ANY_t *any_p) {\n\n")
- f.write(" %s_t %s;\n %s_t *%s_p = &%s;\n" % (asn1cStruct, asn1cStructfirstlower, asn1cStruct, asn1cStructfirstlower, asn1cStructfirstlower))
+ f.write(" %s_t *%s_p = NULL;\n" % (asn1cStruct, asn1cStructfirstlower))
f.write(" int i, decoded = 0;\n")
if len(iesDefs[key]["ies"]) != 0:
f.write(" int tempDecoded = 0;\n")
@@ -316,8 +316,7 @@ for key in iesDefs:
f.write(" /* Conditional field */\n")
f.write(" case %sProtocolIE_ID_%s:\n" % (prefix, re.sub('-', '_', ie[0])))
f.write(" {\n")
- f.write(" %s_t %s;\n" % (ietypeunderscore, lowerFirstCamelWord(ietypesubst)))
- f.write(" %s_t *%s_p = &%s;\n" % (ietypeunderscore, lowerFirstCamelWord(ietypesubst), lowerFirstCamelWord(ietypesubst)))
+ f.write(" %s_t *%s_p = NULL;\n" % (ietypeunderscore, lowerFirstCamelWord(ietypesubst)))
if ie[3] != "mandatory":
f.write(" %s->presenceMask |= %s_%s_PRESENT;\n" % (lowerFirstCamelWord(re.sub('-', '_', key)), keyupperunderscore, ieupperunderscore))
f.write(" tempDecoded = ANY_to_type_aper(&ie_p->value, &asn_DEF_%s, (void**)&%s_p);\n" % (ietypeunderscore, lowerFirstCamelWord(ietypesubst)))