From 288841f66c808af70ad7687f9704c87075129b18 Mon Sep 17 00:00:00 2001 From: Yong He Date: Sat, 4 Nov 2017 16:09:48 -0400 Subject: fixed all warnings --- tools/eval-test/main.cpp | 3 ++- tools/render-test/render-d3d11.cpp | 2 +- tools/render-test/render-gl.cpp | 6 ++++-- tools/slang-generate/main.cpp | 9 ++++++--- 4 files changed, 13 insertions(+), 7 deletions(-) (limited to 'tools') diff --git a/tools/eval-test/main.cpp b/tools/eval-test/main.cpp index 486de7bd9..0159f0107 100644 --- a/tools/eval-test/main.cpp +++ b/tools/eval-test/main.cpp @@ -16,7 +16,8 @@ int main( char const* inputPath = argv[1]; // Slurp in the input file, so that we can compile and run it - FILE* inputFile = fopen(inputPath, "rb"); + FILE* inputFile; + fopen_s(&inputFile, inputPath, "rb"); assert(inputFile); fseek(inputFile, 0, SEEK_END); diff --git a/tools/render-test/render-d3d11.cpp b/tools/render-test/render-d3d11.cpp index ee34445d0..a40e6e6e0 100644 --- a/tools/render-test/render-d3d11.cpp +++ b/tools/render-test/render-d3d11.cpp @@ -1088,7 +1088,7 @@ public: } else { - printf("invalid output type at %d.\n"); + printf("invalid output type at %d.\n", id); } } id++; diff --git a/tools/render-test/render-gl.cpp b/tools/render-test/render-gl.cpp index a853a53a4..f07e27985 100644 --- a/tools/render-test/render-gl.cpp +++ b/tools/render-test/render-gl.cpp @@ -8,6 +8,7 @@ #include #include #include "core/basic.h" +#include "core/secure-crt.h" #include "external/stb/stb_image_write.h" // TODO(tfoley): eventually we should be able to run these @@ -736,7 +737,7 @@ public: { glSamplerParameteri(rs.handle, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); glSamplerParameteri(rs.handle, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glSamplerParameteri(rs.handle, GL_TEXTURE_MAX_ANISOTROPY_EXT, 8.0f); + glSamplerParameteri(rs.handle, GL_TEXTURE_MAX_ANISOTROPY_EXT, 8); } else { @@ -802,7 +803,8 @@ public: virtual void serializeOutput(BindingState* state, const char * fileName) { GLBindingState * glState = (GLBindingState*)state; - FILE * f = fopen(fileName, "wt"); + FILE * f; + fopen_s(&f, fileName, "wt"); for (auto & entry : glState->entries) { if (entry.isOutput) diff --git a/tools/slang-generate/main.cpp b/tools/slang-generate/main.cpp index eef7d95c7..8208354e4 100644 --- a/tools/slang-generate/main.cpp +++ b/tools/slang-generate/main.cpp @@ -4,6 +4,7 @@ #include #include #include +#include "../../source/core/secure-crt.h" struct StringSpan { @@ -401,7 +402,8 @@ int main( // Read the contents o the file and translate it into a "template" file - FILE* inputStream = fopen(inputPath, "rb"); + FILE* inputStream; + fopen_s(&inputStream, inputPath, "rb"); fseek(inputStream, 0, SEEK_END); size_t inputSize = ftell(inputStream); fseek(inputStream, 0, SEEK_SET); @@ -415,9 +417,10 @@ int main( Node* node = readInput(input, inputEnd); char outputPath[1024]; - sprintf(outputPath, "%s.h", inputPath); + sprintf_s(outputPath, "%s.h", inputPath); - FILE* outputStream = fopen(outputPath, "w"); + FILE* outputStream; + fopen_s(&outputStream, outputPath, "w"); emitBody(outputStream, node); -- cgit v1.2.3 From 784bd914cface6e5837ef0da7aee0df2e16c4999 Mon Sep 17 00:00:00 2001 From: Yong He Date: Sat, 4 Nov 2017 16:30:18 -0400 Subject: fix linux build --- tools/eval-test/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/eval-test/main.cpp b/tools/eval-test/main.cpp index 0159f0107..6f1f7a4d8 100644 --- a/tools/eval-test/main.cpp +++ b/tools/eval-test/main.cpp @@ -3,7 +3,7 @@ #include #include #include - +#include "../../source/core/secure-crt.h" #include int main( -- cgit v1.2.3