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

Questionable detection of 8-bit-packed mode from MRC headers #458

Closed
jcbollinger opened this issue Apr 10, 2020 · 4 comments
Closed

Questionable detection of 8-bit-packed mode from MRC headers #458

jcbollinger opened this issue Apr 10, 2020 · 4 comments

Comments

@jcbollinger
Copy link
Contributor

Having recently engaged in the exercise of building the EMAN2 2.3 release from source, I had the opportunity to analyze compiler warnings to look for any that indicated genuine problems. There was a lot of noise, but a little signal, all of which appears still to apply to the current head. I'll be splitting that into four separate issues, of which this is the first.


libEM/mrcio.cpp:206-207 is this:

		is_8_bit_packed = (mrch.mode == MRC_UHEX       ||
							   (mrch.imod_flags & 16) == 1  ||  double_nx);

But the condition (mrch.imod_flags & 16) == 1 never evaluates to true, because anything & 16 always evaluates to either 0 or 16. From code analysis alone, I suspect that (mrch.imod_flags & 16) != 0 would be consistent with the intention, but I am not sufficiently familiar with the details of the MRC format to confirm that.

@sludtke42
Copy link
Member

sludtke42 commented Apr 10, 2020 via email

@sludtke42
Copy link
Member

Resolved on master (not pushed yet)

@jcbollinger
Copy link
Contributor Author

jcbollinger commented Apr 10, 2020 via email

@sludtke42
Copy link
Member

sludtke42 commented Apr 10, 2020 via email

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

No branches or pull requests

2 participants