We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I was just looking over some code and ran across this in SourceDestBufferImpl.cpp:
void SourceDestBufferImpl::setNextInt64( int64_t value ) { ... case E57_BOOL: *reinterpret_cast<bool *>( p ) = ( value ? false : true ); break; ...
This also happens in:
template <typename T> void SourceDestBufferImpl::_setNextReal( T inValue )
and
void SourceDestBufferImpl::setNextInt64( int64_t value, double scale, double offset )
These ternaries seem backwards... If value is non-zero, I would expect the bool to be true.
value
true
I'm surprised we don't see bugs pop up but I suppose it's possible this code never runs.
I'm hesitant to change it without tests in place, but I would appreciate another set of eyes to look at it!
(These could probably just be rewritten using static_cast anyways.)
static_cast
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I was just looking over some code and ran across this in SourceDestBufferImpl.cpp:
This also happens in:
and
These ternaries seem backwards... If
value
is non-zero, I would expect the bool to betrue
.I'm surprised we don't see bugs pop up but I suppose it's possible this code never runs.
I'm hesitant to change it without tests in place, but I would appreciate another set of eyes to look at it!
(These could probably just be rewritten using
static_cast
anyways.)The text was updated successfully, but these errors were encountered: