summaryrefslogtreecommitdiffstats
path: root/Objects/bytesobject.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-12-04 08:27:47 (GMT)
committerChristian Heimes <christian@cheimes.de>2013-12-04 08:27:47 (GMT)
commitd3afe781b15e47784273bbb82da6122bf7be999e (patch)
tree27d82efd6f047cc0d39076cb1cd20b872a6adc1c /Objects/bytesobject.c
parent47f02e5e176c87d498601657ccc43bdf92cd9edf (diff)
downloadcpython-d3afe781b15e47784273bbb82da6122bf7be999e.zip
cpython-d3afe781b15e47784273bbb82da6122bf7be999e.tar.gz
cpython-d3afe781b15e47784273bbb82da6122bf7be999e.tar.bz2
Silence expression result unused warnings with clang.
The PyObject_INIT() macros returns obj: ../cpython/Objects/methodobject.c:32:23: warning: expression result unused [-Wunused-value] PyObject_INIT(op, &PyCFunction_Type); ^~ ../cpython/Include/objimpl.h:139:69: note: expanded from macro 'PyObject_INIT' ( Py_TYPE(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op) ) ^ 1 warning generated.
Diffstat (limited to 'Objects/bytesobject.c')
-rw-r--r--Objects/bytesobject.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index 8217b1e..63c67f8 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -107,7 +107,7 @@ PyBytes_FromStringAndSize(const char *str, Py_ssize_t size)
op = (PyBytesObject *)PyObject_MALLOC(PyBytesObject_SIZE + size);
if (op == NULL)
return PyErr_NoMemory();
- PyObject_INIT_VAR(op, &PyBytes_Type, size);
+ (void)PyObject_INIT_VAR(op, &PyBytes_Type, size);
op->ob_shash = -1;
if (str != NULL)
Py_MEMCPY(op->ob_sval, str, size);
@@ -155,7 +155,7 @@ PyBytes_FromString(const char *str)
op = (PyBytesObject *)PyObject_MALLOC(PyBytesObject_SIZE + size);
if (op == NULL)
return PyErr_NoMemory();
- PyObject_INIT_VAR(op, &PyBytes_Type, size);
+ (void)PyObject_INIT_VAR(op, &PyBytes_Type, size);
op->ob_shash = -1;
Py_MEMCPY(op->ob_sval, str, size+1);
/* share short strings */
@@ -749,7 +749,7 @@ bytes_repeat(PyBytesObject *a, Py_ssize_t n)
op = (PyBytesObject *)PyObject_MALLOC(PyBytesObject_SIZE + nbytes);
if (op == NULL)
return PyErr_NoMemory();
- PyObject_INIT_VAR(op, &PyBytes_Type, size);
+ (void)PyObject_INIT_VAR(op, &PyBytes_Type, size);
op->ob_shash = -1;
op->ob_sval[size] = '\0';
if (Py_SIZE(a) == 1 && n > 0) {