-
Notifications
You must be signed in to change notification settings - Fork 325
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
(deque.c): inline function upper_pow_two only valid for 32 bit size_t #146
Comments
@flyxi121 |
After looking through the
But afterwards the variable
|
Yep, that's also a bug. It should be:
Again, thanks for eyeballing the code. These things are near impossible to catch with tests. :) |
Hi, I just looked through my open issues and came across this one. Should I open a quick PR to fix both things and to close the issue? |
@fhilgers |
In the
common.h
header file,MAX_POW_TWO
is defined like this:This macro is for example used in the function,
static size_t upper_pow_two (size_t)
, of thedeque.c
file. It either returnsMAX_POW_TWO
or the given argument rounded up to the next higher power of two.As far as I am aware, those bit manipulations:
used to round the argument to the next power are only valid up to 32-bit, not 64-bit . Is this by design or by accident?
The text was updated successfully, but these errors were encountered: