Skip to content

Commit

Permalink
Fixes for ancient c89 Windows compilers. Sigh.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Feb 14, 2020
1 parent 39693b2 commit d4b3fdd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions BTrees/BTreeModuleTemplate.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ ulonglong_as_object(unsigned PY_LONG_LONG val)
static int
ulonglong_convert(PyObject *ob, unsigned PY_LONG_LONG *value)
{
unsigned PY_LONG_LONG val;

#ifndef PY3K
if (PyInt_Check(ob))
{
Expand All @@ -178,7 +180,6 @@ ulonglong_convert(PyObject *ob, unsigned PY_LONG_LONG *value)
return 0;
}

unsigned PY_LONG_LONG val;
val = PyLong_AsUnsignedLongLong(ob);
if (val == (unsigned long long)-1 && PyErr_Occurred())
return 0;
Expand All @@ -198,6 +199,8 @@ longlong_as_object(PY_LONG_LONG val)
static int
longlong_convert(PyObject *ob, PY_LONG_LONG *value)
{
PY_LONG_LONG val;
int overflow;
#ifndef PY3K
if (PyInt_Check(ob))
{
Expand All @@ -211,9 +214,6 @@ longlong_convert(PyObject *ob, PY_LONG_LONG *value)
PyErr_SetString(PyExc_TypeError, "expected integer key");
return 0;
}

PY_LONG_LONG val;
int overflow;
val = PyLong_AsLongLongAndOverflow(ob, &overflow);
if (!longlong_handle_overflow(val, overflow))
{
Expand Down

0 comments on commit d4b3fdd

Please sign in to comment.