https://github.com/python/cpython/commit/453da532fee26dc4f83d4cab77eb9bdb17b941e6
commit: 453da532fee26dc4f83d4cab77eb9bdb17b941e6
branch: main
author: Irit Katriel <[email protected]>
committer: encukou <[email protected]>
date: 2024-09-16T14:13:18+02:00
summary:

gh-97588: remove unused functions in _ctypes/cfield.c (GH-124010)

files:
M Modules/_ctypes/cfield.c

diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c
index abcab6557de914..53a946e750b866 100644
--- a/Modules/_ctypes/cfield.c
+++ b/Modules/_ctypes/cfield.c
@@ -45,32 +45,10 @@ class _ctypes.CField "PyObject *" "PyObject"
 [clinic start generated code]*/
 /*[clinic end generated code: output=da39a3ee5e6b4b0d input=602817ea3ffc709c]*/
 
-static inline
-Py_ssize_t round_down(Py_ssize_t numToRound, Py_ssize_t multiple)
-{
-    assert(numToRound >= 0);
-    assert(multiple >= 0);
-    if (multiple == 0)
-        return numToRound;
-    return (numToRound / multiple) * multiple;
-}
-
-static inline
-Py_ssize_t round_up(Py_ssize_t numToRound, Py_ssize_t multiple)
-{
-    assert(numToRound >= 0);
-    assert(multiple >= 0);
-    if (multiple == 0)
-        return numToRound;
-    return ((numToRound + multiple - 1) / multiple) * multiple;
-}
-
 static inline
 Py_ssize_t NUM_BITS(Py_ssize_t bitsize);
 static inline
 Py_ssize_t LOW_BIT(Py_ssize_t offset);
-static inline
-Py_ssize_t BUILD_SIZE(Py_ssize_t bitsize, Py_ssize_t offset);
 
 
 /*[clinic input]
@@ -405,20 +383,6 @@ Py_ssize_t NUM_BITS(Py_ssize_t bitsize) {
     return bitsize >> 16;
 }
 
-static inline
-Py_ssize_t BUILD_SIZE(Py_ssize_t bitsize, Py_ssize_t offset) {
-    assert(0 <= offset);
-    assert(offset <= 0xFFFF);
-    // We don't support zero length bitfields.
-    // And GET_BITFIELD uses NUM_BITS(size)==0,
-    // to figure out whether we are handling a bitfield.
-    assert(0 < bitsize);
-    Py_ssize_t result = (bitsize << 16) + offset;
-    assert(bitsize == NUM_BITS(result));
-    assert(offset == LOW_BIT(result));
-    return result;
-}
-
 /* Doesn't work if NUM_BITS(size) == 0, but it never happens in SET() call. */
 #define BIT_MASK(type, size) (((((type)1 << (NUM_BITS(size) - 1)) - 1) << 1) + 
1)
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to