include: Fix pointer casting and add check_expected_ptr()

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
5 files changed