Skip to content

Commit

Permalink
xdrgen: typedefs should use the built-in string and opaque functions
Browse files Browse the repository at this point in the history
'typedef opaque yada<XYZ>' should use xdrgen's built-in opaque
encoder and decoder, to enable better compiler optimization.

Signed-off-by: Chuck Lever <[email protected]>
  • Loading branch information
chucklever committed Sep 20, 2024
1 parent 663ad8b commit fed8a17
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ xdrgen_decode_{{ name }}(struct xdr_stream *xdr, {{ classifier }}{{ name }} *ptr
{% if annotate %}
/* (variable-length opaque) */
{% endif %}
return xdr_stream_decode_opaque(xdr, ptr->data, ptr->len) >= 0;
return xdrgen_decode_opaque(xdr, ptr, {{ maxsize }});
};
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ xdrgen_decode_{{ name }}(struct xdr_stream *xdr, {{ classifier }}{{ name }} *ptr
{% if annotate %}
/* (variable-length string) */
{% endif %}
return xdr_stream_decode_opaque(xdr, ptr->data, ptr->len) >= 0;
return xdrgen_decode_string(xdr, ptr, {{ maxsize }});
};

0 comments on commit fed8a17

Please sign in to comment.