From: David Neto Date: Mon, 15 Aug 2016 15:27:13 +0000 (-0400) Subject: Avoid integer modulo by 1, to avoid warning X-Git-Tag: upstream/2018.6~1119 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4dd4c14b80e478eb7f38e6f731c0b3b1fbc73abd;p=platform%2Fupstream%2FSPIRV-Tools.git Avoid integer modulo by 1, to avoid warning Fixes https://github.com/KhronosGroup/SPIRV-Tools/issues/349 --- 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; }