-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Ported the Qt port to Cpp17 #153
base: master
Are you sure you want to change the base?
Conversation
… compared the size of the vectors Using googletest exposed this, showing bugs in the following: converting from percent encoding (not return unicode vs utf8) diff_linesToCharsMunge didnt handle empty strings correctly diff_linesToCharsMunge didnt use wchar_t when concatenating
return 0; | ||
} else if (text.empty()) { | ||
// Nothing to match. | ||
return -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warning C4245 'return': conversion from 'int' to 'size_t', signed/unsigned mismatch
Maybe use return std::wstring::npos;
instead?
There are more occurences in this file, see lines 1874, 1877, 1879, 1885, 1895, 2059
// WTF? | ||
throw std::wstring(std::wstring(L"Invalid patch mode '") + sign + | ||
std::wstring(L" in: ") + line); | ||
return {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unreachable code
|
||
static_assert(sizeof(wchar_t) <= 4, "wchar_t is greater that 32 bit"); | ||
|
||
std::wstring_convert<std::codecvt_utf8<wchar_t> > utf8_conv; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'std::codecvt_utf8<wchar_t,1114111,(std::codecvt_mode)0>': warning STL4017: std::wbuffer_convert, std::wstring_convert, and the header (containing std::codecvt_mode, std::codecvt_utf8, std::codecvt_utf16, and std::codecvt_utf8_utf16) are deprecated in C++17. (The std::codecvt class template is NOT deprecated.) The C++ Standard doesn't provide equivalent non-deprecated functionality; consider using MultiByteToWideChar() and WideCharToMultiByte() from <Windows.h> instead. You can define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to suppress this warning.
Same in line 120
Created a new directory for Cpp17.
Removed all references to qt
Added CMakeLists.txt for both the library and the test application
Added support for gtest
Added a utils file for Qt'esq functions the STL is missing
For gtest support
cmake -DUSE_GTEST=ON
The default is off.