Couldn't find a neat way to make the container_of macro const agnostic, so
just have a const and non-const version. Silences a bunch of -Wcast-qual
warnings so that real problems are easier to spot.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Not sure where I was getting the macro from before, but fix compilation of
pmove.c by defining offsetof when it's not already defined. Must have been
getting it from a system header previously...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Introduce a new macro "container_of" to convert a member point to a point to
the containing struct with relative type saftey. Stolen from Linux. I'd rather
this was in a different header to "qtypes.h", but that's the best place for it
at the moment, without creating a new header.
Replace the cvar_for_completion macro and add helper functions stree_entry and
completion_entry to remove the rb_entry macro. This ends up looking a bit
neater.
Signed-off-by: Tyrann <tyrann@disenchant.net>