diff options
Diffstat (limited to 'sources/shiboken2/libshiboken/voidptr.cpp')
-rw-r--r-- | sources/shiboken2/libshiboken/voidptr.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sources/shiboken2/libshiboken/voidptr.cpp b/sources/shiboken2/libshiboken/voidptr.cpp index 1bba9b4f7..d4ce58c87 100644 --- a/sources/shiboken2/libshiboken/voidptr.cpp +++ b/sources/shiboken2/libshiboken/voidptr.cpp @@ -105,7 +105,7 @@ int SbkVoidPtrObject_init(PyObject *self, PyObject *args, PyObject *kwds) sbkSelf->cptr = bufferView.buf; sbkSelf->size = bufferView.len > 0 ? bufferView.len : size; - sbkSelf->isWritable = bufferView.readonly > 0 ? false : true; + sbkSelf->isWritable = bufferView.readonly <= 0; // Release the buffer. PyBuffer_Release(&bufferView); @@ -115,7 +115,7 @@ int SbkVoidPtrObject_init(PyObject *self, PyObject *args, PyObject *kwds) auto *sbkOther = reinterpret_cast<SbkObject *>(addressObject); sbkSelf->cptr = sbkOther->d->cptr[0]; sbkSelf->size = size; - sbkSelf->isWritable = isWritable > 0 ? true : false; + sbkSelf->isWritable = isWritable > 0; } // An integer representing an address. else { @@ -137,7 +137,7 @@ int SbkVoidPtrObject_init(PyObject *self, PyObject *args, PyObject *kwds) } sbkSelf->cptr = cptr; sbkSelf->size = size; - sbkSelf->isWritable = isWritable > 0 ? true : false; + sbkSelf->isWritable = isWritable > 0; } } |