Skip to content

Commit

Permalink
building warning-clean on VS 16.10.0 pre3
Browse files Browse the repository at this point in the history
also:
- made tests build with /Wall on MSVC
- fixed minor documentation error
  • Loading branch information
marzer committed May 11, 2021
1 parent 1ab8d3d commit dca6945
Show file tree
Hide file tree
Showing 42 changed files with 1,138 additions and 286 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ toml++ is licensed under the terms of the MIT license - see [LICENSE].
UTF-8 decoding is performed using a state machine based on Bjoern Hoehrmann's '[Flexible and Economical UTF-8 Decoder]'.
### With thanks to:
- **[@beastle9end](https://github.com/beastle9end)** - Made Windows.h include bypass
- **[@bjadamson](https://github.com/bjadamson)** - Reported some bugs and helped design a new feature
- **[@bobfang1992](https://github.com/bobfang1992)** - Reported a bug and created a [wrapper in python](https://github.com/bobfang1992/pytomlpp)
- **[@GiulioRomualdi](https://github.com/GiulioRomualdi)** - Added cmake+meson support
Expand All @@ -208,7 +209,7 @@ UTF-8 decoding is performed using a state machine based on Bjoern Hoehrmann's '[
- **[@traversaro](https://github.com/traversaro)** - Added vcpkg support and reported a bunch of bugs
- **[@ximion](https://github.com/ximion)** - Added support for installation with meson
- **[@whiterabbit963](https://github.com/whiterabbit963)** - Fixed a bug with value_or conversions
- **[@beastle9end](https://github.com/beastle9end)** - Made Windows.h include bypass
<br>
# Contact
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/main_page.dox
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@
/// \subsection mainpage-example-speed-up-compilation Speeding up compilation
/// Because toml++ is a header-only library of nontrivial size you might find that compilation times noticeably
/// increase after you add it to your project, especially if you add the library's header somewhere that's visible from
/// a large number of translation units. You can counter this by disabling 'all inline' mode and explicitly controlling
/// a large number of translation units. You can counter this by disabling header-only mode and explicitly controlling
/// where the library's implementation is compiled.
///
/// <strong>Step 1: Set \ref TOML_HEADER_ONLY to [code]0[/code] before including toml++</strong>
Expand Down
1 change: 1 addition & 0 deletions include/toml++/toml.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ TOML_POP_WARNINGS; // TOML_DISABLE_SPAM_WARNINGS
#undef TOML_CONSTEVAL
#undef TOML_CPP
#undef TOML_DISABLE_ARITHMETIC_WARNINGS
#undef TOML_DISABLE_CODE_ANALYSIS_WARNINGS
#undef TOML_DISABLE_INIT_WARNINGS
#undef TOML_DISABLE_SPAM_WARNINGS
#undef TOML_DISABLE_SHADOW_WARNINGS
Expand Down
26 changes: 13 additions & 13 deletions include/toml++/toml_default_formatter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,19 +204,19 @@ TOML_NAMESPACE_END;
// implementations of windows wide string nonsense
#if TOML_WINDOWS_COMPAT

namespace winapi
{
extern "C"
{
int __stdcall WideCharToMultiByte(unsigned int CodePage, unsigned long dwFlags, const wchar_t* lpWideCharStr, int cchWideChar,
const char* lpMultiByteStr, int cbMultiByte, const char* lpDefaultChar, int* lpUsedDefaultChar);
int __stdcall MultiByteToWideChar(unsigned int CodePage, unsigned long dwFlags, const char* lpMultiByteStr, int cbMultiByte,
const wchar_t* lpWideCharStr, int cchWideChar);
}
}

TOML_IMPL_NAMESPACE_START
{
namespace winapi
{
extern "C"
{
int __stdcall WideCharToMultiByte(unsigned int CodePage, unsigned long dwFlags, const wchar_t* lpWideCharStr, int cchWideChar,
char* lpMultiByteStr, int cbMultiByte, const char* lpDefaultChar, int* lpUsedDefaultChar);
int __stdcall MultiByteToWideChar(unsigned int CodePage, unsigned long dwFlags, const char* lpMultiByteStr, int cbMultiByte,
wchar_t* lpWideCharStr, int cchWideChar);
}
}

TOML_API
TOML_EXTERNAL_LINKAGE
std::string narrow(std::wstring_view str) noexcept
Expand All @@ -231,7 +231,7 @@ TOML_IMPL_NAMESPACE_START
if (len)
{
s.resize(static_cast<size_t>(len));
winapi::WideCharToMultiByte(65001, 0, str.data(), static_cast<int>(str.length()), s.data(), len, nullptr, nullptr);
winapi::WideCharToMultiByte(65001, 0, str.data(), static_cast<int>(str.length()), s.data(), len, nullptr, nullptr);
}
return s;
}
Expand All @@ -248,7 +248,7 @@ TOML_IMPL_NAMESPACE_START
if (len)
{
s.resize(static_cast<size_t>(len));
winapi::MultiByteToWideChar(65001, 0, str.data(), static_cast<int>(str.length()), s.data(), len);
winapi::MultiByteToWideChar(65001, 0, str.data(), static_cast<int>(str.length()), s.data(), len);
}
return s;
}
Expand Down
Loading

0 comments on commit dca6945

Please sign in to comment.