Browse Source

tools: simplify check

in this case, we always need a pointer, so remove the check
and just add it to the template
pull/2938/head
lisa neigut 6 years ago
committed by Rusty Russell
parent
commit
118caae45b
  1. 5
      tools/generate-wire.py

5
tools/generate-wire.py

@ -978,9 +978,8 @@ class Subtype(Message):
s = '{}->{} = fromwire_{}(cursor, plen);'.format(
self.name, f.name, basetype)
else:
ref = '&' if f.fieldtype.needs_ptr() else ''
s = 'fromwire_{}(cursor, plen, {}{}->{});'.format(
basetype, ref, self.name, f.name)
s = 'fromwire_{}(cursor, plen, &{}->{});'.format(
basetype, self.name, f.name)
subcalls.append(s)
return template.format(

Loading…
Cancel
Save