mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-04 03:03:51 +01:00
tools/gen: Always return bool!
This commit is contained in:
parent
1a1be6abd6
commit
286d6c3165
3 changed files with 6 additions and 3 deletions
|
@ -15,7 +15,7 @@ bool fromwire_bool(const u8 **cursor UNNEEDED, size_t *max UNNEEDED)
|
||||||
void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED)
|
void *fromwire_fail(const u8 **cursor UNNEEDED, size_t *max UNNEEDED)
|
||||||
{ fprintf(stderr, "fromwire_fail called!\n"); abort(); }
|
{ fprintf(stderr, "fromwire_fail called!\n"); abort(); }
|
||||||
/* Generated stub for fromwire_lease_rates */
|
/* Generated stub for fromwire_lease_rates */
|
||||||
void fromwire_lease_rates(const u8 **cursor UNNEEDED, size_t *plen UNNEEDED, struct lease_rates *lease_rates UNNEEDED)
|
bool fromwire_lease_rates(const u8 **cursor UNNEEDED, size_t *plen UNNEEDED, struct lease_rates *lease_rates UNNEEDED)
|
||||||
{ fprintf(stderr, "fromwire_lease_rates called!\n"); abort(); }
|
{ fprintf(stderr, "fromwire_lease_rates called!\n"); abort(); }
|
||||||
/* Generated stub for fromwire_secp256k1_ecdsa_signature */
|
/* Generated stub for fromwire_secp256k1_ecdsa_signature */
|
||||||
void fromwire_secp256k1_ecdsa_signature(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
|
void fromwire_secp256k1_ecdsa_signature(const u8 **cursor UNNEEDED, size_t *max UNNEEDED,
|
||||||
|
|
|
@ -148,7 +148,7 @@ void towire_${subtype.name}(u8 **p, const ${subtype.type_name()} *${subtype.name
|
||||||
% if subtype.is_varsize():
|
% if subtype.is_varsize():
|
||||||
${subtype.type_name()} *fromwire_${subtype.name}(const tal_t *ctx, const u8 **cursor, size_t *plen);
|
${subtype.type_name()} *fromwire_${subtype.name}(const tal_t *ctx, const u8 **cursor, size_t *plen);
|
||||||
% else:
|
% else:
|
||||||
void fromwire_${subtype.name}(const u8 **cursor, size_t *plen, ${subtype.type_name()} *${subtype.name});
|
bool fromwire_${subtype.name}(const u8 **cursor, size_t *plen, ${subtype.type_name()} *${subtype.name});
|
||||||
% endif
|
% endif
|
||||||
|
|
||||||
% endfor
|
% endfor
|
||||||
|
|
|
@ -151,7 +151,7 @@ ${static}void towire_${subtype.name}(u8 **p, const ${subtype.type_name()} *${sub
|
||||||
${static}${subtype.type_name()} *
|
${static}${subtype.type_name()} *
|
||||||
fromwire_${subtype.name}(const tal_t *ctx, const u8 **cursor, size_t *plen)
|
fromwire_${subtype.name}(const tal_t *ctx, const u8 **cursor, size_t *plen)
|
||||||
% else:
|
% else:
|
||||||
${static}void fromwire_${subtype.name}(${'const tal_t *ctx, ' if subtype.needs_context() else ''}const u8 **cursor, size_t *plen, ${subtype.type_name()} *${subtype.name})
|
${static}bool fromwire_${subtype.name}(${'const tal_t *ctx, ' if subtype.needs_context() else ''}const u8 **cursor, size_t *plen, ${subtype.type_name()} *${subtype.name})
|
||||||
% endif
|
% endif
|
||||||
{
|
{
|
||||||
% if subtype.is_varsize():
|
% if subtype.is_varsize():
|
||||||
|
@ -175,6 +175,9 @@ ${static}void fromwire_${subtype.name}(${'const tal_t *ctx, ' if subtype.needs_c
|
||||||
% if subtype.is_varsize():
|
% if subtype.is_varsize():
|
||||||
|
|
||||||
return ${subtype.name};
|
return ${subtype.name};
|
||||||
|
% else:
|
||||||
|
|
||||||
|
return *cursor != NULL;
|
||||||
% endif
|
% endif
|
||||||
}
|
}
|
||||||
% endfor ## END Subtypes
|
% endfor ## END Subtypes
|
||||||
|
|
Loading…
Add table
Reference in a new issue