Use typed constants instead of enums

It should be more portable, as the sizeof(enum) is compiler dependent