#
7a8d932b
|
| 27-Aug-2025 |
John Chung <john.chung@arm.com> |
msgbuf: Define a separate msgbuf structure for encode/decode function
Define separate msgbuf structures to avoid casting away const-qualifiers in the msgbuf constructor function:
* pldm_msgbuf_rw:
msgbuf: Define a separate msgbuf structure for encode/decode function
Define separate msgbuf structures to avoid casting away const-qualifiers in the msgbuf constructor function:
* pldm_msgbuf_rw: for encode functions with non const-qualified buffer * pldm_msgbuf_ro: for decode functions with const-qualified buffer
Further, use _Generic() to keep the API ergonomic while still yielding a compile error when wrong msgbuf type is passed.
Change-Id: I71dbcb7996e9fb402b49870fce539a939c1497e5 Signed-off-by: John Chung <john.chung@arm.com> Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|