fix some warnings

This commit is contained in:
Erwin Coumans
2016-02-29 15:37:03 -08:00
parent 25409f93c7
commit 4a70df2dfb
4 changed files with 19 additions and 14 deletions

View File

@@ -1,3 +1,4 @@
#ifdef _WIN32
/* /*
Copyright (c) 2012 Advanced Micro Devices, Inc. Copyright (c) 2012 Advanced Micro Devices, Inc.
@@ -179,4 +180,6 @@ int Win32OpenGLWindow::fileOpenDialog(char* fileName, int maxFileNameLength)
//return 0; //return 0;
} }
#endif

View File

@@ -1,3 +1,4 @@
#ifdef _WIN32
/* /*
Copyright (c) 2012 Advanced Micro Devices, Inc. Copyright (c) 2012 Advanced Micro Devices, Inc.
@@ -805,5 +806,5 @@ b3WheelCallback Win32Window::getWheelCallback()
{ {
return m_data->m_wheelCallback; return m_data->m_wheelCallback;
} }
#endif

View File

@@ -1,4 +1,4 @@
#ifdef _WIN32
#include "Gwen/Gwen.h" #include "Gwen/Gwen.h"
#include "Gwen/Controls/CrossSplitter.h" #include "Gwen/Controls/CrossSplitter.h"
#include "Gwen/Controls/Button.h" #include "Gwen/Controls/Button.h"
@@ -181,3 +181,4 @@ void CrossSplitter::UnZoom()
Invalidate(); Invalidate();
ZoomChanged(); ZoomChanged();
} }
#endif

View File

@@ -29,20 +29,20 @@ public:
for (int i = 1; i < argc; i++) for (int i = 1; i < argc; i++)
{ {
string arg = argv[i]; std::string arg = argv[i];
if ((arg[0] != '-') || (arg[1] != '-')) { if ((arg[0] != '-') || (arg[1] != '-')) {
continue; continue;
} }
string::size_type pos; std::string::size_type pos;
string key, val; std::string key, val;
if ((pos = arg.find( '=')) == string::npos) { if ((pos = arg.find( '=')) == std::string::npos) {
key = string(arg, 2, arg.length() - 2); key = std::string(arg, 2, arg.length() - 2);
val = ""; val = "";
} else { } else {
key = string(arg, 2, pos - 2); key = std::string(arg, 2, pos - 2);
val = string(arg, pos + 1, arg.length() - 1); val = std::string(arg, pos + 1, arg.length() - 1);
} }
//only add new keys, don't replace existing //only add new keys, don't replace existing
@@ -56,7 +56,7 @@ public:
bool CheckCmdLineFlag(const char* arg_name) bool CheckCmdLineFlag(const char* arg_name)
{ {
using namespace std; using namespace std;
map<string, string>::iterator itr; map<std::string, std::string>::iterator itr;
if ((itr = pairs.find(arg_name)) != pairs.end()) { if ((itr = pairs.find(arg_name)) != pairs.end()) {
return true; return true;
} }
@@ -76,7 +76,7 @@ template <typename T>
inline bool b3CommandLineArgs::GetCmdLineArgument(const char *arg_name, T &val) inline bool b3CommandLineArgs::GetCmdLineArgument(const char *arg_name, T &val)
{ {
using namespace std; using namespace std;
map<string, string>::iterator itr; map<std::string, std::string>::iterator itr;
if ((itr = pairs.find(arg_name)) != pairs.end()) { if ((itr = pairs.find(arg_name)) != pairs.end()) {
istringstream strstream(itr->second); istringstream strstream(itr->second);
strstream >> val; strstream >> val;
@@ -89,10 +89,10 @@ template <>
inline bool b3CommandLineArgs::GetCmdLineArgument<char*>(const char* arg_name, char* &val) inline bool b3CommandLineArgs::GetCmdLineArgument<char*>(const char* arg_name, char* &val)
{ {
using namespace std; using namespace std;
map<string, string>::iterator itr; map<std::string, std::string>::iterator itr;
if ((itr = pairs.find(arg_name)) != pairs.end()) { if ((itr = pairs.find(arg_name)) != pairs.end()) {
string s = itr->second; std::string s = itr->second;
val = (char*) malloc(sizeof(char) * (s.length() + 1)); val = (char*) malloc(sizeof(char) * (s.length() + 1));
std::strcpy(val, s.c_str()); std::strcpy(val, s.c_str());
return true; return true;