Skip to content

Commit 453da53

Browse files
authored
gh-97588: remove unused functions in _ctypes/cfield.c (GH-124010)
1 parent ef530ce commit 453da53

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

Modules/_ctypes/cfield.c

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -45,32 +45,10 @@ class _ctypes.CField "PyObject *" "PyObject"
4545
[clinic start generated code]*/
4646
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=602817ea3ffc709c]*/
4747

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-
6848
static inline
6949
Py_ssize_t NUM_BITS(Py_ssize_t bitsize);
7050
static inline
7151
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);
7452

7553

7654
/*[clinic input]
@@ -405,20 +383,6 @@ Py_ssize_t NUM_BITS(Py_ssize_t bitsize) {
405383
return bitsize >> 16;
406384
}
407385

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-
422386
/* Doesn't work if NUM_BITS(size) == 0, but it never happens in SET() call. */
423387
#define BIT_MASK(type, size) (((((type)1 << (NUM_BITS(size) - 1)) - 1) << 1) + 1)
424388

0 commit comments

Comments
 (0)