From 4dd4c14b80e478eb7f38e6f731c0b3b1fbc73abd Mon Sep 17 00:00:00 2001 From: David Neto Date: Mon, 15 Aug 2016 11:27:13 -0400 Subject: [PATCH] Avoid integer modulo by 1, to avoid warning Fixes https://github.com/KhronosGroup/SPIRV-Tools/issues/349 --- tools/io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/io.h b/tools/io.h index a6f6c47..cd92227 100644 --- a/tools/io.h +++ b/tools/io.h @@ -50,7 +50,7 @@ bool ReadFile(const char* filename, const char* mode, std::vector* data) { return false; } } else { - if (ftell(fp) % sizeof(T)) { + if (sizeof(T) != 1 && (ftell(fp) % sizeof(T))) { fprintf(stderr, "error: corrupted word found in file '%s'\n", filename); return false; } -- 2.7.4