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

Fix warnings #41

Merged
merged 1 commit into from
Aug 18, 2016
Merged

Fix warnings #41

merged 1 commit into from
Aug 18, 2016

Conversation

iphydf
Copy link
Member

@iphydf iphydf commented Aug 17, 2016

This change is Reviewable

@iphydf iphydf force-pushed the fix-warnings branch 6 times, most recently from d522872 to fbd2087 Compare August 18, 2016 09:14
@iphydf iphydf force-pushed the fix-warnings branch 2 times, most recently from 698da3b to 71c0ecd Compare August 18, 2016 15:57
@tux3
Copy link
Member

tux3 commented Aug 18, 2016

Review status: 0 of 13 files reviewed at latest revision, 2 unresolved discussions.


auto_tests/dht_test.c, line 351 [r1] (raw file):

}

#if 0

Why is this code compiled-out?
If the #if 0 is only meant to be temporary, it would be good to have a comment explaining why this should not be removed but should not be run, so readers 10 years from now will not be left wondering :)
If it's entirely broken though, perhaps it belongs in the git history until a fix is available.

The same remark applies to other commented-out sections below.


testing/tox_shell.c, line 83 [r1] (raw file):

    if (ret == -1) {
        printf("fork failed\n");
        free(master);

Are you freeing on return from main to get a clean valgrind output?


Comments from Reviewable

@tux3
Copy link
Member

tux3 commented Aug 18, 2016

Reviewed 13 of 13 files at r1.
Review status: all files reviewed at latest revision, 2 unresolved discussions.


Comments from Reviewable

@iphydf
Copy link
Member Author

iphydf commented Aug 18, 2016

Review status: all files reviewed at latest revision, 2 unresolved discussions.


auto_tests/dht_test.c, line 351 [r1] (raw file):

Previously, tux3 (Tux3) wrote…

Why is this code compiled-out?
If the #if 0 is only meant to be temporary, it would be good to have a comment explaining why this should not be removed but should not be run, so readers 10 years from now will not be left wondering :)
If it's entirely broken though, perhaps it belongs in the git history until a fix is available.

The same remark applies to other commented-out sections below.

The `DEFTESTCASE` below was commented out already. This change just comments out the tests themselves as well to avoid confusion (i.e. why are these not called?).

testing/tox_shell.c, line 83 [r1] (raw file):

Previously, tux3 (Tux3) wrote…

Are you freeing on return from main to get a clean valgrind output?

Mostly to make the static analyser happy, but yeah, it'll also make valgrind happier :).

Comments from Reviewable

@tux3
Copy link
Member

tux3 commented Aug 18, 2016

Review status: all files reviewed at latest revision, 1 unresolved discussion.


auto_tests/dht_test.c, line 351 [r1] (raw file):

Previously, iphydf wrote…

The DEFTESTCASE below was commented out already. This change just comments out the tests themselves as well to avoid confusion (i.e. why are these not called?).

You're right, they were commented out already. In a spirit of continuous improvement, shouldn't they be removed if no one can explain why they are commented out and not deleted? Git will do what it does and keep a trace if anyone needs to revive dead code.

Comments from Reviewable

@iphydf
Copy link
Member Author

iphydf commented Aug 18, 2016

Review status: 12 of 13 files reviewed at latest revision, 1 unresolved discussion.


auto_tests/dht_test.c, line 351 [r1] (raw file):

Previously, tux3 (Tux3) wrote…

You're right, they were commented out already. In a spirit of continuous improvement, shouldn't they be removed if no one can explain why they are commented out and not deleted?
Git will do what it does and keep a trace if anyone needs to revive dead code.

I've added a comment and commented out the whole unused block. I'd like to keep the non-working tests around, so we can remember to fix them.

Comments from Reviewable

@tux3
Copy link
Member

tux3 commented Aug 18, 2016

Reviewed 1 of 1 files at r2.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@tux3
Copy link
Member

tux3 commented Aug 18, 2016

:lgtm:


Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@iphydf iphydf closed this Aug 18, 2016
@iphydf iphydf deleted the fix-warnings branch August 18, 2016 16:18
@iphydf iphydf merged commit 6935643 into TokTok:master Aug 18, 2016
@@ -382,7 +382,8 @@ int handle_rtp_packet (Messenger *m, uint32_t friendnumber, const uint8_t *data,
session->mp = new_message(ntohs(header->tlen) + sizeof(struct RTPHeader), data, length);

/* Reposition data if necessary */
if (ntohs(header->cpart));
if (ntohs(header->cpart))
;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this? This statement has no effect on anything.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is something that's been in toxav for some time. I had it fixed in a ToxAV branch I was working on, but I abandoned it before it got merged. That's the only reason it still exists, irungentoo and mannol were both aware, but waiting to merge this fix with my AV changes.

This pull request was closed.
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.

4 participants