fix compilation warnings in hook.c