Unsigned 1 and 2 byte sized formats shouldn't result in long integer values!
This commit is contained in:
parent
c94f16f156
commit
39ef2274a3
|
@ -694,7 +694,10 @@ bu_uint(p, f)
|
||||||
do {
|
do {
|
||||||
x = (x<<8) | (*p++ & 0xFF);
|
x = (x<<8) | (*p++ & 0xFF);
|
||||||
} while (--i > 0);
|
} while (--i > 0);
|
||||||
return PyLong_FromUnsignedLong(x);
|
if (f->size >= 4)
|
||||||
|
return PyLong_FromUnsignedLong(x);
|
||||||
|
else
|
||||||
|
return PyInt_FromLong((long)x);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
|
@ -825,7 +828,10 @@ lu_uint(p, f)
|
||||||
do {
|
do {
|
||||||
x = (x<<8) | (p[--i] & 0xFF);
|
x = (x<<8) | (p[--i] & 0xFF);
|
||||||
} while (i > 0);
|
} while (i > 0);
|
||||||
return PyLong_FromUnsignedLong(x);
|
if (f->size >= 4)
|
||||||
|
return PyLong_FromUnsignedLong(x);
|
||||||
|
else
|
||||||
|
return PyInt_FromLong((long)x);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
|
|
Loading…
Reference in New Issue