adapt to firm coding conventions, avoid warnings by using INT_TO_PTR and PTR_TO_INT