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

GH1383: Add casts to ERR_PACK #1385

Closed
wants to merge 2 commits into from
Closed

GH1383: Add casts to ERR_PACK #1385

wants to merge 2 commits into from

Conversation

richsalz
Copy link
Contributor

@richsalz richsalz commented Aug 3, 2016

And update script to not re-introduce whitespace glitch.

(((unsigned int)(l) & 0x0FF) << 24L) | \
(((unsigned int)(f) & 0xFFF) << 12L) | \
(((unsigned int)(r) & 0xFFF) ) )
# define ERR_GET_LIB(l) (int)((((unsigned long)l) >> 24L) & 0x0FFL)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might as well cast these to unsigned int as well for consistency. Does ERR_GET_REASON also need a cast then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean liens 140,141,142? If so yes, that makes sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming I got it right, I pushed an additional commit. Please take a look?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Um, I meant unifying all casts on the input to silence the warnings:

a) unsigned long -> unsigned int; and
b) a cast on the input of ERR_GET_REASON, similarly to the others.

We shouldn't change the return type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doh! Fixed. Revised commit pushed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I looked at the docs meanwhile - ERR_PACK is documented to take in ints, so these three casts are needed. But the ERR_GET_ flavours take an unsigned long so actually I think these input casts should simply be removed.

(Sorry for making you go around in circles.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No prob. I like getting dizzy :) updated commit pushed.

@ekasper
Copy link
Contributor

ekasper commented Aug 8, 2016

+1 but see comment

Rich Salz added 2 commits August 8, 2016 10:40
And update script to not re-introduce whitespace glitch.
@richsalz richsalz closed this Aug 8, 2016
@richsalz richsalz deleted the gh1383 branch August 8, 2016 17:08
levitte pushed a commit that referenced this pull request Aug 10, 2016
Reviewed-by: Emilia Käsper <emilia@openssl.org>
(Merged from #1385
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

Successfully merging this pull request may close these issues.

None yet

3 participants