From: Avery Pennarun Date: Fri, 11 Mar 2011 04:03:06 +0000 (-0800) Subject: Fix more gcc type punning errors introduced by the metadata changes. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=704a672741345514bd5245eee3e6a54382cd48c9;p=packages%2Fb%2Fbup.git Fix more gcc type punning errors introduced by the metadata changes. Whatever, let's use 0 and 1 instead of Py_True and Py_False. _helpers.c: In function ‘bup_set_linux_file_attr’: _helpers.c:683: warning: dereferencing type-punned pointer will break strict-aliasing rules _helpers.c:683: warning: dereferencing type-punned pointer will break strict-aliasing rules _helpers.c: In function ‘bup_utimensat’: _helpers.c:758: warning: dereferencing type-punned pointer will break strict-aliasing rules _helpers.c:758: warning: dereferencing type-punned pointer will break strict-aliasing rules _helpers.c: In function ‘init_helpers’: _helpers.c:940: warning: dereferencing type-punned pointer will break strict-aliasing rules _helpers.c:941: warning: dereferencing type-punned pointer will break strict-aliasing rules error: command 'gcc' failed with exit status 1 Signed-off-by: Avery Pennarun --- diff --git a/lib/bup/_helpers.c b/lib/bup/_helpers.c index 7908300..9409b38 100644 --- a/lib/bup/_helpers.c +++ b/lib/bup/_helpers.c @@ -680,7 +680,7 @@ static PyObject *bup_set_linux_file_attr(PyObject *self, PyObject *args) } close(fd); - Py_RETURN_TRUE; + return Py_BuildValue("i", 1); } #endif /* def linux */ @@ -755,7 +755,7 @@ static PyObject *bup_utimensat(PyObject *self, PyObject *args) if (rc != 0) return PyErr_SetFromErrnoWithFilename(PyExc_IOError, path); - Py_RETURN_TRUE; + return Py_BuildValue("i", 1); } #endif /* defined(_ATFILE_SOURCE) @@ -937,11 +937,9 @@ PyMODINIT_FUNC init_helpers(void) Py_BuildValue("i", AT_SYMLINK_NOFOLLOW)); #endif #ifdef HAVE_BUP_STAT - Py_INCREF(Py_True); - PyModule_AddObject(m, "_have_ns_fs_timestamps", Py_True); + PyModule_AddIntConstant(m, "_have_ns_fs_timestamps", 1); #else - Py_INCREF(Py_False); - PyModule_AddObject(m, "_have_ns_fs_timestamps", Py_False); + PyModule_AddIntConstant(m, "_have_ns_fs_timestamps", 0); #endif e = getenv("BUP_FORCE_TTY"); istty2 = isatty(2) || (atoi(e ? e : "0") & 2);