camgunz / cmp

An implementation of the MessagePack serialization format in C / msgpack.org[C]
http://msgpack.org
MIT License
340 stars 78 forks source link

cleanup: Use `switch` for error enum instead of string array. #74

Closed iphydf closed 7 months ago

iphydf commented 7 months ago

The switch will cause compiler warnings when missing enumerators. The array as it was written will produce NULL for missing errors (no out of bounds, because of the MAX + 1 size).

Also, prefixed the errors with CMP_ERROR_ to namespace all the enumerators into the cmp_error_t enum namespace.

camgunz commented 7 months ago

Ha did I really not prefix those, yeesh!