Closed Green-Sky closed 3 months ago
Attention: Patch coverage is 0%
with 2 lines
in your changes are missing coverage. Please review.
Project coverage is 72.99%. Comparing base (
b03b571
) to head (2457125
).
Files | Patch % | Lines |
---|---|---|
toxcore/tox_api.c | 0.00% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
we should pin enums with values. now this PR changes the actual int value of the enum, doesnt it? it changes from 8 to 5. and a bunch of others also change with it
@iphydf @Green-Sky can't we do something like this (at least of all public enums in tox.h and toxav.h) :
typedef enum Tox_Err_Group_Send_Private_Message {
TOX_ERR_GROUP_SEND_PRIVATE_MESSAGE_OK = 0,
TOX_ERR_GROUP_SEND_PRIVATE_MESSAGE_GROUP_NOT_FOUND = 1,
TOX_ERR_GROUP_SEND_PRIVATE_MESSAGE_PEER_NOT_FOUND = 2,
TOX_ERR_GROUP_SEND_PRIVATE_MESSAGE_TOO_LONG = 3,
TOX_ERR_GROUP_SEND_PRIVATE_MESSAGE_EMPTY = 4,
TOX_ERR_GROUP_SEND_PRIVATE_MESSAGE_BAD_TYPE = 5,
TOX_ERR_GROUP_SEND_PRIVATE_MESSAGE_PERMISSIONS = 6,
TOX_ERR_GROUP_SEND_PRIVATE_MESSAGE_FAIL_SEND = 7,
TOX_ERR_GROUP_SEND_PRIVATE_MESSAGE_DISCONNECTED = 8
} Tox_Err_Group_Send_Private_Message;
then we can reorder how we like. with OK always must be (zero) "0" is there a downside to that?
Enums can't be removed or reordered without breaking API or ABI, correct. This is why we're doing it now, before the release. What would be improved by pinning the numbers?
other question is, what would be worse? with pinning the numbers will be fixed, even when we would delete an entry in the enum. now you can't delete an entry without having to break things (unless its the last entry)
With numbers, you can't delete members either, because each name is part of the API.
This change is