+/* + * + * \params[in] ev The input event + * \params[in] cookie An allocated void* with exactly cookie_size bytes + * \params[in] size The size of the allocated void* + */ +void mir_input_event_copy_cookie(MirInputEvent const* ev, MirCookie* cookie, size_t size);
When comments and code disagree, both are likely wrong.
While I'm not sure I fully understand the intended usage I suspect that have two scenarios:
1. Getting a MirCookie from an event. 2. Converting a MirCookie to and from a chunk of memory.
In neither of these does it make sense for a user to supply allocate and supply a pointer to an incomplete type.
How about:
MirCookie* mir_input_event_get_cookie(MirInputEvent const* ev);
and either:
MirCookie* mir_blob_to_mir_cookie(MirBlob* blob); MirBlob* mir_blob_from_mir_cookie(MirCookie* cookie);
Or:
size_t mir_cookie_get_buffer_size(MirCookie* cookie); void mir_cookie_to_buffer(MirCookie* cookie, void* buffer, size_t size); MirCookie* mir_cookie_from_buffer(void const* buffer, size_t size);
« Back to merge proposal
+/* event_copy_ cookie( MirInputEvent const* ev, MirCookie* cookie, size_t size);
+ *
+ * \params[in] ev The input event
+ * \params[in] cookie An allocated void* with exactly cookie_size bytes
+ * \params[in] size The size of the allocated void*
+ */
+void mir_input_
When comments and code disagree, both are likely wrong.
While I'm not sure I fully understand the intended usage I suspect that have two scenarios:
1. Getting a MirCookie from an event.
2. Converting a MirCookie to and from a chunk of memory.
In neither of these does it make sense for a user to supply allocate and supply a pointer to an incomplete type.
How about:
MirCookie* mir_input_ event_get_ cookie( MirInputEvent const* ev);
and either:
MirCookie* mir_blob_ to_mir_ cookie( MirBlob* blob); from_mir_ cookie( MirCookie* cookie);
MirBlob* mir_blob_
Or:
size_t mir_cookie_ get_buffer_ size(MirCookie* cookie); to_buffer( MirCookie* cookie, void* buffer, size_t size); from_buffer( void const* buffer, size_t size);
void mir_cookie_
MirCookie* mir_cookie_