7 jh refactor - #20
Conversation
wkearn
left a comment
There was a problem hiding this comment.
These changes look good, @jkhillier. There is one remaining unused variable warning that needs to be fixed:
src/swt.c: In function ‘wavInterpComb’:
src/swt.c:1282:9: error: variable ‘ratio’ set but not used [-Werror=unused-but-set-variable]
1282 | float ratio; /*ratio: outline length / Area */
| ^~~~~
The ratio variable is set on line 1418, but not used because you commented out the print statement that uses it. If you remove line 1418, you'll get rid of this warning, but you'll now get a warning that float ratio is unused, so you'll need to delete its declaration on line 1282.
I think the automated checks may not have run properly when you submitted the PR, but I have rerun them again, and this seems like the only error you need to resolve.
At first, I would have said that we should leave However, we currently save the wavelet object coefficients to a file ( So I think the next step is to change Lines 975 to 981 in 33ec447 You'll still need to save the coefficients to file because we do check that file in the tests. |
7_JH_refactor – Commit #1 - print and ptrdiff_t done in ReadData(). Commit #2 - wavInterpComb() print and ptrdiff_t done. Commit #3 – getlineJH() & Interpolate() changed to ptrdiff_t, PostProcess() removed prints. Commit #4 - PostProcess() Changed int to ptrdiff_t. No more changes needed to Interpolate. Commit #5 - quick_select() and tempInterp not used and removed.
• There are no more functions in wavelet that need checking out.
• fopen() is only in ReadData() - passes file pointer to getlineJH(), in wavInterpCombii() – passes pointer to getlineJH(). In wavelet() and
• fprintf() is in wavelet() only, which opens and closes 6 files.
• getlineJH() and ReadData(); these only read data – so I’m guessing they don’t need an ‘inner’ function. wavInterpCombii() – changed to have an inner function.
This only leaves wavelet() I think ….. how do you suggest I re-factor this, since it’s mainly single commands and fprintf()?