Updated to remove most of the warnings in Visual Studio. (There's still the one about all control paths returning a value left.) Fixed one warning (when an istream converts to void * to then convert to bool), and disabled three.

This commit is contained in:
Jesse Beder 2010-03-03 05:30:06 +00:00
parent 6f40b09525
commit bca7737463
8 changed files with 17 additions and 4 deletions

View File

@ -13,6 +13,11 @@ if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_CXX_FLAGS "-O2 -Wall -Wextra -pedantic -Wno-long-long ${CMAKE_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "-O2 -Wall -Wextra -pedantic -Wno-long-long ${CMAKE_CXX_FLAGS}")
endif(CMAKE_COMPILER_IS_GNUCC) endif(CMAKE_COMPILER_IS_GNUCC)
if(MSVC)
set(LIB_TYPE) # I can't figure out how CMake handles Windows shared libraries
set(CMAKE_CXX_FLAGS "/W3 /wd4127 /wd4355 /D_SCL_SECURE_NO_WARNINGS ${CMAKE_CXX_FLAGS}")
endif(MSVC)
set(YAML_CPP_VERSION_MAJOR "0") set(YAML_CPP_VERSION_MAJOR "0")
set(YAML_CPP_VERSION_MINOR "2") set(YAML_CPP_VERSION_MINOR "2")
set(YAML_CPP_VERSION_PATCH "4") set(YAML_CPP_VERSION_PATCH "4")

View File

@ -23,7 +23,8 @@ namespace YAML
inline bool Convert(const std::string& input, T& output, typename enable_if<is_numeric<T> >::type * = 0) { inline bool Convert(const std::string& input, T& output, typename enable_if<is_numeric<T> >::type * = 0) {
std::stringstream stream(input); std::stringstream stream(input);
stream.unsetf(std::ios::dec); stream.unsetf(std::ios::dec);
return stream >> output; stream >> output;
return !!stream;
} }
} }

View File

@ -20,7 +20,7 @@ namespace YAML
class Content; class Content;
class Scanner; class Scanner;
class Emitter; class Emitter;
class ParserState; struct ParserState;
enum CONTENT_TYPE { CT_NONE, CT_SCALAR, CT_SEQUENCE, CT_MAP }; enum CONTENT_TYPE { CT_NONE, CT_SCALAR, CT_SEQUENCE, CT_MAP };

View File

@ -52,9 +52,10 @@ namespace YAML
int operator,(flag, flag); int operator,(flag, flag);
template<typename T> template<typename T>
void operator,(flag, T const&); char operator,(flag, T const&);
char operator,(int, flag); char operator,(int, flag);
int operator,(char, flag);
} }
template <typename T> template <typename T>

View File

@ -15,7 +15,7 @@
namespace YAML namespace YAML
{ {
class Scanner; class Scanner;
class ParserState; struct ParserState;
struct Token; struct Token;
class Parser: private noncopyable class Parser: private noncopyable

View File

@ -39,6 +39,7 @@
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalOptions="/D_SCL_SECURE_NO_WARNINGS"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="include" AdditionalIncludeDirectories="include"
MinimalRebuild="true" MinimalRebuild="true"
@ -46,6 +47,7 @@
RuntimeLibrary="3" RuntimeLibrary="3"
WarningLevel="3" WarningLevel="3"
DebugInformationFormat="4" DebugInformationFormat="4"
DisableSpecificWarnings="4127;4355"
/> />
<Tool <Tool
Name="VCManagedResourceCompilerTool" Name="VCManagedResourceCompilerTool"

View File

@ -39,6 +39,7 @@
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalOptions="/D_SCL_SECURE_NO_WARNINGS"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="include" AdditionalIncludeDirectories="include"
MinimalRebuild="true" MinimalRebuild="true"
@ -46,6 +47,7 @@
RuntimeLibrary="3" RuntimeLibrary="3"
WarningLevel="3" WarningLevel="3"
DebugInformationFormat="4" DebugInformationFormat="4"
DisableSpecificWarnings="4127;4355"
/> />
<Tool <Tool
Name="VCManagedResourceCompilerTool" Name="VCManagedResourceCompilerTool"

View File

@ -40,6 +40,7 @@
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalOptions="/D_SCL_SECURE_NO_WARNINGS"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="include" AdditionalIncludeDirectories="include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB" PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
@ -49,6 +50,7 @@
UsePrecompiledHeader="0" UsePrecompiledHeader="0"
WarningLevel="4" WarningLevel="4"
DebugInformationFormat="3" DebugInformationFormat="3"
DisableSpecificWarnings="4127;4355"
/> />
<Tool <Tool
Name="VCManagedResourceCompilerTool" Name="VCManagedResourceCompilerTool"