From 986d27e49c839fcdf622b8e424ae3122e018af3a Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Mon, 26 Jun 2017 19:27:05 +0300 Subject: [PATCH] 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. --- modules/dnn/src/torch/THDiskFile.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/dnn/src/torch/THDiskFile.cpp b/modules/dnn/src/torch/THDiskFile.cpp index c56b0f4899..25346a8711 100644 --- a/modules/dnn/src/torch/THDiskFile.cpp +++ b/modules/dnn/src/torch/THDiskFile.cpp @@ -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 {