Eliminate unnecessary get_wrapped_(u)long defines in struct module.
This commit is contained in:
parent
4b9d473d0a
commit
716a9ccd3d
|
@ -213,9 +213,6 @@ get_ulonglong(PyObject *v, unsigned PY_LONG_LONG *p)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define get_wrapped_long get_long
|
|
||||||
#define get_wrapped_ulong get_ulong
|
|
||||||
|
|
||||||
/* Floating point helpers */
|
/* Floating point helpers */
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
|
@ -525,7 +522,7 @@ np_uint(char *p, PyObject *v, const formatdef *f)
|
||||||
{
|
{
|
||||||
unsigned long x;
|
unsigned long x;
|
||||||
unsigned int y;
|
unsigned int y;
|
||||||
if (get_wrapped_ulong(v, &x) < 0)
|
if (get_ulong(v, &x) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
y = (unsigned int)x;
|
y = (unsigned int)x;
|
||||||
#if (SIZEOF_LONG > SIZEOF_INT)
|
#if (SIZEOF_LONG > SIZEOF_INT)
|
||||||
|
@ -550,7 +547,7 @@ static int
|
||||||
np_ulong(char *p, PyObject *v, const formatdef *f)
|
np_ulong(char *p, PyObject *v, const formatdef *f)
|
||||||
{
|
{
|
||||||
unsigned long x;
|
unsigned long x;
|
||||||
if (get_wrapped_ulong(v, &x) < 0)
|
if (get_ulong(v, &x) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
memcpy(p, (char *)&x, sizeof x);
|
memcpy(p, (char *)&x, sizeof x);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -757,7 +754,7 @@ bp_int(char *p, PyObject *v, const formatdef *f)
|
||||||
{
|
{
|
||||||
long x;
|
long x;
|
||||||
Py_ssize_t i;
|
Py_ssize_t i;
|
||||||
if (get_wrapped_long(v, &x) < 0)
|
if (get_long(v, &x) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
i = f->size;
|
i = f->size;
|
||||||
if (i != SIZEOF_LONG) {
|
if (i != SIZEOF_LONG) {
|
||||||
|
@ -780,7 +777,7 @@ bp_uint(char *p, PyObject *v, const formatdef *f)
|
||||||
{
|
{
|
||||||
unsigned long x;
|
unsigned long x;
|
||||||
Py_ssize_t i;
|
Py_ssize_t i;
|
||||||
if (get_wrapped_ulong(v, &x) < 0)
|
if (get_ulong(v, &x) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
i = f->size;
|
i = f->size;
|
||||||
if (i != SIZEOF_LONG) {
|
if (i != SIZEOF_LONG) {
|
||||||
|
@ -975,7 +972,7 @@ lp_int(char *p, PyObject *v, const formatdef *f)
|
||||||
{
|
{
|
||||||
long x;
|
long x;
|
||||||
Py_ssize_t i;
|
Py_ssize_t i;
|
||||||
if (get_wrapped_long(v, &x) < 0)
|
if (get_long(v, &x) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
i = f->size;
|
i = f->size;
|
||||||
if (i != SIZEOF_LONG) {
|
if (i != SIZEOF_LONG) {
|
||||||
|
@ -998,7 +995,7 @@ lp_uint(char *p, PyObject *v, const formatdef *f)
|
||||||
{
|
{
|
||||||
unsigned long x;
|
unsigned long x;
|
||||||
Py_ssize_t i;
|
Py_ssize_t i;
|
||||||
if (get_wrapped_ulong(v, &x) < 0)
|
if (get_ulong(v, &x) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
i = f->size;
|
i = f->size;
|
||||||
if (i != SIZEOF_LONG) {
|
if (i != SIZEOF_LONG) {
|
||||||
|
|
Loading…
Reference in New Issue