Skip to content

Commit

Permalink
Use npy_ftell and npy_fseek
Browse files Browse the repository at this point in the history
  • Loading branch information
cgohlke committed Jul 13, 2012
1 parent 7a060fe commit 2ee97d6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions numpy/core/include/numpy/npy_3kcompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ npy_PyFile_Dup(PyObject *file, char *mode)
fclose(handle);
return NULL;
}
fseek(handle, pos, SEEK_SET);
npy_fseek(handle, pos, SEEK_SET);
return handle;
}

Expand All @@ -215,11 +215,11 @@ static NPY_INLINE int
npy_PyFile_DupClose(PyObject *file, FILE* handle)
{
PyObject *ret;
long position;
position = ftell(handle);
Py_ssize_t position;
position = npy_ftell(handle);
fclose(handle);

ret = PyObject_CallMethod(file, "seek", "li", position, 0);
ret = PyObject_CallMethod(file, "seek", NPY_SSIZE_T_PYFMT "i", position, 0);
if (ret == NULL) {
return -1;
}
Expand Down

0 comments on commit 2ee97d6

Please sign in to comment.