From abab1d44bb0d6fc1064176f4b62135c11e43bb24 Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Fri, 28 Apr 2006 05:28:54 +0000 Subject: Fix a warning on ppc (debian) --- Python/structmember.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Python/structmember.c b/Python/structmember.c index 0a24d9d..54eb055 100644 --- a/Python/structmember.c +++ b/Python/structmember.c @@ -260,8 +260,9 @@ PyMember_SetOne(char *addr, PyMemberDef *l, PyObject *v) PyErr_BadArgument(); return -1; } else { - *(PY_LONG_LONG*)addr = PyLong_AsLongLong(v); - if ((*addr == -1) && PyErr_Occurred()) { + PY_LONG_LONG value; + *(PY_LONG_LONG*)addr = value = PyLong_AsLongLong(v); + if ((value == -1) && PyErr_Occurred()) { return -1; } } @@ -271,8 +272,10 @@ PyMember_SetOne(char *addr, PyMemberDef *l, PyObject *v) PyErr_BadArgument(); return -1; } else { - *(unsigned PY_LONG_LONG*)addr = PyLong_AsUnsignedLongLong(v); - if ((*addr == -1) && PyErr_Occurred()) { + unsigned PY_LONG_LONG value; + *(unsigned PY_LONG_LONG*)addr = value = PyLong_AsUnsignedLongLong(v); + if ((value == (unsigned PY_LONG_LONG)-1) && + PyErr_Occurred()) { return -1; } } -- cgit v0.12