aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoey-lunarg <joey@lunarg.com>2016-11-14 15:20:43 -0700
committerjoey-lunarg <joey@lunarg.com>2016-11-15 10:58:47 -0700
commit38a7269400a832ff12cbd4fbec00c91ae2afe468 (patch)
treedc014221420cf4043308776de4c1717fad7be33e
parent0e52ea6371179dfa8854ecbf6460fea2bd3b0f5b (diff)
downloadusermoji-38a7269400a832ff12cbd4fbec00c91ae2afe468.tar.xz
demos: Fix compiler warning in smoketest
Replaced snprintf with stringstream.
-rw-r--r--demos/smoke/Game.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/demos/smoke/Game.cpp b/demos/smoke/Game.cpp
index 656d910f..5affc086 100644
--- a/demos/smoke/Game.cpp
+++ b/demos/smoke/Game.cpp
@@ -14,24 +14,20 @@
* limitations under the License.
*/
+#include <sstream>
+
#include "Game.h"
#include "Shell.h"
-#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) || \
- defined MINGW_HAS_SECURE_API
-#include <basetsd.h>
-#define snprintf sprintf_s
-#endif
-
void Game::print_stats() {
// Output frame count and measured elapsed time
auto now = std::chrono::system_clock::now();
auto elapsed = now - start_time;
auto elapsed_millis =
std::chrono::duration_cast<std::chrono::milliseconds>(elapsed).count();
- char msg[256];
- snprintf(msg, 255, "frames:%d, elapsedms:%ld", frame_count, elapsed_millis);
- shell_->log(Shell::LogPriority::LOG_INFO, msg);
+ std::stringstream ss;
+ ss << "frames:" << frame_count << ", elapsedms:" << elapsed_millis;
+ shell_->log(Shell::LogPriority::LOG_INFO, ss.str().c_str());
}
void Game::quit() {