Skip to content

Commit

Permalink
Use int instead of char for flag variables
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesjer committed Jul 9, 2024
1 parent 3e4564a commit 12a25b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/gmpy2_convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ GMPy_RemoveIgnoredASCII(PyObject *s)
static int
mpz_set_PyStr(mpz_t z, PyObject *s, int base)
{
char *cp, negative = 0;
char *cp;
int negative = 0;
PyObject *ascii_str;

ascii_str = GMPy_RemoveIgnoredASCII(s);
Expand Down
8 changes: 4 additions & 4 deletions src/gmpy2_mpz_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1869,8 +1869,8 @@ GMPy_MPZ_Method_To_Bytes(PyObject *self, PyObject *const *args,
Py_ssize_t i, nkws = 0, size, gap, length = 1;
PyObject *bytes, *arg;
mpz_t tmp, *px = &MPZ(self);
char *buffer, sign, is_signed = 0, is_negative, is_big;
int argidx[2] = {-1, -1};
char *buffer;
int sign, is_signed = 0, is_negative, is_big, argidx[2] = {-1, -1};
const char *byteorder = NULL, *kwname;

if (nargs > 2) {
Expand Down Expand Up @@ -2023,8 +2023,8 @@ GMPy_MPZ_Method_From_Bytes(PyTypeObject *type, PyObject *const *args, Py_ssize_t
{
Py_ssize_t i, nkws = 0, length;
PyObject *arg, *bytes;
char is_signed = 0, endian, *buffer;
int argidx[2] = {-1, -1};
char *buffer;
int is_signed = 0, endian, argidx[2] = {-1, -1};
const char *byteorder = NULL, *kwname;
mpz_t tmp;
MPZ_Object *result;
Expand Down

0 comments on commit 12a25b9

Please sign in to comment.