use intptr_t to cast pointers to int in codecs maintained by benjamin larsson