table: Replace macros by inline functions, to improve type safety.