summaryrefslogtreecommitdiff
path: root/vrt/lib/gen_parse_switch_body.py
diff options
context:
space:
mode:
authorJosh Blum2009-12-17 17:29:45 -0800
committerJosh Blum2009-12-17 18:01:39 -0800
commit1912d90f062a7b391d071a590b24f062f2bd3183 (patch)
tree20bb9ec5c7597f5becdf19cbef13e21d36bc3abd /vrt/lib/gen_parse_switch_body.py
parentfc4fa0a1894f0f85be1a76e48b922effb3d5dd9b (diff)
downloadgnuradio-1912d90f062a7b391d071a590b24f062f2bd3183.tar.gz
gnuradio-1912d90f062a7b391d071a590b24f062f2bd3183.tar.bz2
gnuradio-1912d90f062a7b391d071a590b24f062f2bd3183.zip
Replaced the need for code word tables by setting the header/trailer lengths
in the switch body jump table, just like in the unparser switch body.
Diffstat (limited to 'vrt/lib/gen_parse_switch_body.py')
-rwxr-xr-xvrt/lib/gen_parse_switch_body.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/vrt/lib/gen_parse_switch_body.py b/vrt/lib/gen_parse_switch_body.py
index 105fa76a7..d13e490b7 100755
--- a/vrt/lib/gen_parse_switch_body.py
+++ b/vrt/lib/gen_parse_switch_body.py
@@ -48,13 +48,17 @@ def do_case(f, cw):
f.write("h->%s = 0;\n" % (name,))
return 0
+ def dolength(index):
+ f.write(" n32_bit_words_header = %d;\n"%index)
+
def dotrailer(name, mask):
- f.write(" ")
if cw & mask:
- f.write("h->%s = ntohl(p[len-1]);\n" % (name,))
+ f.write(" h->%s = ntohl(p[len-1]);\n" % (name,))
+ f.write(" n32_bit_words_trailer = 1;\n")
return 1
else:
- f.write("h->%s = 0;\n" % (name,))
+ f.write(" h->%s = 0;\n" % (name,))
+ f.write(" n32_bit_words_trailer = 0;\n")
return 0
f.write(" case %d:\n" % (cw,))
@@ -64,6 +68,7 @@ def do_case(f, cw):
index += do64("class_id", HAS_CLASS_ID, index)
index += do32("integer_secs", HAS_INTEGER_SECS, index)
index += do64("fractional_secs", HAS_FRACTIONAL_SECS, index)
+ dolength(index)
dotrailer("trailer", HAS_TRAILER)
f.write(" break;\n\n")