I2PC / xmippCore

Core functions for Xmipp and sharing with other packages (like Scipion)
GNU General Public License v3.0
4 stars 2 forks source link

Fixing compilation warnings #174

Closed MartinSalinas98 closed 1 year ago

MartinSalinas98 commented 1 year ago

This warnings were about calls to free with offset, wich can cause unexpected behaviour since the free should be called pointing to the start of the array. This changes should not affect the proper behaviour of the code (if anything, it could fix it in some situations).

This might be needed to solve issues with Xmipp PR 764.

PS: How could we test if those changes work as intented?

MartinSalinas98 commented 1 year ago

Realising offsets were actually there for a reason (who would have thought), removing the compiler warning without actually compromising behaviour might need to be done differently.

MartinSalinas98 commented 1 year ago

The problem is caused by numerical_recipes.cpp declaring and working with every array starting at index 1 instead of the regular and beloved 0. The compilation warnings can be easily avoided without breaking functionality, but it does not solve the underlying massive structural change this ~10000 lines file needs. This would need a bigger refactor that presented here initially.




Why. Just why.

MartinSalinas98 commented 1 year ago

This PR needs to merge Xmipp's 765 first, it won't compile in the meantime because Xmipp uses a function removed in this PR, but linked PR changes that so it won't use it any more.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication