On 02/16/2015 04:27 PM, Jakub Hrozek wrote:
On Thu, Jan 22, 2015 at 01:45:59PM +0100, Pavel Březina wrote:
> Attached is a patch without macros...
>
>
Awesome, this is really good. One last question before I ack:
Do you think the sbus_get_invoker_fn() typedef could use
a new typedef that expands to:
void (*handler_fn)(struct sbus_request *, void *, void *);
instead of the void* function pointer? I suppose that would make the
code more type-safe..
I really like to see all the cruft going away :-)
No, its not doable unfortunately.
Basic types, such as strings, integers, ... uses the following parameters:
void (*handler_fn)(struct sbus_request *, void *, void *)
but array types uses:
void (*handler_fn)(struct sbus_request *, void *, void *, int *)
So we can't really specify precise type unless we want to have also
different invoker types which would result in more code branching.