Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Apr 14, 2024

Conversation

iphydf
Copy link
Contributor

@iphydf iphydf commented Apr 5, 2024

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.

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
Copy link
Owner

camgunz commented Apr 14, 2024

Ha did I really not prefix those, yeesh!

@camgunz camgunz merged commit a630c55 into camgunz:master Apr 14, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants