-
Notifications
You must be signed in to change notification settings - Fork 287
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
Make toxcore code C++ compatible. #143
Conversation
Reviewed 45 of 45 files at r1. auto_tests/dht_test.c, line 531 at r1 (raw file):
Why is other/bootstrap_daemon/src/config.c, line 367 at r1 (raw file):
Any specific reason for moving the definition site (and losing toxcore/list.c, line 116 at r1 (raw file):
The pointer could be toxcore/Messenger.c, line 2532 at r1 (raw file):
It's strange for toxcore/TCP_connection.c, line 41 at r1 (raw file):
This can overflow, and such a macro would actually be a nice place to catch it. toxcore/tox.c, line 845 at r1 (raw file):
If the convention is to return an invalid enum value, I think there should be a macro defined for it (rather than risk pandemonium once another enum value gets added). toxcore/tox.c, line 1352 at r1 (raw file):
Is moving the code from Comments from Reviewable |
1792be7
to
fd668f0
Compare
I removed reviewable, so I'm going to reply in here:
|
@@ -985,24 +985,24 @@ static unsigned int ping_node_from_getnodes_ok(DHT *dht, const uint8_t *public_k | |||
for (i = 0; i < dht->num_friends; ++i) { | |||
bool store_ok = 0; | |||
|
|||
DHT_Friend *friend = &dht->friends_list[i]; | |||
DHT_Friend *dht_friend = &dht->friends_list[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was that rename really necessary? Might make it harder to merge iru's new
branch later on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nurupo Yes, friend
is a C++ keyword.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, yes. Friend in the context of DHT is problematic.
Breaking merges or otherwise this is a positive change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@iphydf OK for me, I will open issues for the out-of-scope comments |
It is still C code, so still compatible with C compilers as well. This change lets us see more clearly where implicit conversions occur by making them explicit.
It is still C code, so still compatible with C compilers as well. This
change lets us see more clearly where implicit conversions occur by
making them explicit.
This change is NOT reviewable. Use Github reviews instead.
This change is