Changes the cn_cbor_context macros to use const#50
Changes the cn_cbor_context macros to use const#50bergzand wants to merge 1 commit intocabo:masterfrom bergzand:pr/context_const
Conversation
|
I am not clear what you are trying to do with this. I would need to remove the const by caching in my allocation and free functions. The cn_cbor_context is just a part of the structure I used for doing allocations. |
By changing the macro here I'm changing how the cn_cbor* cn_cbor_map_create(cn_cbor_context *context, cn_cbor_errback *errp)to: cn_cbor* cn_cbor_map_create(const cn_cbor_context *context, cn_cbor_errback *errp)The idea here is to indicate to the compiler that the passed
I'm not clear what the problem is you're trying to explain here. Is it possible for you to link a small example where my modification breaks code? This code should not prevent you from modifying the |
|
ping @cabo. |
|
@cabo ping |
The
cn_cbor_contextstruct itself should not be modified by the calls that use the context struct. With this in mind thecn_cbor_contextstruct pointer should be passed asconstto the functions using it.