On Mon, Mar 25, 2024 at 8:50 PM Robin Jarry <rja...@redhat.com> wrote: > > Jerin Jacob, Mar 25, 2024 at 12:35: > > Another option could be to have a helper inline function/macro to take > > care of casting to make app code clean of casting. > > Would something like this be suitable? > > #define RTE_NODE_CTX_PTR1(n) ((void **)(n)->ctx)[0] > #define RTE_NODE_CTX_PTR2(n) ((void **)(n)->ctx)[1]
Works for me. No strong opinion about the name, RTE_NODE_CTX_AS_PTR1 may be more reflecting the intent. >