fix ecc 64bit cast for systems where long is 32bits