| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Fix sign conversion in pycore_code.h: use unsigned integers and cast explicitly when needed.
| static inline uint16_t | ||
| adaptive_counter_backoff(uint16_t counter) { | ||
| unsigned int backoff = counter & ((1<<ADAPTIVE_BACKOFF_BITS)-1); | ||
| uint16_t backoff = counter & ((1 << ADAPTIVE_BACKOFF_BITS) - 1); |
There was a problem hiding this comment.
Is there difference between 1 << ADAPTIVE_BACKOFF_BITS and 1u << ADAPTIVE_BACKOFF_BITS?
Sorry, something went wrong.
There was a problem hiding this comment.
I hesitated to replace 1 with 1U. With proposed code, there is no warning. With 1U I got additional warnings 🤷🏻♂️ Maybe because "unsigned int" is larger than uint16_t. I don't know rules of implicit cast in C.
Sorry, something went wrong.
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, something went wrong.
|
GH-112696 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
Fix sign conversion in pycore_code.h: use unsigned integers and cast explicitly when needed. (cherry picked from commit a74902a) Co-authored-by: Victor Stinner <vstinner@python.org>
|
Merged, thanks for the review Serhiy. |
Sorry, something went wrong.
Fix sign conversion in pycore_code.h: use unsigned integers and cast explicitly when needed.
Fix sign conversion in pycore_code.h: use unsigned integers and cast explicitly when needed.
| Back | FazBrowse Home | New Git URL |
Fix sign conversion in pycore_code.h: use unsigned integers and cast explicitly when needed.