| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -45,32 +45,10 @@ class _ctypes.CField "PyObject *" "PyObject" | |||
| 45 | 45 | [clinic start generated code]*/ | |
| 46 | 46 | /*[clinic end generated code: output=da39a3ee5e6b4b0d input=602817ea3ffc709c]*/ | |
| 47 | 47 | ||
| 48 | - static inline | ||
| 49 | - Py_ssize_t round_down(Py_ssize_t numToRound, Py_ssize_t multiple) | ||
| 50 | - { | ||
| 51 | - assert(numToRound >= 0); | ||
| 52 | - assert(multiple >= 0); | ||
| 53 | - if (multiple == 0) | ||
| 54 | - return numToRound; | ||
| 55 | - return (numToRound / multiple) * multiple; | ||
| 56 | - } | ||
| 57 | - | ||
| 58 | - static inline | ||
| 59 | - Py_ssize_t round_up(Py_ssize_t numToRound, Py_ssize_t multiple) | ||
| 60 | - { | ||
| 61 | - assert(numToRound >= 0); | ||
| 62 | - assert(multiple >= 0); | ||
| 63 | - if (multiple == 0) | ||
| 64 | - return numToRound; | ||
| 65 | - return ((numToRound + multiple - 1) / multiple) * multiple; | ||
| 66 | - } | ||
| 67 | - | ||
| 68 | 48 | static inline | |
| 69 | 49 | Py_ssize_t NUM_BITS(Py_ssize_t bitsize); | |
| 70 | 50 | static inline | |
| 71 | 51 | Py_ssize_t LOW_BIT(Py_ssize_t offset); | |
| 72 | - static inline | ||
| 73 | - Py_ssize_t BUILD_SIZE(Py_ssize_t bitsize, Py_ssize_t offset); | ||
| 74 | 52 | ||
| 75 | 53 | ||
| 76 | 54 | /*[clinic input] | |
@@ -405,20 +383,6 @@ Py_ssize_t NUM_BITS(Py_ssize_t bitsize) { | |||
| 405 | 383 | return bitsize >> 16; | |
| 406 | 384 | } | |
| 407 | 385 | ||
| 408 | - static inline | ||
| 409 | - Py_ssize_t BUILD_SIZE(Py_ssize_t bitsize, Py_ssize_t offset) { | ||
| 410 | - assert(0 <= offset); | ||
| 411 | - assert(offset <= 0xFFFF); | ||
| 412 | - // We don't support zero length bitfields. | ||
| 413 | - // And GET_BITFIELD uses NUM_BITS(size)==0, | ||
| 414 | - // to figure out whether we are handling a bitfield. | ||
| 415 | - assert(0 < bitsize); | ||
| 416 | - Py_ssize_t result = (bitsize << 16) + offset; | ||
| 417 | - assert(bitsize == NUM_BITS(result)); | ||
| 418 | - assert(offset == LOW_BIT(result)); | ||
| 419 | - return result; | ||
| 420 | - } | ||
| 421 | - | ||
| 422 | 386 | /* Doesn't work if NUM_BITS(size) == 0, but it never happens in SET() call. */ | |
| 423 | 387 | #define BIT_MASK(type, size) (((((type)1 << (NUM_BITS(size) - 1)) - 1) << 1) + 1) | |
| 424 | 388 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments