X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=vrt%2Flib%2Fgen_parse_switch_body.py;h=d13e490b75b64c2bdc43336a82fccdf697f09c65;hb=6b1bcb301ff4cb20ac62bf5400fa3001182cb069;hp=105fa76a71b902d57c30e40e64780808754c4dbb;hpb=fc4fa0a1894f0f85be1a76e48b922effb3d5dd9b;p=debian%2Fgnuradio diff --git a/vrt/lib/gen_parse_switch_body.py b/vrt/lib/gen_parse_switch_body.py index 105fa76a..d13e490b 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")