-
Notifications
You must be signed in to change notification settings - Fork 617
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
Fix gcc-11 warnings: signed/unsigned integer comparison, unused variables #1463
Fix gcc-11 warnings: signed/unsigned integer comparison, unused variables #1463
Conversation
…ables Signed-off-by: Cary Phillips <cary@ilm.com>
@kdt3rd, @meshula, @peterhillman, @lgritz, these seem fairly benign, but I'd still like some other eyes on it, can someone look it over? |
for (int i = 0; i < 65536; ++i) | ||
{ | ||
unsigned short src = (unsigned short) i; | ||
assert (src == OPENEXR_IMF_INTERNAL_NAMESPACE::dwaCompressorNoOp[i]); | ||
assert ((unsigned short) i == OPENEXR_IMF_INTERNAL_NAMESPACE::dwaCompressorNoOp[i]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably just make the loop
for (unsigned short i = 0; ...)
then there's no casting at all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think failable_free was meant to be assigned ~ could we try that? Hopefully it doesn't introduce a new error.
@@ -53,12 +53,12 @@ failable_malloc (size_t bytes) | |||
return malloc (bytes); | |||
} | |||
|
|||
static void | |||
failable_free (void* p) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
down below we assign failable_alloc within cinit.
I'm pretty sure the intent was failable_free be correspondingly assigned within cinit as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding the assignment to free_fn
:
static exr_context_t
createDummyFile (const char* test)
{
exr_context_t f = NULL;
exr_context_initializer_t cinit = EXR_DEFAULT_CONTEXT_INITIALIZER;
// we won't actually write to this and so don't need a proper
// stream but need a writable context to test with.
cinit.write_fn = dummy_write;
cinit.alloc_fn = failable_malloc;
cinit.free_fn = failable_free;
causes OpenEXRCore.testAttrChlists
and OpenEXRCore.testAttrLists
to fail, so something needs some further attention. I'll leave the free function in for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, can we add
// adding failable_malloc currently causes OpenEXRCore.testAttrChlists and OpenEXRCore.testAttrLists to fail.
// commented out until we've investigated.
//cinit.free_fn = failable_free;
With that I think we're good to land this
Signed-off-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
…bles (AcademySoftwareFoundation#1463) * Fix gcc-11 warnings: signed/unsigned integer comparision, unused variables Signed-off-by: Cary Phillips <cary@ilm.com> * declare loop variable i as unsigned int Signed-off-by: Cary Phillips <cary@ilm.com> * uncomment-out failable_free Signed-off-by: Cary Phillips <cary@ilm.com> * add commented-out assignment of failable_free as TODO Signed-off-by: Cary Phillips <cary@ilm.com> --------- Signed-off-by: Cary Phillips <cary@ilm.com>
…bles (#1463) * Fix gcc-11 warnings: signed/unsigned integer comparision, unused variables Signed-off-by: Cary Phillips <cary@ilm.com> * declare loop variable i as unsigned int Signed-off-by: Cary Phillips <cary@ilm.com> * uncomment-out failable_free Signed-off-by: Cary Phillips <cary@ilm.com> * add commented-out assignment of failable_free as TODO Signed-off-by: Cary Phillips <cary@ilm.com> --------- Signed-off-by: Cary Phillips <cary@ilm.com>
No description provided.