Skip to content

Commit 035c772

Browse files
committed
address review: bitsize (naming)
1 parent fb505db commit 035c772

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Python/marshal.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -248,14 +248,14 @@ w_short_pstring(const void *s, Py_ssize_t n, WFILE *p)
248248
static PyObject *
249249
_PyMarshal_WriteObjectToString(PyObject *x, int version, int allow_code);
250250

251-
#define _r_digits(bs) \
251+
#define _r_digits(bitsize) \
252252
static void \
253-
_r_digits##bs(const uint##bs##_t *digits, Py_ssize_t n, uint8_t negative, \
254-
Py_ssize_t marshal_ratio, WFILE *p) \
253+
_r_digits##bitsize(const uint ## bitsize ## _t *digits, Py_ssize_t n, \
254+
uint8_t negative, Py_ssize_t marshal_ratio, WFILE *p) \
255255
{ \
256256
/* set l to number of base PyLong_MARSHAL_BASE digits */ \
257257
Py_ssize_t l = (n - 1)*marshal_ratio; \
258-
uint##bs##_t d = digits[n - 1]; \
258+
uint ## bitsize ## _t d = digits[n - 1]; \
259259
\
260260
assert(d != 0); /* a PyLong is always normalized */ \
261261
do { \
@@ -927,13 +927,13 @@ r_long64(RFILE *p)
927927
1 /* signed */);
928928
}
929929

930-
#define _w_digits(bs) \
930+
#define _w_digits(bitsize) \
931931
static int \
932-
_w_digits##bs(uint##bs##_t *digits, Py_ssize_t size, \
933-
Py_ssize_t marshal_ratio, \
934-
int shorts_in_top_digit, RFILE *p) \
932+
_w_digits##bitsize(uint ## bitsize ## _t *digits, Py_ssize_t size, \
933+
Py_ssize_t marshal_ratio, \
934+
int shorts_in_top_digit, RFILE *p) \
935935
{ \
936-
uint##bs##_t d; \
936+
uint ## bitsize ## _t d; \
937937
\
938938
for (Py_ssize_t i = 0; i < size - 1; i++) { \
939939
d = 0; \
@@ -942,7 +942,7 @@ _w_digits##bs(uint##bs##_t *digits, Py_ssize_t size, \
942942
if (md < 0 || md > PyLong_MARSHAL_BASE) { \
943943
goto bad_digit; \
944944
} \
945-
d += (uint##bs##_t)md << j*PyLong_MARSHAL_SHIFT; \
945+
d += (uint ## bitsize ## _t)md << j*PyLong_MARSHAL_SHIFT; \
946946
} \
947947
digits[i] = d; \
948948
} \
@@ -959,7 +959,7 @@ _w_digits##bs(uint##bs##_t *digits, Py_ssize_t size, \
959959
"bad marshal data (unnormalized long data)"); \
960960
return -1; \
961961
} \
962-
d += (uint##bs##_t)md << j*PyLong_MARSHAL_SHIFT; \
962+
d += (uint ## bitsize ## _t)md << j*PyLong_MARSHAL_SHIFT; \
963963
} \
964964
assert(!PyErr_Occurred()); \
965965
/* top digit should be nonzero, else the resulting PyLong won't be \

0 commit comments

Comments
 (0)