summaryrefslogtreecommitdiffstats
path: root/programs
diff options
context:
space:
mode:
Diffstat (limited to 'programs')
-rw-r--r--programs/bench.c8
-rw-r--r--programs/lz4io.c13
2 files changed, 19 insertions, 2 deletions
diff --git a/programs/bench.c b/programs/bench.c
index f077b42..01e610c 100644
--- a/programs/bench.c
+++ b/programs/bench.c
@@ -24,6 +24,14 @@
*/
+/*-************************************
+* Compiler options
+**************************************/
+#ifdef _MSC_VER /* Visual Studio */
+# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */
+#endif
+
+
/* *************************************
* Includes
***************************************/
diff --git a/programs/lz4io.c b/programs/lz4io.c
index 36498b2..3d69a6e 100644
--- a/programs/lz4io.c
+++ b/programs/lz4io.c
@@ -31,10 +31,17 @@
*/
+/*-************************************
+* Compiler options
+**************************************/
+#ifdef _MSC_VER /* Visual Studio */
+# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */
+#endif
#if defined(__MINGW32__) && !defined(_POSIX_SOURCE)
# define _POSIX_SOURCE 1 /* disable %llu warnings with MinGW on Windows */
#endif
+
/*****************************
* Includes
*****************************/
@@ -644,8 +651,10 @@ static unsigned LZ4IO_fwriteSparse(FILE* file, const void* buffer, size_t buffer
storedSkips += (unsigned)(nb0T * sizeT);
if (nb0T != seg0SizeT) { /* not all 0s */
- int const seekResult = fseek(file, storedSkips, SEEK_CUR);
- if (seekResult) EXM_THROW(72, "Sparse skip error ; try --no-sparse");
+ errno = 0;
+ { int const seekResult = fseek(file, storedSkips, SEEK_CUR);
+ if (seekResult) EXM_THROW(72, "Sparse skip error(%d): %s ; try --no-sparse", (int)errno, strerror(errno));
+ }
storedSkips = 0;
seg0SizeT -= nb0T;
ptrT += nb0T;