From ebdbb84a29342508eabb181dd8dbca96b48c743f Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 12 Feb 2020 19:27:11 +0100 Subject: [PATCH] Enable recommended code analysis and address warnings Signed-off-by: Simon Rozman --- MSI/MSICA | 2 +- Updater | 2 +- ZRCola/pch.h | 3 + ZRCola/zrcolaabout.h | 4 ++ ZRCola/zrcolaapp.cpp | 2 + ZRCola/zrcolaapp.h | 4 ++ ZRCola/zrcolachrcatpnl.cpp | 8 ++- ZRCola/zrcolachrcatpnl.h | 7 ++ ZRCola/zrcolachrgrid.cpp | 10 +-- ZRCola/zrcolachrgrid.h | 6 +- ZRCola/zrcolachrreq.h | 4 ++ ZRCola/zrcolachrslct.cpp | 19 +++--- ZRCola/zrcolachrslct.h | 7 ++ ZRCola/zrcolacomppnl.cpp | 68 ++++++++++---------- ZRCola/zrcolacomppnl.h | 7 ++ ZRCola/zrcolafrm.cpp | 16 +++-- ZRCola/zrcolafrm.h | 7 ++ ZRCola/zrcolakeyhndlr.cpp | 10 +-- ZRCola/zrcolakeyhndlr.h | 4 ++ ZRCola/zrcolasettings.cpp | 4 +- ZRCola/zrcolasettings.h | 4 ++ ZRCola/zrcolatranseq.cpp | 2 +- ZRCola/zrcolatranseq.h | 4 ++ ZRCola/zrcolaupdater.cpp | 2 +- ZRCola/zrcolaupdater.h | 9 ++- ZRColaCompile/dbsource.cpp | 16 +++-- ZRColaCompile/dbsource.h | 30 ++++++++- ZRColaCompile/main.cpp | 20 +++--- ZRColaCompile/pch.h | 9 ++- ZRColaInstall/main.cpp | 2 +- include/common.props | 3 + lib/WinStd | 2 +- lib/libZRCola/include/zrcola/character.h | 16 ++--- lib/libZRCola/include/zrcola/common.h | 34 ++++++---- lib/libZRCola/include/zrcola/language.h | 12 ++-- lib/libZRCola/include/zrcola/tag.h | 12 ++-- lib/libZRCola/include/zrcola/translate.h | 24 +++---- lib/libZRCola/src/translate.cpp | 2 +- lib/libZRColaUI/build/libZRColaUI.props | 2 +- lib/libZRColaUI/include/zrcolaui/chargroup.h | 8 +-- lib/libZRColaUI/include/zrcolaui/keyboard.h | 12 ++-- lib/libZRColaUI/src/keyboard.cpp | 6 +- lib/libZRColaUI/src/pch.h | 4 ++ lib/stdex | 2 +- lib/wxExtend | 2 +- 45 files changed, 278 insertions(+), 155 deletions(-) diff --git a/MSI/MSICA b/MSI/MSICA index cb74539..e975f5b 160000 --- a/MSI/MSICA +++ b/MSI/MSICA @@ -1 +1 @@ -Subproject commit cb745393289f049ee6b5ffafb6cea7d5a65230d4 +Subproject commit e975f5bc31e86a1ae847027a0159363aeebaf980 diff --git a/Updater b/Updater index 154cd79..349c42f 160000 --- a/Updater +++ b/Updater @@ -1 +1 @@ -Subproject commit 154cd798e49c9d748de5c206969ff569e86145c3 +Subproject commit 349c42fe5797baae2161402eeca4bdd4c1108142 diff --git a/ZRCola/pch.h b/ZRCola/pch.h index 3a16bed..4df1e78 100644 --- a/ZRCola/pch.h +++ b/ZRCola/pch.h @@ -39,6 +39,8 @@ #include #include +#pragma warning(push) +#pragma warning(disable: WXWIDGETS_CODE_ANALYSIS_WARNINGS) #include #include #include @@ -49,6 +51,7 @@ #include #include #include +#pragma warning(pop) #include diff --git a/ZRCola/zrcolaabout.h b/ZRCola/zrcolaabout.h index f1bb7dc..1a9b513 100644 --- a/ZRCola/zrcolaabout.h +++ b/ZRCola/zrcolaabout.h @@ -25,7 +25,11 @@ class wxZRColaAbout; #pragma once +#include +#pragma warning(push) +#pragma warning(disable: WXWIDGETS_CODE_ANALYSIS_WARNINGS) #include "zrcolagui.h" +#pragma warning(pop) /// diff --git a/ZRCola/zrcolaapp.cpp b/ZRCola/zrcolaapp.cpp index 7437677..0a40b6b 100644 --- a/ZRCola/zrcolaapp.cpp +++ b/ZRCola/zrcolaapp.cpp @@ -27,11 +27,13 @@ // ZRColaApp ////////////////////////////////////////////////////////////////////////// +#pragma warning(suppress: 28251) // wxWidgets implement WinMain without code analysis annotations. wxIMPLEMENT_APP(ZRColaApp); ZRColaApp::ZRColaApp() : m_mainWnd(NULL), + #pragma warning(suppress: 26812) // wxLanguage is unscoped m_lang_ui(wxLANGUAGE_DEFAULT), wxApp() { diff --git a/ZRCola/zrcolaapp.h b/ZRCola/zrcolaapp.h index 26dbf1c..c8172b6 100644 --- a/ZRCola/zrcolaapp.h +++ b/ZRCola/zrcolaapp.h @@ -27,9 +27,13 @@ class ZRColaApp; #include "zrcolafrm.h" #include +#include +#pragma warning(push) +#pragma warning(disable: WXWIDGETS_CODE_ANALYSIS_WARNINGS) #include #include #include +#pragma warning(pop) #include #include #include diff --git a/ZRCola/zrcolachrcatpnl.cpp b/ZRCola/zrcolachrcatpnl.cpp index a4e5980..38d7c2b 100644 --- a/ZRCola/zrcolachrcatpnl.cpp +++ b/ZRCola/zrcolachrcatpnl.cpp @@ -29,7 +29,9 @@ BEGIN_EVENT_TABLE(wxZRColaCharacterCatalogPanel, wxZRColaCharacterCatalogPanelBa END_EVENT_TABLE() -wxZRColaCharacterCatalogPanel::wxZRColaCharacterCatalogPanel(wxWindow* parent) : wxZRColaCharacterCatalogPanelBase(parent) +wxZRColaCharacterCatalogPanel::wxZRColaCharacterCatalogPanel(wxWindow* parent) : + m_cg_id(0), + wxZRColaCharacterCatalogPanelBase(parent) { std::fstream dat((LPCTSTR)dynamic_cast(wxTheApp)->GetDatabaseFilePath(), std::ios_base::in | std::ios_base::binary); if (dat.good()) { @@ -60,7 +62,7 @@ wxZRColaCharacterCatalogPanel::wxZRColaCharacterCatalogPanel(wxWindow* parent) : wxString label(cg.name(), cg.name_len()), label_tran2(wxGetTranslation(label, wxT("ZRCola-zrcdb"))); - m_choice->Insert(label_tran2, i); + m_choice->Insert(label_tran2, (unsigned int)i); } m_cg_id = m_cg_db.idxRank[0].grp; m_choice->Select(0); @@ -216,7 +218,7 @@ bool wxPersistentZRColaCharacterCatalogPanel::Restore() if (cg.grp == cg_id) { if (wnd->m_cg_id != cg.grp) { wnd->m_cg_id = cg.grp; - wnd->m_choice->Select(i); + wnd->m_choice->Select((int)i); update = true; } diff --git a/ZRCola/zrcolachrcatpnl.h b/ZRCola/zrcolachrcatpnl.h index c7d70c4..00135ba 100644 --- a/ZRCola/zrcolachrcatpnl.h +++ b/ZRCola/zrcolachrcatpnl.h @@ -25,9 +25,16 @@ class wxZRColaCharacterCatalogPanel; #pragma once +#include +#pragma warning(push) +#pragma warning(disable: WXWIDGETS_CODE_ANALYSIS_WARNINGS) #include "zrcolagui.h" +#pragma warning(pop) #include +#pragma warning(push) +#pragma warning(disable: WXWIDGETS_CODE_ANALYSIS_WARNINGS) #include +#pragma warning(pop) /// diff --git a/ZRCola/zrcolachrgrid.cpp b/ZRCola/zrcolachrgrid.cpp index 348f2ba..c64972d 100644 --- a/ZRCola/zrcolachrgrid.cpp +++ b/ZRCola/zrcolachrgrid.cpp @@ -156,13 +156,13 @@ void wxZRColaCharGrid::OnSize(wxSizeEvent& event) row_height = FromDIP(wxZRColaCharacterGridRowHeight), width = size.GetWidth() - m_rowLabelWidth - m_extraWidth, cols = std::max(width / col_width, 1), - rows = std::max((char_count + cols - 1) / cols, 1); + rows = std::max((int)((char_count + cols - 1) / cols), 1); if (m_colLabelHeight + rows*row_height + m_extraHeight > size.GetHeight()) { // Vertical scrollbar will be shown. Adjust the width and recalculate layout to avoid horizontal scrollbar. width = std::max(width - wxSystemSettings::GetMetric(wxSYS_VSCROLL_X, this), 0); cols = std::max(width / col_width, 1); - rows = std::max((char_count + cols - 1) / cols, 1); + rows = std::max((int)((char_count + cols - 1) / cols), 1); } BeginBatch(); @@ -242,7 +242,7 @@ void wxZRColaCharGrid::OnMotion(wxMouseEvent& event) if (col == wxNOT_FOUND || row == wxNOT_FOUND ) return; - size_t toolTipIdx = row*m_numCols + col; + size_t toolTipIdx = (size_t)row*m_numCols + col; if (toolTipIdx >= m_chars.GetCount()) { // Index out of range. m_toolTipIdx = (size_t)-1; @@ -254,7 +254,7 @@ void wxZRColaCharGrid::OnMotion(wxMouseEvent& event) wxWindow *gridWnd = GetGridWindow(); if (gridWnd->GetToolTip()) { // The tooltip is already shown. Update it immediately. - gridWnd->SetToolTip(GetToolTipText(m_toolTipIdx)); + gridWnd->SetToolTip(GetToolTipText((int)m_toolTipIdx)); } else { // This must be our initial entry. Schedule tooltip display after 1s. m_timerToolTip.Start(1000, true); @@ -270,5 +270,5 @@ void wxZRColaCharGrid::OnTooltipTimer(wxTimerEvent& event) if (m_toolTipIdx >= m_chars.GetCount()) return; - GetGridWindow()->SetToolTip(GetToolTipText(m_toolTipIdx)); + GetGridWindow()->SetToolTip(GetToolTipText((int)m_toolTipIdx)); } diff --git a/ZRCola/zrcolachrgrid.h b/ZRCola/zrcolachrgrid.h index 1bca23c..07fad03 100644 --- a/ZRCola/zrcolachrgrid.h +++ b/ZRCola/zrcolachrgrid.h @@ -25,7 +25,11 @@ class wxZRColaCharGrid; #pragma once +#include +#pragma warning(push) +#pragma warning(disable: WXWIDGETS_CODE_ANALYSIS_WARNINGS) #include +#pragma warning(pop) /// @@ -96,7 +100,7 @@ public: if (i >= n) return wxGridCellCoords(-1, -1); else if (m_chars[i] == c) - return wxGridCellCoords(i / m_numCols, i % m_numCols); + return wxGridCellCoords((int)(i / m_numCols), i % m_numCols); } } diff --git a/ZRCola/zrcolachrreq.h b/ZRCola/zrcolachrreq.h index cd540eb..7ee0233 100644 --- a/ZRCola/zrcolachrreq.h +++ b/ZRCola/zrcolachrreq.h @@ -26,7 +26,11 @@ class wxPersistentZRColaCharRequest; #pragma once +#include +#pragma warning(push) +#pragma warning(disable: WXWIDGETS_CODE_ANALYSIS_WARNINGS) #include "zrcolagui.h" +#pragma warning(pop) #include "zrcolakeyhndlr.h" #include diff --git a/ZRCola/zrcolachrslct.cpp b/ZRCola/zrcolachrslct.cpp index 238be31..49db23d 100644 --- a/ZRCola/zrcolachrslct.cpp +++ b/ZRCola/zrcolachrslct.cpp @@ -85,7 +85,7 @@ bool wxZRColaUTF16CharValidator::Parse(const wxString &val_in, size_t i_start, s } else if (i >= i_start + 4) { // Maximum characters exceeded. ctrl->SetFocus(); - ctrl->SetSelection(i, i_end); + ctrl->SetSelection((int)i, (int)i_end); wxMessageBox(_("Too many digits in Unicode."), _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent); return false; } else if (_T('0') <= buf[i] && buf[i] <= _T('9')) { @@ -103,7 +103,7 @@ bool wxZRColaUTF16CharValidator::Parse(const wxString &val_in, size_t i_start, s } else { // Invalid character found. ctrl->SetFocus(); - ctrl->SetSelection(i, i + 1); + ctrl->SetSelection((long)i, (long)(i + 1)); wxMessageBox(wxString::Format(_("Invalid character in Unicode found: %c"), buf[i]), _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent); return false; } @@ -202,6 +202,7 @@ wxZRColaCharSelect::wxZRColaCharSelect(wxWindow* parent) : wxZRColaCharSelectBase(parent) { // Set tag lookup locale. + #pragma warning(suppress: 26812) // wxLanguage is unscoped wxLanguage language = dynamic_cast(wxTheApp)->m_lang_ui; if (wxLANGUAGE_DEFAULT == language || wxLANGUAGE_ENGLISH <= language && language <= wxLANGUAGE_ENGLISH_ZIMBABWE) m_locale = MAKELCID(MAKELANGID(LANG_ENGLISH , SUBLANG_DEFAULT), SORT_DEFAULT); @@ -219,7 +220,7 @@ wxZRColaCharSelect::wxZRColaCharSelect(wxWindow* parent) : auto app = dynamic_cast(wxTheApp); for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++) { const auto &cc = app->m_cc_db.idxRank[i]; - int idx = m_categories->Insert(wxGetTranslation(wxString(cc.name(), cc.name_len()), wxT("ZRCola-zrcdb")), i); + int idx = m_categories->Insert(wxGetTranslation(wxString(cc.name(), cc.name_len()), wxT("ZRCola-zrcdb")), (unsigned int)i); m_categories->Check(idx); m_ccOrder.insert(std::make_pair(cc.cat, idx)); } @@ -354,7 +355,7 @@ void wxZRColaCharSelect::OnIdle(wxIdleEvent& event) // Select categories. for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++) { const auto &cc = app->m_cc_db.idxRank[i]; - if (m_categories->IsChecked(i)) + if (m_categories->IsChecked((unsigned int)i)) m_searchThread->m_cats.insert(cc.cat); } @@ -401,7 +402,7 @@ void wxZRColaCharSelect::OnCategoriesAll(wxHyperlinkEvent& event) auto app = dynamic_cast(wxTheApp); for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++) - m_categories->Check(i, true); + m_categories->Check((unsigned int)i, true); m_searchChanged = true; } @@ -413,7 +414,7 @@ void wxZRColaCharSelect::OnCategoriesNone(wxHyperlinkEvent& event) auto app = dynamic_cast(wxTheApp); for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++) - m_categories->Check(i, false); + m_categories->Check((unsigned int)i, false); m_searchChanged = true; } @@ -425,7 +426,7 @@ void wxZRColaCharSelect::OnCategoriesInvert(wxHyperlinkEvent& event) auto app = dynamic_cast(wxTheApp); for (size_t i = 0, n = app->m_cc_db.idxRank.size(); i < n; i++) - m_categories->Check(i, !m_categories->IsChecked(i)); + m_categories->Check((unsigned int)i, !m_categories->IsChecked((unsigned int)i)); m_searchChanged = true; } @@ -835,7 +836,7 @@ void wxPersistentZRColaCharSelect::Save() const const auto &cc = app->m_cc_db.idxRank[i]; wxString name(wxT("category")); name.Append(cc.cat.data, _countof(cc.cat.data)); - SaveValue(name, wnd->m_categories->IsChecked(i)); + SaveValue(name, wnd->m_categories->IsChecked((unsigned int)i)); } SaveValue(wxT("searchPanel"), wnd->m_search_panel->IsShown()); @@ -872,7 +873,7 @@ bool wxPersistentZRColaCharSelect::Restore() name.Append(cc.cat.data, _countof(cc.cat.data)); bool val; if (RestoreValue(name, &val)) - wnd->m_categories->Check(i, val); + wnd->m_categories->Check((unsigned int)i, val); } bool search_panel; diff --git a/ZRCola/zrcolachrslct.h b/ZRCola/zrcolachrslct.h index cd10a3e..00e7c21 100644 --- a/ZRCola/zrcolachrslct.h +++ b/ZRCola/zrcolachrslct.h @@ -26,12 +26,19 @@ class wxPersistentZRColaCharSelect; #pragma once +#include +#pragma warning(push) +#pragma warning(disable: WXWIDGETS_CODE_ANALYSIS_WARNINGS) #include "zrcolagui.h" +#pragma warning(pop) #include #include +#pragma warning(push) +#pragma warning(disable: WXWIDGETS_CODE_ANALYSIS_WARNINGS) #include #include #include +#pragma warning(pop) #include #include #include diff --git a/ZRCola/zrcolacomppnl.cpp b/ZRCola/zrcolacomppnl.cpp index cae204c..6a6b39e 100644 --- a/ZRCola/zrcolacomppnl.cpp +++ b/ZRCola/zrcolacomppnl.cpp @@ -43,13 +43,13 @@ wxZRColaComposerPanel::wxZRColaComposerPanel(wxWindow* parent) : file.Read(&n, sizeof(n)); if (!file.Error()) { wxString source; - file.Read(wxStringBuffer(source, n), sizeof(wchar_t)*n); + file.Read(wxStringBuffer(source, (size_t)n), sizeof(wchar_t)*(size_t)n); if (!file.Error()) { // Load destination text. file.Read(&n, sizeof(n)); if (!file.Error()) { wxString destination; - file.Read(wxStringBuffer(destination, n), sizeof(wchar_t)*n); + file.Read(wxStringBuffer(destination, (size_t)n), sizeof(wchar_t)*(size_t)n); if (!file.Error()) { // Restore state. m_source->SetValue(source); @@ -121,8 +121,8 @@ void wxZRColaComposerPanel::SynchronizePanels() // Update destination text, and its HEX dump. m_destination->SetValue(dst); m_destination->SetSelection( - m_selDestination.first = MapToDestination(m_selSource.first ), - m_selDestination.second = MapToDestination(m_selSource.second)); + m_selDestination.first = (long)MapToDestination(m_selSource.first ), + m_selDestination.second = (long)MapToDestination(m_selSource.second)); SetHexValue(m_destinationHex, m_selDestinationHex, m_mappingDestinationHex, dst.data(), dst.length(), m_selDestination.first, m_selDestination.second); // Schedule state save after 3s. @@ -167,8 +167,8 @@ void wxZRColaComposerPanel::SynchronizePanels() // Update source text, and its HEX dump. m_source->SetValue(dst); m_source->SetSelection( - m_selSource.first = MapToSource(m_selDestination.first ), - m_selSource.second = MapToSource(m_selDestination.second)); + m_selSource.first = (long)MapToSource(m_selDestination.first ), + m_selSource.second = (long)MapToSource(m_selDestination.second)); SetHexValue(m_sourceHex, m_selSourceHex, m_mappingSourceHex, dst.data(), dst.length(), m_selSource.first, m_selSource.second); // Schedule state save after 3s. @@ -194,16 +194,16 @@ void wxZRColaComposerPanel::OnSourcePaint(wxPaintEvent& event) m_selSource.second = to; m_sourceHex->SetSelection( - m_selSourceHex.first = m_mappingSourceHex.to_dst(from), - m_selSourceHex.second = m_mappingSourceHex.to_dst(to )); + m_selSourceHex.first = (long)m_mappingSourceHex.to_dst(from), + m_selSourceHex.second = (long)m_mappingSourceHex.to_dst(to )); m_destination->SetSelection( - m_selDestination.first = MapToDestination(from), - m_selDestination.second = MapToDestination(to )); + m_selDestination.first = (long)MapToDestination(from), + m_selDestination.second = (long)MapToDestination(to )); m_destinationHex->SetSelection( - m_selDestinationHex.first = m_mappingDestinationHex.to_dst(m_selDestination.first ), - m_selDestinationHex.second = m_mappingDestinationHex.to_dst(m_selDestination.second)); + m_selDestinationHex.first = (long)m_mappingDestinationHex.to_dst(m_selDestination.first ), + m_selDestinationHex.second = (long)m_mappingDestinationHex.to_dst(m_selDestination.second)); } } @@ -221,16 +221,16 @@ void wxZRColaComposerPanel::OnSourceHexPaint(wxPaintEvent& event) m_selSourceHex.second = to; m_source->SetSelection( - m_selSource.first = m_mappingSourceHex.to_src(from), - m_selSource.second = m_mappingSourceHex.to_src(to )); + m_selSource.first = (long)m_mappingSourceHex.to_src(from), + m_selSource.second = (long)m_mappingSourceHex.to_src(to )); m_destination->SetSelection( - m_selDestination.first = MapToDestination(m_selSource.first ), - m_selDestination.second = MapToDestination(m_selSource.second)); + m_selDestination.first = (long)MapToDestination(m_selSource.first ), + m_selDestination.second = (long)MapToDestination(m_selSource.second)); m_destinationHex->SetSelection( - m_selDestinationHex.first = m_mappingDestinationHex.to_dst(m_selDestination.first ), - m_selDestinationHex.second = m_mappingDestinationHex.to_dst(m_selDestination.second)); + m_selDestinationHex.first = (long)m_mappingDestinationHex.to_dst(m_selDestination.first ), + m_selDestinationHex.second = (long)m_mappingDestinationHex.to_dst(m_selDestination.second)); } } @@ -257,16 +257,16 @@ void wxZRColaComposerPanel::OnDestinationPaint(wxPaintEvent& event) m_selDestination.second = to; m_destinationHex->SetSelection( - m_selDestinationHex.first = m_mappingDestinationHex.to_dst(from), - m_selDestinationHex.second = m_mappingDestinationHex.to_dst(to )); + m_selDestinationHex.first = (long)m_mappingDestinationHex.to_dst(from), + m_selDestinationHex.second = (long)m_mappingDestinationHex.to_dst(to )); m_source->SetSelection( - m_selSource.first = MapToSource(from), - m_selSource.second = MapToSource(to )); + m_selSource.first = (long)MapToSource(from), + m_selSource.second = (long)MapToSource(to )); m_sourceHex->SetSelection( - m_selSourceHex.first = m_mappingSourceHex.to_dst(m_selSource.first ), - m_selSourceHex.second = m_mappingSourceHex.to_dst(m_selSource.second)); + m_selSourceHex.first = (long)m_mappingSourceHex.to_dst(m_selSource.first ), + m_selSourceHex.second = (long)m_mappingSourceHex.to_dst(m_selSource.second)); } } @@ -284,16 +284,16 @@ void wxZRColaComposerPanel::OnDestinationHexPaint(wxPaintEvent& event) m_selDestinationHex.second = to; m_destination->SetSelection( - m_selDestination.first = m_mappingDestinationHex.to_src(from), - m_selDestination.second = m_mappingDestinationHex.to_src(to )); + m_selDestination.first = (long)m_mappingDestinationHex.to_src(from), + m_selDestination.second = (long)m_mappingDestinationHex.to_src(to )); m_source->SetSelection( - m_selSource.first = MapToSource(m_selDestination.first ), - m_selSource.second = MapToSource(m_selDestination.second)); + m_selSource.first = (long)MapToSource(m_selDestination.first ), + m_selSource.second = (long)MapToSource(m_selDestination.second)); m_sourceHex->SetSelection( - m_selSourceHex.first = m_mappingSourceHex.to_dst(m_selSource.first ), - m_selSourceHex.second = m_mappingSourceHex.to_dst(m_selSource.second)); + m_selSourceHex.first = (long)m_mappingSourceHex.to_dst(m_selSource.first ), + m_selSourceHex.second = (long)m_mappingSourceHex.to_dst(m_selSource.second)); } } @@ -356,11 +356,11 @@ size_t wxZRColaComposerPanel::GetValue(wxTextCtrl *wnd, wxString &text) size_t len = ::GetWindowTextLengthW(hWnd); if (len < 0x100) { WCHAR buf[0x100]; - ::GetWindowTextW(hWnd, buf, len + 1); + ::GetWindowTextW(hWnd, buf, (int)(len + 1)); text.assign(buf, len); } else { LPWSTR buf = new WCHAR[len + 1]; - ::GetWindowTextW(hWnd, buf, len + 1); + ::GetWindowTextW(hWnd, buf, (int)(len + 1)); text.assign(buf, len); delete [] buf; } @@ -393,8 +393,8 @@ void wxZRColaComposerPanel::SetHexValue(wxTextCtrl *wnd, std::pair & wnd->SetValue(hex); wnd->SetSelection( - range.first = mapping.to_dst(from), - range.second = mapping.to_dst(to )); + range.first = (long)mapping.to_dst(from), + range.second = (long)mapping.to_dst(to )); } diff --git a/ZRCola/zrcolacomppnl.h b/ZRCola/zrcolacomppnl.h index 192fa82..da61d6c 100644 --- a/ZRCola/zrcolacomppnl.h +++ b/ZRCola/zrcolacomppnl.h @@ -25,10 +25,17 @@ class wxZRColaComposerPanel; #pragma once +#include +#pragma warning(push) +#pragma warning(disable: WXWIDGETS_CODE_ANALYSIS_WARNINGS) #include "zrcolagui.h" +#pragma warning(pop) #include "zrcolakeyhndlr.h" +#pragma warning(push) +#pragma warning(disable: WXWIDGETS_CODE_ANALYSIS_WARNINGS) #include #include +#pragma warning(pop) #include #include diff --git a/ZRCola/zrcolafrm.cpp b/ZRCola/zrcolafrm.cpp index 6329b6e..079e7e2 100644 --- a/ZRCola/zrcolafrm.cpp +++ b/ZRCola/zrcolafrm.cpp @@ -101,11 +101,11 @@ wxZRColaFrame::wxZRColaFrame() : wxString name(ts.name(), ts.name_len()), name_tran(wxGetTranslation(name, wxT("ZRCola-zrcdb"))); - m_menuTranslationSeq->AppendRadioItem(wxID_TRANSLATION_SEQ_START + i, name_tran); + m_menuTranslationSeq->AppendRadioItem((int)(wxID_TRANSLATION_SEQ_START + i), name_tran); m_toolTranslationSeq->Append(name_tran, reinterpret_cast(ts.seq)); } else { wxString name_tran(_("Custom Translation...")); - m_menuTranslationSeq->AppendRadioItem(wxID_TRANSLATION_SEQ_START + i, name_tran); + m_menuTranslationSeq->AppendRadioItem((int)(wxID_TRANSLATION_SEQ_START + i), name_tran); m_toolTranslationSeq->Append(name_tran, reinterpret_cast(ZRCOLA_TRANSEQID_CUSTOM)); break; } @@ -154,13 +154,14 @@ wxZRColaFrame::wxZRColaFrame() : // Register notification sink for language detection. m_ulRefCount = 1; m_tfSource = NULL; + m_dwCookie = MAXDWORD; ITfInputProcessorProfiles *pProfiles; HRESULT hr = CoCreateInstance(CLSID_TF_InputProcessorProfiles, NULL, CLSCTX_INPROC_SERVER, IID_ITfInputProcessorProfiles, (LPVOID*)&pProfiles); if(SUCCEEDED(hr)) { hr = pProfiles->QueryInterface(IID_ITfSource, (LPVOID*)&m_tfSource); if(SUCCEEDED(hr)) { hr = m_tfSource->AdviseSink(IID_ITfLanguageProfileNotifySink, (ITfLanguageProfileNotifySink*)this, &m_dwCookie); - if (FAILED(hr) || m_dwCookie == -1) { + if (FAILED(hr) || m_dwCookie == MAXDWORD) { m_tfSource->Release(); m_tfSource = NULL; } @@ -493,6 +494,7 @@ void wxZRColaFrame::OnHelpShortcuts(wxCommandEvent& event) #ifdef __WXMSW__ // Search and try to launch installed PDF. + #pragma warning(suppress: 26812) // INSTALLSTATE is unscoped. INSTALLSTATE pdf_is = ::MsiGetComponentPath(_T(PRODUCT_VERSION_GUID), _T("{68AC2C38-10E2-41A3-B92C-844C03FFDF6A}"), pdf_path); if ((pdf_is == INSTALLSTATE_LOCAL || pdf_is == INSTALLSTATE_SOURCE) && wxFileExists(pdf_path) && @@ -594,10 +596,10 @@ void wxZRColaFrame::DoSend(const wxString& str) { // Prepare the INPUT table. wxString::size_type n = str.length(); - auto i_str = str.begin(); + wxString::const_iterator i_str = str.begin(); std::vector input; input.reserve(n*2); - for (std::vector::size_type i = 0; i < n; i++, i_str++) { + for (std::vector::size_type i = 0; i < n; i++, ++i_str) { wxString::char_type c = *i_str; // Add key down event. @@ -616,7 +618,7 @@ void wxZRColaFrame::DoSend(const wxString& str) ::SetActiveWindow(m_hWndSource); ::SetForegroundWindow(m_hWndSource); ::Sleep(200); - ::SendInput(input.size(), input.data(), sizeof(INPUT)); + ::SendInput((UINT)input.size(), input.data(), sizeof(INPUT)); m_hWndSource = NULL; // Select all input in source and destination to prepare for the overwrite next time. @@ -760,7 +762,7 @@ bool wxPersistentZRColaFrame::Restore() int num; if (RestoreValue(wxT("transeqId"), &num)) - wnd->m_transeq_id = num; + wnd->m_transeq_id = (ZRCola::transeqid_t)num; bool b; if (RestoreValue(wxT("composition"), &b)) diff --git a/ZRCola/zrcolafrm.h b/ZRCola/zrcolafrm.h index bf45800..e6e18b4 100644 --- a/ZRCola/zrcolafrm.h +++ b/ZRCola/zrcolafrm.h @@ -26,7 +26,11 @@ class wxPersistentZRColaFrame; #pragma once +#include +#pragma warning(push) +#pragma warning(disable: WXWIDGETS_CODE_ANALYSIS_WARNINGS) #include "zrcolagui.h" +#pragma warning(pop) #include "zrcolachrslct.h" #include "zrcolachrreq.h" #include "zrcolasettings.h" @@ -34,7 +38,10 @@ class wxPersistentZRColaFrame; #include #include #include +#pragma warning(push) +#pragma warning(disable: WXWIDGETS_CODE_ANALYSIS_WARNINGS) #include +#pragma warning(pop) #if defined(__WXMSW__) #include #endif diff --git a/ZRCola/zrcolakeyhndlr.cpp b/ZRCola/zrcolakeyhndlr.cpp index 638d8bc..3281778 100644 --- a/ZRCola/zrcolakeyhndlr.cpp +++ b/ZRCola/zrcolakeyhndlr.cpp @@ -47,7 +47,7 @@ bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event) if (!chr) { int key = e.GetKeyCode(); if (WXK_NUMPAD0 <= key && key <= WXK_NUMPAD9) - chr = '0' + (key - WXK_NUMPAD0); + chr = '0' + (wxChar)(key - WXK_NUMPAD0); } wxFrame *pFrame = wxDynamicCast(dynamic_cast(wxTheApp)->m_mainWnd, wxFrame); if (('0' <= chr && chr <= '9' || 'A' <= chr && chr <= 'F') && m_insert_seq.size() < 4) { @@ -81,14 +81,14 @@ bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event) { // Parse key event and save it at the end of the key sequence. ZRCola::keyseq_db::keyseq::key_t key; - key.key = e.GetRawKeyCode(); + key.key = (wchar_t)e.GetRawKeyCode(); #if defined(__WXMSW__) // Translate from local keyboard to scan code. - key.key = ::MapVirtualKey(key.key, MAPVK_VK_TO_VSC); + key.key = static_cast(::MapVirtualKey(key.key, MAPVK_VK_TO_VSC) & 0xffff); // Translate from scan code to U.S. Keyboard. static const HKL s_hkl = ::LoadKeyboardLayout(_T("00000409"), 0); - key.key = ::MapVirtualKeyEx(key.key, MAPVK_VSC_TO_VK, s_hkl); + key.key = static_cast(::MapVirtualKeyEx(key.key, MAPVK_VSC_TO_VK, s_hkl) & 0xffff); #endif key.modifiers = (e.ShiftDown() ? ZRCola::keyseq_db::keyseq::SHIFT : 0) | @@ -147,7 +147,7 @@ bool wxZRColaKeyHandler::ProcessEvent(wxEvent& event) if (count) { // Zero terminate sequence and parse the Unicode value. m_insert_seq.push_back(0); - wchar_t chr = strtoul(m_insert_seq.data(), NULL, 16); + wchar_t chr = (wchar_t)strtoul(m_insert_seq.data(), NULL, 16); if (chr) { wxObject *obj = event.GetEventObject(); diff --git a/ZRCola/zrcolakeyhndlr.h b/ZRCola/zrcolakeyhndlr.h index 596f2fd..097105b 100644 --- a/ZRCola/zrcolakeyhndlr.h +++ b/ZRCola/zrcolakeyhndlr.h @@ -27,7 +27,11 @@ class wxZRColaKeyHandler; #include +#include +#pragma warning(push) +#pragma warning(disable: WXWIDGETS_CODE_ANALYSIS_WARNINGS) #include +#pragma warning(pop) #include diff --git a/ZRCola/zrcolasettings.cpp b/ZRCola/zrcolasettings.cpp index 8ef3326..3277098 100644 --- a/ZRCola/zrcolasettings.cpp +++ b/ZRCola/zrcolasettings.cpp @@ -36,7 +36,7 @@ wxZRColaSettings::wxZRColaSettings(wxWindow* parent) : wxString label(lang.name(), lang.name_len()), label_tran(wxGetTranslation(label, wxT("ZRCola-zrcdb"))); - m_languages->Insert(label_tran, i); + m_languages->Insert(label_tran, (unsigned int)i); } } @@ -59,7 +59,7 @@ void wxZRColaSettings::OnInitDialog(wxInitDialogEvent& event) auto app = dynamic_cast(wxTheApp); ZRCola::language_db::indexLang::size_type start; - m_languages->Select(app->m_lang_db.idxLang.find(ZRCola::language_db::language(m_lang), start) ? start : -1); + m_languages->Select(app->m_lang_db.idxLang.find(ZRCola::language_db::language(m_lang), start) ? (int)start : -1); } diff --git a/ZRCola/zrcolasettings.h b/ZRCola/zrcolasettings.h index d48026a..3a2a599 100644 --- a/ZRCola/zrcolasettings.h +++ b/ZRCola/zrcolasettings.h @@ -26,7 +26,11 @@ class wxPersistentZRColaSettings; #pragma once +#include +#pragma warning(push) +#pragma warning(disable: WXWIDGETS_CODE_ANALYSIS_WARNINGS) #include "zrcolagui.h" +#pragma warning(pop) #include #include diff --git a/ZRCola/zrcolatranseq.cpp b/ZRCola/zrcolatranseq.cpp index 3365bc2..317e461 100644 --- a/ZRCola/zrcolatranseq.cpp +++ b/ZRCola/zrcolatranseq.cpp @@ -240,7 +240,7 @@ bool wxPersistentZRColaTranslationSeq::Restore() if (RestoreValue(wxT("transeq"), &str)) { std::vector transet; for (wxStringTokenizer tok(str, wxT("|")); tok.HasMoreTokens(); ) { - unsigned long val = _tcstoul(tok.GetNextToken().c_str(), NULL, 10); + ZRCola::transetid_t val = (ZRCola::transetid_t)_tcstoul(tok.GetNextToken().c_str(), NULL, 10); for (size_t i = 0, n = app->m_ts_db.idxTranSet.size(); i < n; i++) { const ZRCola::transet_db::transet &cg = app->m_ts_db.idxTranSet[i]; if (cg.set == val) { diff --git a/ZRCola/zrcolatranseq.h b/ZRCola/zrcolatranseq.h index 588db0f..1d3b12c 100644 --- a/ZRCola/zrcolatranseq.h +++ b/ZRCola/zrcolatranseq.h @@ -26,7 +26,11 @@ class wxPersistentZRColaTranslationSeq; #pragma once +#include +#pragma warning(push) +#pragma warning(disable: WXWIDGETS_CODE_ANALYSIS_WARNINGS) #include "zrcolagui.h" +#pragma warning(pop) #include #include #include diff --git a/ZRCola/zrcolaupdater.cpp b/ZRCola/zrcolaupdater.cpp index 8543b3b..b1ebae6 100644 --- a/ZRCola/zrcolaupdater.cpp +++ b/ZRCola/zrcolaupdater.cpp @@ -80,7 +80,7 @@ wxZRColaUpdater::~wxZRColaUpdater() void wxZRColaUpdater::OnIdle(wxIdleEvent& event) { if (!m_finished) { - m_buttonUpdate->Enable(m_updater->CheckForUpdate() == wxUpdCheckThread::wxUpdUpdateAvailable); + m_buttonUpdate->Enable(m_updater->CheckForUpdate() == wxUpdCheckThread::wxResult::UpdateAvailable); m_finished = true; } } diff --git a/ZRCola/zrcolaupdater.h b/ZRCola/zrcolaupdater.h index ea0b37f..5c513e4 100644 --- a/ZRCola/zrcolaupdater.h +++ b/ZRCola/zrcolaupdater.h @@ -25,11 +25,16 @@ class wxZRColaUpdater; #pragma once +#include +#pragma warning(push) +#pragma warning(disable: WXWIDGETS_CODE_ANALYSIS_WARNINGS) #include "zrcolagui.h" - +#pragma warning(pop) #include - +#pragma warning(push) +#pragma warning(disable: WXWIDGETS_CODE_ANALYSIS_WARNINGS) #include +#pragma warning(pop) /// diff --git a/ZRColaCompile/dbsource.cpp b/ZRColaCompile/dbsource.cpp index 8296054..c675edc 100644 --- a/ZRColaCompile/dbsource.cpp +++ b/ZRColaCompile/dbsource.cpp @@ -51,7 +51,7 @@ void ZRCola::DBSource::character_bank::build_related() } } - delete workers; // This line of code sounds horrible, I know. + delete [] workers; // This line of code sounds horrible, I know. } @@ -134,7 +134,7 @@ unsigned int __stdcall ZRCola::DBSource::character_bank::build_related_worker::p // ZRCola::DBSource::character_desc_idx ////////////////////////////////////////////////////////////////////////// -void ZRCola::DBSource::character_desc_idx::parse_keywords(const wchar_t *str, set &terms) +void ZRCola::DBSource::character_desc_idx::parse_keywords(_In_ const wchar_t *str, _Inout_ set &terms) { wxASSERT_MSG(str, wxT("string is NULL")); @@ -231,7 +231,8 @@ void ZRCola::DBSource::character_desc_idx::save(ZRCola::textindexOpen(bstr(cn.c_str())); +#pragma warning(pop) if (SUCCEEDED(hr)) { // Database open and ready. m_filename = filename; @@ -1009,18 +1013,18 @@ bool ZRCola::DBSource::GetKeySequence(const com_obj& rs, ZRCola::D if (keycode1) { // First key in the sequence is complete. keyseq::keycode kc1 = { - keyseq::keycode::translate_slen(keycode1), + keyseq::keycode::translate_slen(static_cast(keycode1 & 0xffff)), (modifiers & 0x100) != 0, (modifiers & 0x200) != 0, (modifiers & 0x400) != 0 }; ks.seq.push_back(kc1); - keyseq::keycode kc2 = { keyseq::keycode::translate_slen(keycode), shift }; + keyseq::keycode kc2 = { keyseq::keycode::translate_slen(static_cast(keycode & 0xffff)), shift }; ks.seq.push_back(kc2); } else { // First key in the sequence is only modifier(s). keyseq::keycode kc1 = { - keyseq::keycode::translate_slen(keycode), + keyseq::keycode::translate_slen(static_cast(keycode & 0xffff)), shift || (modifiers & 0x100) != 0, (modifiers & 0x200) != 0, (modifiers & 0x400) != 0 }; diff --git a/ZRColaCompile/dbsource.h b/ZRColaCompile/dbsource.h index b9a35e0..6c1285d 100644 --- a/ZRColaCompile/dbsource.h +++ b/ZRColaCompile/dbsource.h @@ -31,7 +31,11 @@ #include #include +#include +#pragma warning(push) +#pragma warning(disable: WXWIDGETS_CODE_ANALYSIS_WARNINGS) #include +#pragma warning(pop) #pragma warning(push) #pragma warning(disable: 4091) @@ -60,7 +64,8 @@ namespace ZRCola { int rank; ///< Sequence rank std::wstring str; ///< Sequence string - inline charseq() + inline charseq() : + rank(0) { } @@ -126,6 +131,8 @@ namespace ZRCola { charseq src; ///< Source sequence std::string norm; ///< Normalization footprint charseq dst; ///< Destination sequence + + inline translation() : set(0) {} }; @@ -137,6 +144,8 @@ namespace ZRCola { int set; ///< ID std::wstring src; ///< Source name std::wstring dst; ///< Destination name + + inline transet() : set(0) {} }; @@ -149,6 +158,11 @@ namespace ZRCola { int rank; ///< Rank std::wstring name; ///< Name std::vector sets; ///< Sets + + inline transeq() : + seq(0), + rank(0) + {} }; @@ -200,6 +214,8 @@ namespace ZRCola { public: ZRCola::langid_t lang; ///< Language ID std::wstring name; ///< Name + + inline language() : lang(ZRCola::langid_t::blank) {} }; @@ -210,6 +226,8 @@ namespace ZRCola { public: std::wstring chr; ///> Character ZRCola::langid_t lang; ///< Language ID + + inline langchar() : lang(ZRCola::langid_t::blank) {} }; @@ -223,6 +241,8 @@ namespace ZRCola { std::wstring name; ///< Name std::vector chars; ///< Characters (zero-delimited) std::vector show; ///< Bit vector if particular character from \c chars is displayed initially + + inline chrgrp() : grp(0), rank(0) {} }; @@ -325,7 +345,7 @@ namespace ZRCola { class character_desc_idx : public std::map, character_desc_idx_less> { public: - static void parse_keywords(const wchar_t *str, std::set &terms); + static void parse_keywords(_In_ const wchar_t *str, _Inout_ std::set &terms); void add_keywords(const std::set &terms, const std::wstring &chr, size_t sub = 0); inline void add_keywords(const wchar_t *str, const std::wstring &chr, size_t sub = 0) { @@ -369,6 +389,8 @@ namespace ZRCola { ZRCola::chrcatid_t cat; ///> Category ID int rank; ///< Rank std::wstring name; ///< Name + + inline chrcat() : cat(ZRCola::chrcatid_t::blank), rank(0) {} }; @@ -379,6 +401,8 @@ namespace ZRCola { public: std::wstring chr; ///> Character int tag; ///< Tag ID + + inline chrtag() : tag(0) {} }; @@ -389,6 +413,8 @@ namespace ZRCola { public: int tag; ///< Tag ID std::map > names; ///< Names + + inline tagname() : tag(0) {} }; diff --git a/ZRColaCompile/main.cpp b/ZRColaCompile/main.cpp index 4130ac6..d573317 100644 --- a/ZRColaCompile/main.cpp +++ b/ZRColaCompile/main.cpp @@ -34,7 +34,9 @@ public: int rank_dst; ///< Destination character rank string norm; ///< Normalization footprint - inline com_translation() + inline com_translation() : + rank_src(0), + rank_dst(0) { } @@ -65,7 +67,7 @@ public: { } - inline com_translation(com_translation &&other) : + inline com_translation(com_translation &&other) noexcept : rank_src( other.rank_src ), rank_dst( other.rank_dst ), norm (std::move(other.norm )) @@ -82,7 +84,7 @@ public: return *this; } - inline com_translation& operator=(com_translation &&other) + inline com_translation& operator=(com_translation &&other) noexcept { if (this != std::addressof(other)) { rank_src = other.rank_src ; @@ -213,8 +215,8 @@ static inline set permutate_and_translate_inv(_In_ co // Secondary permutation inverse translate. auto res_perm = translate_inv(db_trans, db_np, str_perm.c_str(), path); - for (auto r = res_perm.begin(), r_end = res_perm.end(); r != r_end; ++r) - res.insert(ZRCola::DBSource::charseq(r->rank + 1, std::move(r->str))); + for (auto r = res_perm.cbegin(), r_end = res_perm.cend(); r != r_end; ++r) + res.insert(ZRCola::DBSource::charseq(r->rank + 1, r->str)); } } @@ -371,14 +373,14 @@ int _tmain(int argc, _TCHAR *argv[]) assert(!res.empty()); // Add translation to temporary database. - for (auto r = res.begin(), r_end = res.end(); r != r_end; ++r) { + for (auto r = res.cbegin(), r_end = res.cend(); r != r_end; ++r) { translation_db::mapped_type::mapped_type ct(d1->second.rank_src + r->rank, d1->second.rank_dst); auto hit = t2->second.find(r->str); if (hit != t2->second.end()) { hit->second.rank_src = std::min(hit->second.rank_src, ct.rank_src); hit->second.rank_dst = std::max(hit->second.rank_dst, ct.rank_dst); } else - t2->second.insert(pair(std::move(r->str), std::move(ct))); + t2->second.insert(pair(r->str, std::move(ct))); } } } @@ -393,11 +395,11 @@ int _tmain(int argc, _TCHAR *argv[]) trans.set = 0; for (auto t = db_temp2.cbegin(), t_end = db_temp2.cend(); t != t_end; ++t) { // Add translation to index and data. - trans.dst.str = std::move(t->first); + trans.dst.str = t->first; for (auto d = t->second.cbegin(), d_end = t->second.cend(); d != d_end; ++d) { trans.dst.rank = d->second.rank_dst; trans.src.rank = d->second.rank_src; - trans.src.str = std::move(d->first); + trans.src.str = d->first; db_trans << trans; } } diff --git a/ZRColaCompile/pch.h b/ZRColaCompile/pch.h index edfa877..32b9f01 100644 --- a/ZRColaCompile/pch.h +++ b/ZRColaCompile/pch.h @@ -23,13 +23,16 @@ #include "dbsource.h" #include "parse.h" +#include +#include + +#pragma warning(push) +#pragma warning(disable: WXWIDGETS_CODE_ANALYSIS_WARNINGS) #include #include #include #include - -#include -#include +#pragma warning(pop) #include diff --git a/ZRColaInstall/main.cpp b/ZRColaInstall/main.cpp index 8f839a6..8213bf9 100644 --- a/ZRColaInstall/main.cpp +++ b/ZRColaInstall/main.cpp @@ -58,7 +58,7 @@ extern "C" void WinMainCRTStartup() LPTSTR pszTempFolder; DWORD dwLength; if ((dwLength = GetEnvironmentVariable(TEXT("TEMP"), NULL, 0)) != 0 && - (pszTempFolder = (LPTSTR)LocalAlloc(LMEM_FIXED, (dwLength + 1)*sizeof(TCHAR))) != NULL) // +1 is for trailing backslash when missing! + (pszTempFolder = (LPTSTR)LocalAlloc(LMEM_FIXED, (dwLength + 2)*sizeof(TCHAR))) != NULL) // +1 for trailing backslash when missing, +1 for zero terminator { dwLength = ::GetEnvironmentVariable(TEXT("TEMP"), pszTempFolder, dwLength); diff --git a/include/common.props b/include/common.props index 8a40e08..1a9181c 100644 --- a/include/common.props +++ b/include/common.props @@ -31,6 +31,8 @@ $(WXWIN)\include\msvc;$(WXWIN)\include;$(IncludePath) $(WXWIN)\src\aui;$(WXWIN)\src\cocoa;$(WXWIN)\src\common;$(WXWIN)\src\dfb;$(WXWIN)\src\expat;$(WXWIN)\src\generic;$(WXWIN)\src\gtk;$(WXWIN)\src\gtk1;$(WXWIN)\src\html;$(WXWIN)\src\jpeg;$(WXWIN)\src\motif;$(WXWIN)\src\msdos;$(WXWIN)\src\msw;$(WXWIN)\src\os2;$(WXWIN)\src\osx;$(WXWIN)\src\png;$(WXWIN)\src\propgrid;$(WXWIN)\src\regex;$(WXWIN)\src\ribbon;$(WXWIN)\src\richtext;$(WXWIN)\src\stc;$(WXWIN)\src\tiff;$(WXWIN)\src\univ;$(WXWIN)\src\unix;$(WXWIN)\src\x11;$(WXWIN)\src\xml;$(WXWIN)\src\xrc;$(WXWIN)\src\zlib;$(SourcePath) false + true + NativeRecommendedRules.ruleset @@ -42,6 +44,7 @@ true 4100;4505 false + true true diff --git a/lib/WinStd b/lib/WinStd index 7d2062d..7c5f20d 160000 --- a/lib/WinStd +++ b/lib/WinStd @@ -1 +1 @@ -Subproject commit 7d2062d3bf8e293d9a8585817e4e3f002d20bf62 +Subproject commit 7c5f20d7563a6ab966164c0cdb48f8e1f64c4742 diff --git a/lib/libZRCola/include/zrcola/character.h b/lib/libZRCola/include/zrcola/character.h index 4317ce9..589a220 100644 --- a/lib/libZRCola/include/zrcola/character.h +++ b/lib/libZRCola/include/zrcola/character.h @@ -220,11 +220,11 @@ namespace ZRCola { { this->cat = cat; this->chr_to = static_cast(chr_len); - if (chr_len) memcpy(this->data, chr, sizeof(wchar_t)*chr_len); + if (chr && chr_len) memcpy(this->data, chr, sizeof(wchar_t)*chr_len); this->desc_to = static_cast(this->chr_to + desc_len); - if (desc_len) memcpy(this->data + this->chr_to, desc, sizeof(wchar_t)*desc_len); + if (desc && desc_len) memcpy(this->data + this->chr_to, desc, sizeof(wchar_t)*desc_len); this->rel_to = static_cast(this->desc_to + rel_len); - if (rel_len) memcpy(this->data + this->desc_to, rel, sizeof(wchar_t)*rel_len); + if (rel && rel_len) memcpy(this->data + this->desc_to, rel, sizeof(wchar_t)*rel_len); } inline const wchar_t* chr () const { return data; }; @@ -378,7 +378,7 @@ namespace ZRCola { this->cat = cat; this->rank = rank; this->name_to = static_cast(name_len); - if (name_len) memcpy(this->data, name, sizeof(wchar_t)*name_len); + if (name && name_len) memcpy(this->data, name, sizeof(wchar_t)*name_len); } inline const wchar_t* name () const { return data; }; @@ -540,7 +540,7 @@ inline std::istream& operator >>(_In_ std::istream& stream, _Out_ ZRCola::charac if (count) { // Read data. db.data.resize(count); - stream.read((char*)db.data.data(), sizeof(unsigned __int16)*count); + stream.read((char*)db.data.data(), sizeof(unsigned __int16)*static_cast(count)); } else db.data.clear(); @@ -585,7 +585,7 @@ inline std::ostream& operator <<(_In_ std::ostream& stream, _In_ const ZRCola::c // Write data. if (stream.fail()) return stream; - stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*count); + stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*static_cast(count)); return stream; } @@ -624,7 +624,7 @@ inline std::ostream& operator <<(_In_ std::ostream& stream, _In_ const ZRCola::c // Write data. if (stream.fail()) return stream; - stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*count); + stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*static_cast(count)); return stream; } @@ -656,7 +656,7 @@ inline std::istream& operator >>(_In_ std::istream& stream, _Out_ ZRCola::chrcat if (count) { // Read data. db.data.resize(count); - stream.read((char*)db.data.data(), sizeof(unsigned __int16)*count); + stream.read((char*)db.data.data(), sizeof(unsigned __int16)*static_cast(count)); } else db.data.clear(); diff --git a/lib/libZRCola/include/zrcola/common.h b/lib/libZRCola/include/zrcola/common.h index a853ea3..0529bf9 100644 --- a/lib/libZRCola/include/zrcola/common.h +++ b/lib/libZRCola/include/zrcola/common.h @@ -462,7 +462,7 @@ namespace ZRCola { /// - \c true if found /// - \c false otherwise /// - bool find(_In_count_(key_len) const T_key *key, _In_ size_t key_len, _Out_ const T_val **val, _Out_ size_t *val_len) const + _Success_(return) bool find(_In_count_(key_len) const T_key *key, _In_ size_t key_len, _Out_ const T_val **val, _Out_ size_t *val_len) const { for (size_type start = 0, end = size(); start < end; ) { size_type m = (start + end) / 2; @@ -510,7 +510,7 @@ namespace ZRCola { size_t src; ///< Character index in source string size_t dst; ///< Character index in destination string - inline mapping() {}; + inline mapping() : src(0), dst(0) {}; inline mapping(_In_ size_t s, _In_ size_t d) : src(s), dst(d) {} /// @@ -588,7 +588,7 @@ namespace ZRCola { /// \param[in] count Number of characters in string \p str /// \param[in] sep Separator /// - inline std::string GetUnicodeDumpA(_In_ const wchar_t *str, _In_ size_t count, _In_opt_z_ const char *sep = "+") + inline std::string GetUnicodeDumpA(_In_ const wchar_t *str, _In_ size_t count, _In_z_ const char *sep = "+") { std::string out; size_t dump_len_max = strlen(sep) + 4 + 1; @@ -611,7 +611,7 @@ namespace ZRCola { /// \param[in] count Number of characters in string \p str /// \param[in] sep Separator /// - inline std::wstring GetUnicodeDumpW(_In_ const wchar_t *str, _In_ size_t count, _In_opt_z_ const wchar_t *sep = L"+") + inline std::wstring GetUnicodeDumpW(_In_ const wchar_t *str, _In_ size_t count, _In_z_ const wchar_t *sep = L"+") { std::wstring out; size_t dump_len_max = wcslen(sep) + 4 + 1; @@ -661,7 +661,7 @@ inline std::ostream& operator <<(_In_ std::ostream& stream, _In_ const ZRCola::i // Write index data. if (stream.fail()) return stream; - stream.write((const char*)idx.data(), sizeof(T_idx)*count); + stream.write((const char*)idx.data(), sizeof(T_idx)*static_cast(count)); return stream; } @@ -682,12 +682,15 @@ inline std::istream& operator >>(_In_ std::istream& stream, _Out_ ZRCola::index< // Read index count. stream.read((char*)&count, sizeof(count)); - if (!stream.good()) return stream; + if (!stream.good()) { + idx.clear(); + return stream; + } if (count) { // Read index data. idx.resize(count); - stream.read((char*)idx.data(), sizeof(T_idx)*count); + stream.read((char*)idx.data(), sizeof(T_idx)*static_cast(count)); } else idx.clear(); @@ -723,7 +726,7 @@ inline std::ostream& operator <<(_In_ std::ostream& stream, _In_ const ZRCola::t // Write index data. if (stream.fail()) return stream; - stream.write((const char*)idx.data(), sizeof(ZRCola::textindex::value_type)*count); + stream.write((const char*)idx.data(), sizeof(ZRCola::textindex::value_type)*static_cast(count)); // Write key count. auto key_count = idx.keys.size(); @@ -740,7 +743,7 @@ inline std::ostream& operator <<(_In_ std::ostream& stream, _In_ const ZRCola::t // Write key data. if (stream.fail()) return stream; - stream.write((const char*)idx.keys.data(), sizeof(std::vector::value_type)*count); + stream.write((const char*)idx.keys.data(), sizeof(std::vector::value_type)*static_cast(count)); // Write value count. auto value_count = idx.values.size(); @@ -757,7 +760,7 @@ inline std::ostream& operator <<(_In_ std::ostream& stream, _In_ const ZRCola::t // Write value data. if (stream.fail()) return stream; - stream.write((const char*)idx.values.data(), sizeof(std::vector::value_type)*count); + stream.write((const char*)idx.values.data(), sizeof(std::vector::value_type)*static_cast(count)); return stream; } @@ -778,12 +781,15 @@ inline std::istream& operator >>(_In_ std::istream& stream, _Out_ ZRCola::textin // Read text index count. stream.read((char*)&count, sizeof(count)); - if (!stream.good()) return stream; + if (!stream.good()) { + idx.clear(); + return stream; + } if (count) { // Read text index. idx.resize(count); - stream.read((char*)idx.data(), sizeof(ZRCola::textindex::value_type)*count); + stream.read((char*)idx.data(), sizeof(ZRCola::textindex::value_type)*static_cast(count)); if (!stream.good()) return stream; } else idx.clear(); @@ -795,7 +801,7 @@ inline std::istream& operator >>(_In_ std::istream& stream, _Out_ ZRCola::textin if (count) { // Read keys. idx.keys.resize(count); - stream.read((char*)idx.keys.data(), sizeof(std::vector::value_type)*count); + stream.read((char*)idx.keys.data(), sizeof(std::vector::value_type)*static_cast(count)); if (!stream.good()) return stream; } else idx.keys.clear(); @@ -807,7 +813,7 @@ inline std::istream& operator >>(_In_ std::istream& stream, _Out_ ZRCola::textin if (count) { // Read values. idx.values.resize(count); - stream.read((char*)idx.values.data(), sizeof(std::vector::value_type)*count); + stream.read((char*)idx.values.data(), sizeof(std::vector::value_type)*static_cast(count)); } else idx.values.clear(); diff --git a/lib/libZRCola/include/zrcola/language.h b/lib/libZRCola/include/zrcola/language.h index 0935347..271110d 100644 --- a/lib/libZRCola/include/zrcola/language.h +++ b/lib/libZRCola/include/zrcola/language.h @@ -71,7 +71,7 @@ namespace ZRCola { { this->lang = lang; this->chr_to = static_cast(chr_len); - if (chr_len) memcpy(this->data, chr, sizeof(wchar_t)*chr_len); + if (chr && chr_len) memcpy(this->data, chr, sizeof(wchar_t)*chr_len); } inline const wchar_t* chr () const { return data; }; @@ -235,7 +235,7 @@ namespace ZRCola { { this->lang = lang; this->name_to = static_cast(name_len); - if (name_len) memcpy(this->data, name, sizeof(wchar_t)*name_len); + if (name && name_len) memcpy(this->data, name, sizeof(wchar_t)*name_len); } inline const wchar_t* name () const { return data; }; @@ -341,7 +341,7 @@ inline std::ostream& operator <<(_In_ std::ostream& stream, _In_ const ZRCola::l // Write data. if (stream.fail()) return stream; - stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*count); + stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*static_cast(count)); return stream; } @@ -375,7 +375,7 @@ inline std::istream& operator >>(_In_ std::istream& stream, _Out_ ZRCola::langch if (count) { // Read data. db.data.resize(count); - stream.read((char*)db.data.data(), sizeof(unsigned __int16)*count); + stream.read((char*)db.data.data(), sizeof(unsigned __int16)*static_cast(count)); } else db.data.clear(); @@ -412,7 +412,7 @@ inline std::ostream& operator <<(_In_ std::ostream& stream, _In_ const ZRCola::l // Write data. if (stream.fail()) return stream; - stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*count); + stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*static_cast(count)); return stream; } @@ -440,7 +440,7 @@ inline std::istream& operator >>(_In_ std::istream& stream, _Out_ ZRCola::langua if (count) { // Read data. db.data.resize(count); - stream.read((char*)db.data.data(), sizeof(unsigned __int16)*count); + stream.read((char*)db.data.data(), sizeof(unsigned __int16)*static_cast(count)); } else db.data.clear(); diff --git a/lib/libZRCola/include/zrcola/tag.h b/lib/libZRCola/include/zrcola/tag.h index d4a4e8a..a20258c 100644 --- a/lib/libZRCola/include/zrcola/tag.h +++ b/lib/libZRCola/include/zrcola/tag.h @@ -73,7 +73,7 @@ namespace ZRCola { { this->tag = tag; this->chr_to = static_cast(chr_len); - if (chr_len) memcpy(this->data, chr, sizeof(wchar_t)*chr_len); + if (chr && chr_len) memcpy(this->data, chr, sizeof(wchar_t)*chr_len); } inline const wchar_t* chr () const { return data; }; @@ -271,7 +271,7 @@ namespace ZRCola { this->tag = tag; this->locale = locale; this->name_to = static_cast(name_len); - if (name_len) memcpy(this->data, name, sizeof(wchar_t)*name_len); + if (name && name_len) memcpy(this->data, name, sizeof(wchar_t)*name_len); } inline const wchar_t* name () const { return data; }; @@ -481,7 +481,7 @@ inline std::ostream& operator <<(_In_ std::ostream& stream, _In_ const ZRCola::c // Write data. if (stream.fail()) return stream; - stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*count); + stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*static_cast(count)); return stream; } @@ -513,7 +513,7 @@ inline std::istream& operator >>(_In_ std::istream& stream, _Out_ ZRCola::chrtag if (count) { // Read data. db.data.resize(count); - stream.read((char*)db.data.data(), sizeof(unsigned __int16)*count); + stream.read((char*)db.data.data(), sizeof(unsigned __int16)*static_cast(count)); } else db.data.clear(); @@ -554,7 +554,7 @@ inline std::ostream& operator <<(_In_ std::ostream& stream, _In_ const ZRCola::t // Write data. if (stream.fail()) return stream; - stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*count); + stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*static_cast(count)); return stream; } @@ -586,7 +586,7 @@ inline std::istream& operator >>(_In_ std::istream& stream, _Out_ ZRCola::tagnam if (count) { // Read data. db.data.resize(count); - stream.read((char*)db.data.data(), sizeof(unsigned __int16)*count); + stream.read((char*)db.data.data(), sizeof(unsigned __int16)*static_cast(count)); } else db.data.clear(); diff --git a/lib/libZRCola/include/zrcola/translate.h b/lib/libZRCola/include/zrcola/translate.h index c7411e1..a79d390 100644 --- a/lib/libZRCola/include/zrcola/translate.h +++ b/lib/libZRCola/include/zrcola/translate.h @@ -106,9 +106,9 @@ namespace ZRCola { this->dst_rank = dst_rank; this->src_rank = src_rank; this->dst_to = static_cast(dst_len); - if (dst_len) memcpy(this->data, dst, sizeof(wchar_t)*dst_len); + if (dst && dst_len) memcpy(this->data, dst, sizeof(wchar_t)*dst_len); this->src_to = static_cast(this->dst_to + src_len); - if (src_len) memcpy(this->data + this->dst_to, src, sizeof(wchar_t)*src_len); + if (src && src_len) memcpy(this->data + this->dst_to, src, sizeof(wchar_t)*src_len); } inline const wchar_t* dst () const { return data; }; @@ -369,9 +369,9 @@ namespace ZRCola { { this->set = set; this->src_to = static_cast(src_len); - if (src_len) memcpy(this->data, src, sizeof(wchar_t)*src_len); + if (src && src_len) memcpy(this->data, src, sizeof(wchar_t)*src_len); this->dst_to = static_cast(this->src_to + dst_len); - if (dst_len) memcpy(this->data + this->src_to, dst, sizeof(wchar_t)*dst_len); + if (dst && dst_len) memcpy(this->data + this->src_to, dst, sizeof(wchar_t)*dst_len); } inline const wchar_t* src () const { return data; }; @@ -489,9 +489,9 @@ namespace ZRCola { this->seq = seq; this->rank = rank; this->name_to = static_cast(name_len); - if (name_len) memcpy(this->data, name, sizeof(wchar_t)*name_len); + if (name && name_len) memcpy(this->data, name, sizeof(wchar_t)*name_len); this->sets_to = static_cast(this->name_to + sets_len); - if (sets_len) memcpy(this->data + this->name_to, sets, sizeof(transetid_t)*sets_len); + if (sets && sets_len) memcpy(this->data + this->name_to, sets, sizeof(transetid_t)*sets_len); } inline const wchar_t* name () const { return data; }; @@ -663,7 +663,7 @@ inline std::ostream& operator <<(_In_ std::ostream& stream, _In_ const ZRCola::t // Write data. if (stream.fail()) return stream; - stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*count); + stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*static_cast(count)); return stream; } @@ -695,7 +695,7 @@ inline std::istream& operator >>(_In_ std::istream& stream, _Out_ ZRCola::transl if (count) { // Read data. db.data.resize(count); - stream.read((char*)db.data.data(), sizeof(unsigned __int16)*count); + stream.read((char*)db.data.data(), sizeof(unsigned __int16)*static_cast(count)); } else db.data.clear(); @@ -732,7 +732,7 @@ inline std::ostream& operator <<(_In_ std::ostream& stream, _In_ const ZRCola::t // Write data. if (stream.fail()) return stream; - stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*count); + stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*static_cast(count)); return stream; } @@ -760,7 +760,7 @@ inline std::istream& operator >>(_In_ std::istream& stream, _Out_ ZRCola::transe if (count) { // Read data. db.data.resize(count); - stream.read((char*)db.data.data(), sizeof(unsigned __int16)*count); + stream.read((char*)db.data.data(), sizeof(unsigned __int16)*static_cast(count)); } else db.data.clear(); @@ -801,7 +801,7 @@ inline std::ostream& operator <<(_In_ std::ostream& stream, _In_ const ZRCola::t // Write data. if (stream.fail()) return stream; - stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*count); + stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*static_cast(count)); return stream; } @@ -833,7 +833,7 @@ inline std::istream& operator >>(_In_ std::istream& stream, _Out_ ZRCola::transe if (count) { // Read data. db.data.resize(count); - stream.read((char*)db.data.data(), sizeof(unsigned __int16)*count); + stream.read((char*)db.data.data(), sizeof(unsigned __int16)*static_cast(count)); } else db.data.clear(); diff --git a/lib/libZRCola/src/translate.cpp b/lib/libZRCola/src/translate.cpp index c6c9a35..72fcb92 100644 --- a/lib/libZRCola/src/translate.cpp +++ b/lib/libZRCola/src/translate.cpp @@ -98,7 +98,7 @@ void ZRCola::translation_db::Translate(_In_ transetid_t set, _In_z_count_(inputM } -void ZRCola::translation_db::TranslateInv(_In_ transetid_t set, _In_z_count_(inputMax) const wchar_t* input, _In_ size_t inputMax, _In_ const langchar_db *lc_db, _In_ langid_t lang, _Out_ std::wstring &output, _Out_opt_ std::vector* map) const +void ZRCola::translation_db::TranslateInv(_In_ transetid_t set, _In_z_count_(inputMax) const wchar_t* input, _In_ size_t inputMax, _In_opt_ const langchar_db *lc_db, _In_opt_ langid_t lang, _Out_ std::wstring &output, _Out_opt_ std::vector* map) const { assert(input || inputMax == 0); diff --git a/lib/libZRColaUI/build/libZRColaUI.props b/lib/libZRColaUI/build/libZRColaUI.props index 8d6f896..b0ce79d 100644 --- a/lib/libZRColaUI/build/libZRColaUI.props +++ b/lib/libZRColaUI/build/libZRColaUI.props @@ -9,7 +9,7 @@ - ..\..\stdex\include;..\..\libZRCola\include;%(AdditionalIncludeDirectories) + ..\..\stdex\include;..\..\wxExtend\include;..\..\libZRCola\include;%(AdditionalIncludeDirectories) diff --git a/lib/libZRColaUI/include/zrcolaui/chargroup.h b/lib/libZRColaUI/include/zrcolaui/chargroup.h index 58e5880..83c79b7 100644 --- a/lib/libZRColaUI/include/zrcolaui/chargroup.h +++ b/lib/libZRColaUI/include/zrcolaui/chargroup.h @@ -86,9 +86,9 @@ namespace ZRCola { this->grp = grp; this->rank = rank; this->name_to = static_cast(name_len); - if (name_len) memcpy(this->data, name, sizeof(wchar_t)*name_len); + if (name && name_len) memcpy(this->data, name, sizeof(wchar_t)*name_len); this->chrlst_to = static_cast(this->name_to + chrlst_len); - if (chrlst_len) { + if (chrlst && chrshow && chrlst_len) { memcpy(this->data + this->name_to, chrlst, sizeof(wchar_t)*chrlst_len); memcpy(this->data + this->chrlst_to, chrshow, (chrlst_len + sizeof(*data)*8 - 1)/8); } @@ -220,7 +220,7 @@ inline std::ostream& operator <<(_In_ std::ostream& stream, _In_ const ZRCola::c // Write data. if (stream.fail()) return stream; - stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*count); + stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*static_cast(count)); return stream; } @@ -248,7 +248,7 @@ inline std::istream& operator >>(_In_ std::istream& stream, _Out_ ZRCola::chrgrp if (count) { // Read data. db.data.resize(count); - stream.read((char*)db.data.data(), sizeof(unsigned __int16)*count); + stream.read((char*)db.data.data(), sizeof(unsigned __int16)*static_cast(count)); } else db.data.clear(); diff --git a/lib/libZRColaUI/include/zrcolaui/keyboard.h b/lib/libZRColaUI/include/zrcolaui/keyboard.h index 8e42722..c061a2b 100644 --- a/lib/libZRColaUI/include/zrcolaui/keyboard.h +++ b/lib/libZRColaUI/include/zrcolaui/keyboard.h @@ -24,7 +24,11 @@ #include +#include +#pragma warning(push) +#pragma warning(disable: WXWIDGETS_CODE_ANALYSIS_WARNINGS) #include +#pragma warning(pop) #include #include @@ -81,9 +85,9 @@ namespace ZRCola { _In_opt_ size_t chr_len = 0) { this->chr_to = static_cast(chr_len); - if (chr_len) memcpy(this->data, chr, sizeof(wchar_t)*chr_len); + if (chr && chr_len) memcpy(this->data, chr, sizeof(wchar_t)*chr_len); this->seq_to = static_cast(this->chr_to + seq_count * sizeof(key_t) / sizeof(*data)); - if (seq_count) memcpy(this->data + this->chr_to, seq, sizeof(key_t)*seq_count); + if (seq && seq_count) memcpy(this->data + this->chr_to, seq, sizeof(key_t)*seq_count); } inline const wchar_t* chr () const { return data; }; @@ -324,7 +328,7 @@ inline std::ostream& operator <<(_In_ std::ostream& stream, _In_ const ZRCola::k // Write data. if (stream.fail()) return stream; - stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*count); + stream.write((const char*)db.data.data(), sizeof(unsigned __int16)*static_cast(count)); return stream; } @@ -356,7 +360,7 @@ inline std::istream& operator >>(_In_ std::istream& stream, _Out_ ZRCola::keyseq if (count) { // Read data. db.data.resize(count); - stream.read((char*)db.data.data(), sizeof(unsigned __int16)*count); + stream.read((char*)db.data.data(), sizeof(unsigned __int16)*static_cast(count)); } else db.data.clear(); diff --git a/lib/libZRColaUI/src/keyboard.cpp b/lib/libZRColaUI/src/keyboard.cpp index 668b67b..b4e2b9d 100644 --- a/lib/libZRColaUI/src/keyboard.cpp +++ b/lib/libZRColaUI/src/keyboard.cpp @@ -34,10 +34,10 @@ bool ZRCola::keyseq_db::GetSequenceAsText(_In_count_(seq_len) const keyseq::key_ #if defined(__WXMSW__) // Translate from U.S. Keyboard to scan code. static const HKL s_hkl = ::LoadKeyboardLayout(_T("00000409"), 0); - k = ::MapVirtualKeyEx(k, MAPVK_VK_TO_VSC, s_hkl); + k = static_cast(::MapVirtualKeyEx(k, MAPVK_VK_TO_VSC, s_hkl) & 0xffff); // Translate from scan code to local keyboard. - k = ::MapVirtualKey(k, MAPVK_VSC_TO_VK); + k = static_cast(::MapVirtualKey(k, MAPVK_VSC_TO_VK) & 0xffff); #endif switch (k) { case 0 : return false; @@ -88,7 +88,7 @@ bool ZRCola::keyseq_db::GetSequenceAsText(_In_count_(seq_len) const keyseq::key_ default: #if defined(__WXMSW__) - k = ::MapVirtualKey(k, MAPVK_VK_TO_CHAR); + k = static_cast(::MapVirtualKey(k, MAPVK_VK_TO_CHAR) & 0xffff); #endif str += k; } diff --git a/lib/libZRColaUI/src/pch.h b/lib/libZRColaUI/src/pch.h index 5143fbe..e1aee25 100644 --- a/lib/libZRColaUI/src/pch.h +++ b/lib/libZRColaUI/src/pch.h @@ -23,6 +23,10 @@ #include "../include/zrcolaui/chargroup.h" #include "../include/zrcolaui/keyboard.h" +#include +#pragma warning(push) +#pragma warning(disable: WXWIDGETS_CODE_ANALYSIS_WARNINGS) #include +#pragma warning(pop) #include diff --git a/lib/stdex b/lib/stdex index e6a06ee..325f9d6 160000 --- a/lib/stdex +++ b/lib/stdex @@ -1 +1 @@ -Subproject commit e6a06ee2d1ca316b44ac61ba13cd80fd7b4dd090 +Subproject commit 325f9d6b0849207445f28a3eece7a8c1f4bdb278 diff --git a/lib/wxExtend b/lib/wxExtend index c22a5dd..5fa66f6 160000 --- a/lib/wxExtend +++ b/lib/wxExtend @@ -1 +1 @@ -Subproject commit c22a5dd294be401b93b16d8551e8f0e7163ee331 +Subproject commit 5fa66f625db9095e71b4bbe0fb03a389956700c7