Skip to content

Commit

Permalink
remove duplicate definition of inline, this is already handled in pyt…
Browse files Browse the repository at this point in the history
…honcapi_compat.h, which we always include before bitarray.h
  • Loading branch information
ilanschnell committed Jul 5, 2021
1 parent 92dad74 commit dbd5874
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions bitarray/bitarray.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,10 @@ typedef struct {
#define BITMASK(endian, i) \
(((char) 1) << ((endian) == ENDIAN_LITTLE ? ((i) % 8) : (7 - (i) % 8)))

#ifdef _MSC_VER
#define INLINE __inline
#else
#define INLINE inline
#endif

/* ------------ low level access to bits in bitarrayobject ------------- */

#ifndef NDEBUG
static INLINE int GETBIT(bitarrayobject *self, Py_ssize_t i)
static inline int GETBIT(bitarrayobject *self, Py_ssize_t i)
{
assert(0 <= i && i < self->nbits);
return ((self)->ob_item[(i) / 8] & BITMASK((self)->endian, i) ? 1 : 0);
Expand All @@ -66,7 +60,7 @@ static INLINE int GETBIT(bitarrayobject *self, Py_ssize_t i)
((self)->ob_item[(i) / 8] & BITMASK((self)->endian, i) ? 1 : 0)
#endif

static INLINE void
static inline void
setbit(bitarrayobject *self, Py_ssize_t i, int bit)
{
char *cp, mask;
Expand All @@ -82,7 +76,7 @@ setbit(bitarrayobject *self, Py_ssize_t i, int bit)

/* sets unused padding bits (within last byte of buffer) to 0,
and return the number of padding bits -- self->nbits is unchanged */
static INLINE int
static inline int
setunused(bitarrayobject *self)
{
const char mask[16] = {
Expand Down Expand Up @@ -116,7 +110,7 @@ static const unsigned char bitcount_lookup[256] = {

/* Interpret a PyObject (usually PyLong or PyBool) as a bit, return 0 or 1.
On error, return -1 and set error message. */
static INLINE int
static inline int
pybit_as_int(PyObject *v)
{
Py_ssize_t x;
Expand Down

0 comments on commit dbd5874

Please sign in to comment.