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

[IMPROVEMENT] Remove freep warning #1180

Merged
merged 1 commit into from Jan 13, 2020
Merged

[IMPROVEMENT] Remove freep warning #1180

merged 1 commit into from Jan 13, 2020

Conversation

@NilsIrl
Copy link
Contributor

NilsIrl commented Jan 13, 2020

In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.

My familiarity with the project is as follows (check one):

  • I have used CCExtractor just a couple of times.

Change freep into a macro to remove all the warnings it generated.

@cfsmp3

This comment has been minimized.

Copy link
Contributor

cfsmp3 commented Jan 13, 2020

Hold on, this must be completely breaking things - if you don't pass a pointer to the pointer you want to free then you can't change the pointer value from inside freep() which is the whole point of it in the first place!

char *hello = (char *) malloc (10)
freep (&hello);
assert (hello == NULL);

That's going to fail if you pass "hello" instead of "&hello", because freep() won't be able to change the value of the outside variable.

[ EDIT: I see you're actually replacing free() with a #define , that could actually work ]

@NilsIrl

This comment has been minimized.

Copy link
Contributor Author

NilsIrl commented Jan 13, 2020

Or we could pass a void * to freep and then cast in there.

@cfsmp3 cfsmp3 self-requested a review Jan 13, 2020
@cfsmp3 cfsmp3 merged commit 7824904 into CCExtractor:master Jan 13, 2020
2 of 4 checks passed
2 of 4 checks passed
CI - linux Running tests
Details
CI - windows Tests queued
Details
WIP Ready for review
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@cfsmp3

This comment has been minimized.

Copy link
Contributor

cfsmp3 commented Jan 13, 2020

@NilsIrl

This comment has been minimized.

Copy link
Contributor Author

NilsIrl commented Jan 13, 2020

I don't want to cast to void * in 30 places.

187 to be exact 😂

@NilsIrl NilsIrl deleted the NilsIrl:warning_2 branch Jan 13, 2020
@ccextractor-bot

This comment has been minimized.

Copy link
Collaborator

ccextractor-bot commented Jan 13, 2020

CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results:

Report Name Tests Passed
Broken 0/13
DVB 0/7
DVR-MS 0/2
General 0/27
Hauppage 0/3
MP4 0/3
NoCC 0/10
Teletext 0/21
WTV 0/13
XDS 0/34
CEA-708 0/14
DVD 0/3
Options 0/86

It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you).

Your PR breaks these cases:


Check the result page for more info.
NilsIrl added a commit to NilsIrl/ccextractor that referenced this pull request Jan 13, 2020
cfsmp3 added a commit that referenced this pull request Jan 13, 2020
This reverts commit 7824904.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.