Looks ok
On Tue, May 21, 2019 at 7:18 PM Nir Soffer <nirsof@gmail.com> wrote:Fix these warnings, seen in python 3 builds on Travis:
sanlock.c:1002:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (res->lver == -1) {
^
sanlock.c:1118:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (res->lver == -1) {
Signed-off-by: Nir Soffer <nsoffer@redhat.com>
---
python/sanlock.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/python/sanlock.c b/python/sanlock.c
index b412b6a..5d228e8 100644
--- a/python/sanlock.c
+++ b/python/sanlock.c
@@ -997,11 +997,11 @@ py_acquire(PyObject *self __unused, PyObject *args, PyObject *keywds)
/* prepare the resource version */
if (version != Py_None) {
res->flags |= SANLK_RES_LVER;
res->lver = pyinteger_as_unsigned_long_long_mask(version);
- if (res->lver == -1) {
+ if (res->lver == (uint64_t)-1) {
__set_exception(EINVAL, "Unable to convert the version value");
goto exit_fail;
}
}
@@ -1113,11 +1113,11 @@ py_request(PyObject *self __unused, PyObject *args, PyObject *keywds)
if (version == Py_None) {
flags = SANLK_REQUEST_NEXT_LVER;
} else {
res->flags |= SANLK_RES_LVER;
res->lver = pyinteger_as_unsigned_long_long_mask(version);
- if (res->lver == -1) {
+ if (res->lver == (uint64_t)-1) {
__set_exception(EINVAL, "Unable to convert the version value");
goto exit_fail;
}
}
--
2.17.2