summaryrefslogtreecommitdiffstats
path: root/Python/structmember.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-04-28 05:28:54 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-04-28 05:28:54 (GMT)
commitabab1d44bb0d6fc1064176f4b62135c11e43bb24 (patch)
tree0f7ec4fd428562f155df395e0b3802e08d339801 /Python/structmember.c
parent237bf40746acc28df28070ff7a1dc81c127eb0f6 (diff)
downloadcpython-abab1d44bb0d6fc1064176f4b62135c11e43bb24.zip
cpython-abab1d44bb0d6fc1064176f4b62135c11e43bb24.tar.gz
cpython-abab1d44bb0d6fc1064176f4b62135c11e43bb24.tar.bz2
Fix a warning on ppc (debian)
Diffstat (limited to 'Python/structmember.c')
-rw-r--r--Python/structmember.c11
1 files 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;
}
}