Message: Some of these can be traced back to version 10.23 which was the last to not use Date: 2021-05-10 Version: 11.10 diff -x '*.rej' -x '*.orig' -x '*.git*' -Naur 10.24-0/wx+/choice_enum.h 10.24-1/wx+/choice_enum.h --- 10.24-0/wx+/choice_enum.h 2020-05-17 18:30:59.441499418 -0400 +++ 10.24-1/wx+/choice_enum.h 2020-05-17 18:53:59.893685507 -0400 @@ -7,7 +7,6 @@ #ifndef CHOICE_ENUM_H_132413545345687 #define CHOICE_ENUM_H_132413545345687 -#include #include #include @@ -47,8 +46,6 @@ using DescrList = std::vector>>; DescrList descrList; - - std::unordered_map> labelsSetLast; }; template void setEnumVal(const EnumDescrList& mapping, wxChoice& ctrl, Enum value); template Enum getEnumVal(const EnumDescrList& mapping, const wxChoice& ctrl); @@ -71,32 +68,24 @@ template void setEnumVal(EnumDescrList& mapping, wxChoice& ctrl, Enum value) { - auto& labelsSetLast = mapping.labelsSetLast[&ctrl]; - - std::vector labels; - for (const auto& [val, texts] : mapping.descrList) - labels.push_back(texts.first); + ctrl.Clear(); - if (labels != labelsSetLast) + int selectedPos = 0; + for (auto it = mapping.descrList.begin(); it != mapping.descrList.end(); ++it) { - ctrl.Set(labels); //expensive as fuck! => only call when absolutely needed! - labelsSetLast = std::move(labels); + ctrl.Append(it->second.first); + if (it->first == value) + { + selectedPos = it - mapping.descrList.begin(); + + if (it->second.second.empty()) + ctrl.UnsetToolTip(); + else + ctrl.SetToolTip(it->second.second); + } } - //----------------------------------------------------------------- - const auto it = std::find_if(mapping.descrList.begin(), mapping.descrList.end(), [&](const auto& mapItem) { return mapItem.first == value; }); - if (it != mapping.descrList.end()) - { - if (const wxString& tooltip = it->second.second; - !tooltip.empty()) - ctrl.SetToolTip(tooltip); - else - ctrl.UnsetToolTip(); - - const int selectedPos = it - mapping.descrList.begin(); - ctrl.SetSelection(selectedPos); - } - else assert(false); + ctrl.SetSelection(selectedPos); } template @@ -115,17 +103,11 @@ template void updateTooltipEnumVal(const EnumDescrList& mapping, wxChoice& ctrl) { - const int selectedPos = ctrl.GetSelection(); + const Enum currentValue = getEnumVal(mapping, ctrl); - if (0 <= selectedPos && selectedPos < std::ssize(mapping.descrList)) - { - if (const auto& [text, tooltip] = mapping.descrList[selectedPos].second; - !tooltip.empty()) - ctrl.SetToolTip(tooltip); - else - ctrl.UnsetToolTip(); - } - else assert(false); + for (const auto& [enumValue, textAndTooltip] : mapping.descrList) + if (currentValue == enumValue) + ctrl.SetToolTip(textAndTooltip.second); } } Message: Now have to revert wxWidgets 3.1.4 upstreamisms cd 11.1-0 ; git diff HEAD~1 -- $( grep -l -rIE 'wxASCII_STR' ) > ~/foo1 ; ( cd ../11.1-2 ; vi ~/foo1 $( grep -l -rIE 'wxASCII_STR' ) ; ) cd 11.1-0 ; git diff HEAD~1 -- $( grep -l -rIE 'wxDD_SHOW_HIDDEN' ) > ~/foo1 ; ( cd ../11.1-2 ; vi ~/foo1 $( grep -l -rIE 'wxDD_SHOW_HIDDEN' ) ; ) diff -x '*.orig' -x '*.rej' -aur 11.2-0/FreeFileSync/Source/RealTimeSync/folder_selector2.cpp 11.2-1/FreeFileSync/Source/RealTimeSync/folder_selector2.cpp --- 11.2-0/FreeFileSync/Source/RealTimeSync/folder_selector2.cpp 2020-10-02 14:39:05.273463072 -0400 +++ 11.2-1/FreeFileSync/Source/RealTimeSync/folder_selector2.cpp 2020-10-02 15:06:56.670070620 -0400 @@ -158,7 +158,7 @@ } Zstring newFolderPath; - wxDirDialog folderSelector(parent_, _("Select a folder"), utfTo(defaultFolderPath), wxDD_DEFAULT_STYLE | wxDD_SHOW_HIDDEN); + wxDirDialog folderSelector(parent_, _("Select a folder"), utfTo(defaultFolderPath)); if (folderSelector.ShowModal() != wxID_OK) return; newFolderPath = utfTo(folderSelector.GetPath()); diff -x '*.orig' -x '*.rej' -aur 11.1-1/FreeFileSync/Source/ui/command_box.h 11.1-2/FreeFileSync/Source/ui/command_box.h --- 11.1-1/FreeFileSync/Source/ui/command_box.h 2020-09-01 19:07:43.719122215 -0400 +++ 11.1-2/FreeFileSync/Source/ui/command_box.h 2020-09-01 20:09:56.840929352 -0400 @@ -30,7 +30,7 @@ const wxString choices[] = nullptr, long style = 0, const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxASCII_STR(wxComboBoxNameStr)); + const wxString& name = wxComboBoxNameStr); void setHistory(const std::vector& history, size_t historyMax) { history_ = history; historyMax_ = historyMax; } std::vector getHistory() const { return history_; } diff -x '*.orig' -x '*.rej' -aur 11.1-1/FreeFileSync/Source/ui/folder_history_box.h 11.1-2/FreeFileSync/Source/ui/folder_history_box.h --- 11.1-1/FreeFileSync/Source/ui/folder_history_box.h 2020-09-01 19:07:43.719122215 -0400 +++ 11.1-2/FreeFileSync/Source/ui/folder_history_box.h 2020-09-01 20:09:50.624849989 -0400 @@ -68,7 +68,7 @@ const wxString choices[] = nullptr, long style = 0, const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxASCII_STR(wxComboBoxNameStr)); + const wxString& name = wxComboBoxNameStr); void setHistory(std::shared_ptr sharedHistory) { sharedHistory_ = std::move(sharedHistory); } std::shared_ptr getHistory() { return sharedHistory_; } diff -x '*.orig' -x '*.rej' -aur 11.2-0/FreeFileSync/Source/ui/folder_selector.cpp 11.2-1/FreeFileSync/Source/ui/folder_selector.cpp --- 11.2-0/FreeFileSync/Source/ui/folder_selector.cpp 2020-10-02 14:39:05.297463367 -0400 +++ 11.2-1/FreeFileSync/Source/ui/folder_selector.cpp 2020-10-02 15:08:07.066935749 -0400 @@ -232,7 +232,7 @@ Zstring shellItemPath; //default size? Windows: not implemented, Linux(GTK2): not implemented, macOS: not implemented => wxWidgets, what is this shit!? - wxDirDialog folderSelector(parent_, _("Select a folder"), utfTo(defaultFolderNative), wxDD_DEFAULT_STYLE | wxDD_SHOW_HIDDEN); + wxDirDialog folderSelector(parent_, _("Select a folder"), utfTo(defaultFolderNative)); //GTK2: "Show hidden" is also available as a context menu option in the folder picker! //It looks like wxDD_SHOW_HIDDEN only sets the default when opening for the first time!? if (folderSelector.ShowModal() != wxID_OK) diff -x '*.orig' -x '*.rej' -aur 11.1-1/wx+/bitmap_button.h 11.1-2/wx+/bitmap_button.h --- 11.1-1/wx+/bitmap_button.h 2020-09-01 19:07:43.727122311 -0400 +++ 11.1-2/wx+/bitmap_button.h 2020-09-01 20:10:31.385364671 -0400 @@ -26,7 +26,7 @@ const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxASCII_STR(wxButtonNameStr)) : + const wxString& name = wxButtonNameStr) : wxBitmapButton(parent, id, wxNullBitmap, pos, size, style, validator, name) { SetLabel(label); diff -aur -x '*.git*' -x '.*.swp' -x '*.orig' -x '*.rej' 11.6-0/wx+/dc.h 11.6-1/wx+/dc.h --- 11.9-0/wx+/dc.h 2021-04-05 10:57:36.518697734 -0400 +++ 11.9-1/wx+/dc.h 2021-04-05 11:11:21.809650868 -0400 @@ -69,9 +69,6 @@ inline int getDPI() { -#ifndef wxHAVE_DPI_INDEPENDENT_PIXELS -#error why is wxHAVE_DPI_INDEPENDENT_PIXELS not defined? -#endif //GTK2 doesn't properly support high DPI: https://freefilesync.org/forum/viewtopic.php?t=6114 //=> requires general fix at wxWidgets-level diff -x '*.orig' -x '*.rej' -aur 11.1-1/wx+/graph.h 11.1-2/wx+/graph.h --- 11.1-1/wx+/graph.h 2020-09-01 19:07:43.731122359 -0400 +++ 11.1-2/wx+/graph.h 2020-09-01 20:10:36.541429649 -0400 @@ -153,7 +153,7 @@ const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL | wxNO_BORDER, - const wxString& name = wxASCII_STR(wxPanelNameStr)); + const wxString& name = wxPanelNameStr); class CurveAttributes { diff -x '*.orig' -x '*.rej' -aur 11.1-1/wx+/grid.cpp 11.1-2/wx+/grid.cpp --- 11.1-1/wx+/grid.cpp 2020-09-01 20:07:24.418981662 -0400 +++ 11.1-2/wx+/grid.cpp 2020-09-01 20:10:23.745268393 -0400 @@ -268,7 +268,7 @@ { public: SubWindow(Grid& parent) : - wxWindow(&parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS | wxBORDER_NONE, wxASCII_STR(wxPanelNameStr)), + wxWindow(&parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS | wxBORDER_NONE, wxPanelNameStr), parent_(parent) { Bind(wxEVT_PAINT, [this](wxPaintEvent& event) { onPaintEvent(event); }); diff -x '*.orig' -x '*.rej' -aur 11.1-1/wx+/grid.h 11.1-2/wx+/grid.h --- 11.1-1/wx+/grid.h 2020-09-01 19:07:43.731122359 -0400 +++ 11.1-2/wx+/grid.h 2020-09-01 20:10:48.817584344 -0400 @@ -149,7 +149,7 @@ const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL | wxNO_BORDER, - const wxString& name = wxASCII_STR(wxPanelNameStr)); + const wxString& name = wxPanelNameStr); size_t getRowCount() const; diff -x '*.orig' -x '*.rej' -aur 11.1-1/wx+/toggle_button.h 11.1-2/wx+/toggle_button.h --- 11.1-1/wx+/toggle_button.h 2020-09-01 19:07:43.731122359 -0400 +++ 11.1-2/wx+/toggle_button.h 2020-09-01 20:10:44.629531569 -0400 @@ -24,7 +24,7 @@ const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxASCII_STR(wxButtonNameStr)) : + const wxString& name = wxButtonNameStr) : wxBitmapButton(parent, id, bitmap, pos, size, style, validator, name) {} //wxButton constructor @@ -35,7 +35,7 @@ const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxASCII_STR(wxButtonNameStr)) : + const wxString& name = wxButtonNameStr) : wxBitmapButton(parent, id, wxNullBitmap, pos, size, style, validator, name) { SetLabel(label); Version: 11.1 Message: Had to revert gui_status_handler.cpp and .h entirely to version 11.0 to avoid the wx 3.1.4-isms here. diff --git a/FreeFileSync/Source/ui/gui_status_handler.cpp b/FreeFileSync/Source/ui/gui_status_handler.cpp index 3cb6aaaa..9484af2c 100644 --- a/FreeFileSync/Source/ui/gui_status_handler.cpp +++ b/FreeFileSync/Source/ui/gui_status_handler.cpp @@ -43,8 +43,8 @@ StatusHandlerTemporaryPanel::StatusHandlerTemporaryPanel(MainDialog& dlg, mainDlg_.Update(); //don't wait until idle event! //register keys - mainDlg_. Bind(wxEVT_CHAR_HOOK, &StatusHandlerTemporaryPanel::onLocalKeyEvent, this); - mainDlg_.m_buttonCancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &StatusHandlerTemporaryPanel::onAbortCompare, this); + mainDlg_.Connect(wxEVT_CHAR_HOOK, wxKeyEventHandler(StatusHandlerTemporaryPanel::OnKeyPressed), nullptr, this); + mainDlg_.m_buttonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusHandlerTemporaryPanel::OnAbortCompare), nullptr, this); } @@ -128,9 +128,8 @@ StatusHandlerTemporaryPanel::~StatusHandlerTemporaryPanel() mainDlg_.auiMgr_.Update(); //unregister keys - [[maybe_unused]] bool ubOk1 = mainDlg_. Unbind(wxEVT_CHAR_HOOK, &StatusHandlerTemporaryPanel::onLocalKeyEvent, this); - [[maybe_unused]] bool ubOk2 = mainDlg_.m_buttonCancel->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &StatusHandlerTemporaryPanel::onAbortCompare, this); - assert(ubOk1 && ubOk2); + mainDlg_.Disconnect(wxEVT_CHAR_HOOK, wxKeyEventHandler(StatusHandlerTemporaryPanel::OnKeyPressed), nullptr, this); + mainDlg_.m_buttonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusHandlerTemporaryPanel::OnAbortCompare), nullptr, this); mainDlg_.compareStatus_->teardown(); @@ -314,20 +313,20 @@ void StatusHandlerTemporaryPanel::forceUiUpdateNoThrow() } -void StatusHandlerTemporaryPanel::onLocalKeyEvent(wxKeyEvent& event) +void StatusHandlerTemporaryPanel::OnKeyPressed(wxKeyEvent& event) { const int keyCode = event.GetKeyCode(); if (keyCode == WXK_ESCAPE) { wxCommandEvent dummy; - onAbortCompare(dummy); + OnAbortCompare(dummy); } event.Skip(); } -void StatusHandlerTemporaryPanel::onAbortCompare(wxCommandEvent& event) +void StatusHandlerTemporaryPanel::OnAbortCompare(wxCommandEvent& event) { userRequestAbort(); } diff --git a/FreeFileSync/Source/ui/gui_status_handler.h b/FreeFileSync/Source/ui/gui_status_handler.h index e8ed01e4..2a9e00d2 100644 --- a/FreeFileSync/Source/ui/gui_status_handler.h +++ b/FreeFileSync/Source/ui/gui_status_handler.h @@ -41,8 +41,8 @@ public: Result reportResults(); //noexcept!! private: - void onLocalKeyEvent(wxKeyEvent& event); - void onAbortCompare(wxCommandEvent& event); //handle abort button click + void OnKeyPressed(wxKeyEvent& event); + void OnAbortCompare(wxCommandEvent& event); //handle abort button click void showStatsPanel(); MainDialog& mainDlg_; diff -Naur -x '*.orig' -x '*.rej' -x '*.git*' 11.4-1/wx+/no_flicker.h 11.4-2/wx+/no_flicker.h --- 11.4-1/wx+/no_flicker.h 2020-12-08 08:15:29.436156549 -0500 +++ 11.4-2/wx+/no_flicker.h 2020-12-08 20:11:25.066820270 -0500 @@ -70,7 +70,7 @@ ZEN_ON_SCOPE_EXIT(richCtrl.EndSuppressUndo()); //fix mouse scroll speed: why the FUCK is this even necessary! - richCtrl.SetLineHeight(richCtrl.GetCharHeight()); + //richCtrl.SetLineHeight(richCtrl.GetCharHeight()); // this is not even documented in wxWidgets 3.1.5! //get rid of margins and space between text blocks/"paragraphs" richCtrl.SetMargins({0, 0}); Message: Revert __cpp_lib_atomic_wait which is not yet implemented in g++-10 or clang++-11 on Debian How does Zenju compile this?! Date: 2021-05-10 --- 11.9-0/zen/globals.h 2021-05-10 08:10:14.755776667 -0400 +++ 11.9-1/zen/globals.h 2021-05-10 09:17:25.122241641 -0400 @@ -223,7 +223,11 @@ void PodSpinMutex::lock() { while (!tryLock()) +#ifdef __cpp_lib_atomic_wait flag_.wait(true, std::memory_order_relaxed); +#else + ; +#endif } @@ -231,7 +235,9 @@ void PodSpinMutex::unlock() { flag_.clear(std::memory_order_release); +#ifdef __cpp_lib_atomic_wait flag_.notify_one(); +#endif } Message: This one should work; it's a c++17 specification, but it doesn't work. Date: 2021-05-10 diff -aur 11.10-0/zen/legacy_compiler.cpp 11.10-1/zen/legacy_compiler.cpp --- 11.10-0/zen/legacy_compiler.cpp 2021-05-10 08:10:14.755776667 -0400 +++ 11.10-1/zen/legacy_compiler.cpp 2021-05-10 10:06:01.998079701 -0400 @@ -14,15 +14,17 @@ double zen::fromChars(const char* first, const char* last) { - double num = 0; - [[maybe_unused]] const std::from_chars_result rv = std::from_chars(first, last, num); - return num; + return std::strtod(std::string(first, last).c_str(), nullptr); } const char* zen::toChars(char* first, char* last, double num) { - const std::to_chars_result rv = std::to_chars(first, last, num); - return rv.ec == std::errc{} ? rv.ptr : first; + const size_t bufSize = last - first; + const int charsWritten = std::snprintf(first, bufSize, "%g", num); + //C99: returns number of chars written if successful, < 0 or >= bufferSize on failure + + return 0 <= charsWritten && charsWritten < static_cast(bufSize) ? + first + charsWritten : first; }