Commit 986d27e4 authored by Alexander Alekhin's avatar Alexander Alekhin

dnn: fix failed Torch tests

"Torch invalid argument 2: position must be smaller than LLONG_MAX"

These conditions are always true for "long position" argument.
parent 93091ba2
......@@ -175,13 +175,10 @@ static void THDiskFile_seek(THFile *self, long position)
THArgCheck(dfself->handle != NULL, 1, "attempt to use a closed file");
#if defined(_WIN64)
THArgCheck(position <= (_int64)INT64_MAX, 2, "position must be smaller than INT64_MAX");
if(_fseeki64(dfself->handle, (__int64)position, SEEK_SET) < 0)
#elif defined(_WIN32)
THArgCheck(position <= (long)LONG_MAX, 2, "position must be smaller than LONG_MAX");
if(fseek(dfself->handle, (long)position, SEEK_SET) < 0)
#else
THArgCheck(position <= (long)LLONG_MAX, 2, "position must be smaller than LLONG_MAX");
if(fseeko(dfself->handle, (off_t)position, SEEK_SET) < 0)
#endif
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment