-
Notifications
You must be signed in to change notification settings - Fork 292
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
Made save format platform-independent #281
Conversation
See [https://github.com/TokTok/c-toxcore/pull/281](#281) for PR with save format update.
Review status: 0 of 2 files reviewed at latest revision, 3 unresolved discussions, some commit checks failed. toxcore/Messenger.c, line 2654 at r1 (raw file):
You could instead copy/paste the exact COPY_VALUE/COPY_ARRAY sequence and define them as adding sizeof to a toxcore/Messenger.c, line 2723 at r1 (raw file):
This is now wrong. toxcore/Messenger.c, line 2808 at r1 (raw file):
Add initialiser: Comments from Reviewable |
Reviewed 2 of 2 files at r1. Comments from Reviewable |
Review status: 1 of 2 files reviewed at latest revision, 3 unresolved discussions. toxcore/Messenger.c, line 2654 at r1 (raw file):
|
Reviewed 1 of 1 files at r2. toxcore/Messenger.c, line 2654 at r2 (raw file):
toxcore/Messenger.c, line 2657 at r2 (raw file):
Also, I'd suggest putting these on one line, given they are so trivial. toxcore/Messenger.c, line 2680 at r2 (raw file):
Remove spaces at end of lines. Perhaps set up your editor to not do this. Comments from Reviewable |
Review status: 1 of 2 files reviewed at latest revision, 6 unresolved discussions. toxcore/Messenger.c, line 2654 at r2 (raw file):
|
But, since I wrote about half of this, others should sign off as well. Reviewed 1 of 1 files at r3. Comments from Reviewable |
Reviewed 1 of 2 files at r1, 1 of 1 files at r3. toxcore/Messenger.c, line 2656 at r3 (raw file):
These two defines don't appear to be copying anything. Need better names. toxcore/Messenger.c, line 2802 at r3 (raw file):
You should assign friend_size() to a variable so you don't have to call it numerous times in the same function. Comments from Reviewable |
Review status: 1 of 2 files reviewed at latest revision, 8 unresolved discussions. toxcore/Messenger.c, line 2656 at r3 (raw file):
|
Review status: 1 of 2 files reviewed at latest revision, 6 unresolved discussions, some commit checks failed. toxcore/Messenger.c, line 2659 at r4 (raw file):
This is no longer true now. Please make it true again. toxcore/Messenger.c, line 2802 at r4 (raw file):
You can't reuse the name. Same in haskell: Comments from Reviewable |
Reviewed 1 of 1 files at r4. Comments from Reviewable |
Review status: 1 of 2 files reviewed at latest revision, 6 unresolved discussions. toxcore/Messenger.c, line 2659 at r4 (raw file):
|
This coul be avoided if we memcpy'ed the struct members into a file, instead of memcpy'ing the struct itself. Remember to never memcpy a struct in real code. @robinlinden why was the Reviewed 1 of 1 files at r3. Comments from Reviewable |
What could be avoided? The test was modified to put the network test last. All other tests in tox_one_test are hermetic and don't rely on networking to work. Review status: 1 of 2 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. Comments from Reviewable |
84f09dd
to
a3992c3
Compare
a3992c3
to
7282ebc
Compare
The alignment issue this Pr fixes. It exists because toxcore was made to memcpy the struct into the savedata array as it is, instead of memcpy'ing its members. This could be avoided if we memcpy'ed the struct members into the savedata, instead of memcpy'ing the struct itself. Obviously, we can't redo this now, as it would break all existing savedata files and we better use some json/msgpack format if we are going to break it. So the takeaway form this is to remember to never memcpy a struct in real code.
Ok. Reviewed 1 of 2 files at r1, 1 of 1 files at r5. Comments from Reviewable |
I didn't verify that this wont eat existing save files. Reviewed 1 of 2 files at r1, 1 of 1 files at r5. toxcore/Messenger.c, line 2656 at r3 (raw file): Previously, robinlinden (Robin Lindén) wrote…> Done.Comments from Reviewable |
7282ebc
to
6e1a01b
Compare
See [https://github.com/TokTok/c-toxcore/pull/281](#281) for PR with save format update. (cherry picked from commit 089c0e1)
Fixes #215.
This change is