[c++] error: cast from 'void*' to 'int' loses precision