]> arthur.barton.de Git - bup.git/commitdiff
Fix more gcc type punning errors introduced by the metadata changes.
authorAvery Pennarun <apenwarr@gmail.com>
Fri, 11 Mar 2011 04:03:06 +0000 (20:03 -0800)
committerAvery Pennarun <apenwarr@gmail.com>
Fri, 11 Mar 2011 04:03:06 +0000 (20:03 -0800)
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 <apenwarr@gmail.com>
lib/bup/_helpers.c

index 790830074245bb7e54c906244df5abf63fda9a1d..9409b387539976d6059252948385065efb359f32 100644 (file)
@@ -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);