Browse Source

rocket: suppress build warnings

tags/nilmdb-2.0.1
Jim Paris 1 year ago
parent
commit
10400f2b07
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      nilmdb/server/rocket.c

+ 3
- 3
nilmdb/server/rocket.c View File

@@ -168,7 +168,7 @@ static int Rocket_init(Rocket *self, PyObject *args, PyObject *kwds)
if (!layout)
return -1;
if (path) {
if (strlen(path) != pathlen) {
if (strlen(path) != (size_t)pathlen) {
PyErr_SetString(PyExc_ValueError, "path must not "
"contain NUL characters");
return -1;
@@ -477,7 +477,7 @@ static PyObject *Rocket_append_binary(Rocket *self, PyObject *args)
}

/* Write binary data */
if (fwrite(data, self->binary_size, rows, self->file) != rows) {
if (fwrite(data, self->binary_size, rows, self->file) != (size_t)rows) {
PyErr_SetFromErrno(PyExc_OSError);
return NULL;
}
@@ -628,7 +628,7 @@ static PyObject *Rocket_extract_binary(Rocket *self, PyObject *args)

/* Data in the file is already in the desired little-endian
binary format, so just read it directly. */
if (fread(str, self->binary_size, count, self->file) != count) {
if (fread(str, self->binary_size, count, self->file) != (size_t)count) {
free(str);
PyErr_SetFromErrno(PyExc_OSError);
return NULL;


Loading…
Cancel
Save