Renamed more forgotten variables during interface conversions

(related: b9c8f57)
Most renames are trivial (just to avoid shadowing global variables, even
if they currently did no harm), but there were some cases of partly
renamed variables that caused some NULL checks to always pass and who
knows what could have been happened when they were too subtle to make
the application crash.

Also corrected some potentially unsafe macro definitions

Signed-off-by: Haru <haru@dotalux.com>