refactor: Give enum-from-int functions the ability to report errors.#2475
Conversation
6d4bfc2 to
49ee322
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #2475 +/- ##
==========================================
- Coverage 69.90% 69.90% -0.01%
==========================================
Files 75 75
Lines 25964 25999 +35
==========================================
+ Hits 18150 18174 +24
- Misses 7814 7825 +11 ☔ View full report in Codecov by Sentry. |
0f545bd to
a8e35fe
Compare
These functions are a bit clearer and don't need to change if enum values change. See TokTok/hs-tokstyle#212 for the relevant linter implementation.
a8e35fe to
4e603bb
Compare
JFreegman
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 1 approvals obtained (waiting on @iphydf)
toxcore/group_chats.c line 1283 at r3 (raw file):
len_processed += sizeof(uint8_t); group_voice_state_from_int(voice_state, &shared_state->voice_state);
since these functions return bool do we want to log failures?
toxcore/Messenger.c line 785 at r3 (raw file):
default: { *out = USERSTATUS_INVALID;
I'm not 100% sure this should be the default. Maybe just setting it to NONE would prevent cascading failures?
JFreegman
left a comment
There was a problem hiding this comment.
Reviewed 5 of 7 files at r2, 12 of 12 files at r3, all commit messages.
Reviewable status:complete! 1 of 1 approvals obtained (waiting on @iphydf)
enum-from-int rule from tokstyle.enum-from-int functions the ability to report errors.
These functions are a bit clearer and don't need to change if enum values change.
See TokTok/hs-tokstyle#212 for the relevant linter implementation.
This change is