From 8feff5bc76b6820909dc4122e7e553d2eedc4412 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Fri, 4 Mar 2016 10:03:39 -0700 Subject: [PATCH] Clean up some more warnings --- include/chaiscript/dispatchkit/boxed_number.hpp | 1 + samples/fun_call_performance.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/chaiscript/dispatchkit/boxed_number.hpp b/include/chaiscript/dispatchkit/boxed_number.hpp index e99fe87..8a784ec 100644 --- a/include/chaiscript/dispatchkit/boxed_number.hpp +++ b/include/chaiscript/dispatchkit/boxed_number.hpp @@ -49,6 +49,7 @@ namespace chaiscript #ifdef __GNUC__ #pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" #pragma GCC diagnostic ignored "-Wsign-compare" #pragma GCC diagnostic ignored "-Wfloat-equal" #pragma GCC diagnostic ignored "-Wconversion" diff --git a/samples/fun_call_performance.cpp b/samples/fun_call_performance.cpp index 0ccc08d..6b91fed 100644 --- a/samples/fun_call_performance.cpp +++ b/samples/fun_call_performance.cpp @@ -89,24 +89,24 @@ std::vector default_search_paths() std::vector buf(2048); ssize_t size = -1; - if ((size = readlink("/proc/self/exe", &buf.front(), buf.size())) != -1) + if ((size = readlink("/proc/self/exe", &buf.front(), buf.size())) > 0) { - exepath = std::string(&buf.front(), size); + exepath = std::string(&buf.front(), static_cast(size)); } if (exepath.empty()) { - if ((size = readlink("/proc/curproc/file", &buf.front(), buf.size())) != -1) + if ((size = readlink("/proc/curproc/file", &buf.front(), buf.size())) > 0) { - exepath = std::string(&buf.front(), size); + exepath = std::string(&buf.front(), static_cast(size)); } } if (exepath.empty()) { - if ((size = readlink("/proc/self/path/a.out", &buf.front(), buf.size())) != -1) + if ((size = readlink("/proc/self/path/a.out", &buf.front(), buf.size())) > 0) { - exepath = std::string(&buf.front(), size); + exepath = std::string(&buf.front(), static_cast(size)); } }