projects
/
platform
/
upstream
/
SPIRV-Tools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
033b7d0
)
Avoid integer modulo by 1, to avoid warning
author
David Neto
<dneto@google.com>
Mon, 15 Aug 2016 15:27:13 +0000
(11:27 -0400)
committer
David Neto
<dneto@google.com>
Mon, 15 Aug 2016 15:27:13 +0000
(11:27 -0400)
Fixes https://github.com/KhronosGroup/SPIRV-Tools/issues/349
tools/io.h
patch
|
blob
|
history
diff --git
a/tools/io.h
b/tools/io.h
index
a6f6c47
..
cd92227
100644
(file)
--- a/
tools/io.h
+++ b/
tools/io.h
@@
-50,7
+50,7
@@
bool ReadFile(const char* filename, const char* mode, std::vector<T>* 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;
}