fix clang warnings, update build script

This commit is contained in:
Thomas Fussell 2014-07-29 18:01:54 -04:00
parent 92eec8ede8
commit ec1d9f7ecb
7 changed files with 29 additions and 82 deletions

View File

@ -12,67 +12,44 @@ project "xlnt.test"
kind "ConsoleApp"
language "C++"
targetname "xlnt.test"
targetdir "../bin"
includedirs {
"../include",
"../third-party/pugixml/src",
"../third-party/miniz",
"../third-party/cxxtest"
}
files {
"../tests/*.hpp",
"../tests/runner-autogen.cpp"
}
links {
"pugixml",
"xlnt"
}
links { "xlnt" }
prebuildcommands { "../../third-party/cxxtest/bin/cxxtestgen --runner=ErrorPrinter -o ../../tests/runner-autogen.cpp ../../tests/*.hpp" }
flags {
"Unicode",
"NoEditAndContinue",
"NoManifest",
"NoPCH"
}
configuration "Debug"
targetdir "../bin"
flags { "Unicode" }
configuration "Release"
flags { "LinkTimeOptimization" }
targetdir "../bin"
configuration "windows"
defines { "WIN32" }
links { "Shlwapi" }
postbuildcommands { "..\\..\\bin\\xlnt.test" }
configuration "not windows"
postbuildcommands { "../../bin/xlnt.test" }
buildoptions {
"-std=c++11",
"-Wno-unknown-pragmas"
}
configuration { "not windows", "Debug" }
buildoptions { "-ggdb" }
project "xlnt"
kind "StaticLib"
language "C++"
warnings "Extra"
targetdir "../lib/"
links {
"pugixml"
}
includedirs {
"../include/xlnt",
"../third-party/miniz",
"../third-party/pugixml/src"
}
files {
"../source/**.cpp",
"../source/**.hpp",
"../include/xlnt/**.hpp"
}
flags {
"Unicode",
"NoEditAndContinue",
"NoManifest",
"NoPCH"
"../include/xlnt/**.hpp",
"../third-party/miniz/miniz.c",
"../third-party/pugixml/src/pugixml.cpp"
}
flags { "Unicode" }
configuration "Debug"
flags { "FatalWarnings" }
configuration "windows"
@ -80,30 +57,3 @@ project "xlnt"
"WIN32",
"_CRT_SECURE_NO_WARNINGS"
}
configuration "not windows"
buildoptions {
"-std=c++11",
"-Wno-unknown-pragmas"
}
configuration { "not windows", "Debug" }
buildoptions { "-ggdb" }
project "pugixml"
kind "StaticLib"
language "C++"
warnings "Off"
targetdir "../lib/"
includedirs {
"../third-party/pugixml/src"
}
files {
"../third-party/pugixml/src/pugixml.cpp"
}
flags {
"Unicode",
"NoEditAndContinue",
"NoManifest",
"NoPCH"
}
configuration "windows"
defines { "WIN32" }

View File

@ -39,8 +39,8 @@ public:
protection(type locked);
private:
type locked_;
type hidden_;
// type locked_;
// type hidden_;
};
} // namespace xlnt

View File

@ -4,11 +4,11 @@
namespace xlnt {
namespace detail {
cell_impl::cell_impl() : parent_(nullptr), column_(0), row_(0), style_(nullptr), merged(false), has_hyperlink_(false), is_date_(false)
cell_impl::cell_impl() : parent_(nullptr), column_(0), row_(0), style_(nullptr), merged(false), is_date_(false), has_hyperlink_(false)
{
}
cell_impl::cell_impl(worksheet_impl *parent, int column_index, int row_index) : parent_(parent), column_(column_index), row_(row_index), style_(nullptr), merged(false), has_hyperlink_(false), is_date_(false)
cell_impl::cell_impl(worksheet_impl *parent, int column_index, int row_index) : parent_(parent), column_(column_index), row_(row_index), style_(nullptr), merged(false), is_date_(false), has_hyperlink_(false)
{
}

View File

@ -2,12 +2,12 @@
namespace xlnt {
protection::protection() : locked_(type::unprotected)
protection::protection()// : locked_(type::unprotected)
{
}
protection::protection(type t) : locked_(t)
protection::protection(type /*t*/)// : locked_(t)
{
}

View File

@ -2,7 +2,7 @@
namespace xlnt {
style::style(const style &rhs) : protection_(rhs.protection_), number_format_(rhs.number_format_)
style::style(const style &rhs) : number_format_(rhs.number_format_), protection_(rhs.protection_)
{
}

View File

@ -579,7 +579,7 @@ std::vector<content_type> xlnt::workbook::get_content_types() const
content_types.push_back({ true, "xml", "", "application/xml" });
content_types.push_back({ true, "rels", "", "application/vnd.openxmlformats-package.relationships+xml" });
content_types.push_back({ false, "", "/xl/workbook.xml", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" });
for(int i = 0; i < get_sheet_names().size(); i++)
for(std::size_t i = 0; i < get_sheet_names().size(); i++)
{
content_types.push_back({false, "", "/xl/worksheets/sheet" + std::to_string(i + 1) + ".xml", "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"});
}

View File

@ -7,8 +7,7 @@
namespace xlnt {
zip_file::zip_file(const std::string &filename, file_mode mode, file_access access)
: zip_file_({0}),
current_state_(state::closed),
: current_state_(state::closed),
filename_(filename),
modified_(false),
// mode_(mode),
@ -130,7 +129,7 @@ void zip_file::read_all()
for(;i < num_files; i++)
{
mz_zip_archive_file_stat file_info = {0};
mz_zip_archive_file_stat file_info;
if(!mz_zip_reader_file_stat(&zip_file_, i, &file_info))
{
@ -185,7 +184,7 @@ std::string zip_file::read_from_zip(const std::string &filename)
for(;i < num_files; i++)
{
mz_zip_archive_file_stat file_info = {0};
mz_zip_archive_file_stat file_info;
if(!mz_zip_reader_file_stat(&zip_file_, i, &file_info))
{
@ -311,8 +310,6 @@ bool zip_file::file_exists(const std::string& name)
void zip_file::start_read()
{
zip_file_ = mz_zip_archive{0};
if(!mz_zip_reader_init_file(&zip_file_, filename_.c_str(), 0))
{
throw invalid_file_exception(filename_);