From 0f91ec5e67aa820092634ca9ac64a7b3c815988b Mon Sep 17 00:00:00 2001 From: lsv Date: Thu, 16 Oct 2025 09:24:07 +0500 Subject: [PATCH] fix warning for mingw32 --- ctl/ctlNavigatePanel.cpp | 8 ++++++-- ctl/ctlSQLBox.cpp | 8 +++++--- ctl/ctlSQLGrid.cpp | 12 ++++++++---- ctl/ctlTreeJSON.cpp | 5 ++++- dlg/dlgFunction.cpp | 9 ++++++--- dlg/dlgProJob.cpp | 8 ++++---- dlg/dlgSelectConnection.cpp | 4 ++-- frm/frmQuery.cpp | 16 +++++++++------- frm/mathplot.cpp | 6 +++--- include/ctl/ctlSQLGrid.h | 2 +- schema/pgPartition.cpp | 2 +- schema/pgRole.cpp | 8 ++++++-- 12 files changed, 55 insertions(+), 33 deletions(-) diff --git a/ctl/ctlNavigatePanel.cpp b/ctl/ctlNavigatePanel.cpp index 794cbfb..72bdca3 100644 --- a/ctl/ctlNavigatePanel.cpp +++ b/ctl/ctlNavigatePanel.cpp @@ -184,8 +184,12 @@ void ctlNavigatePanel::Init(bool reorganization) { wxString strcolor = indicator["color"].AsString(); wxColour cc(strcolor); statistics_mark el{0,enable,cc}; - if (!reorganization) - if (cc.IsOk()) mark_color.push_back(el); else mark_color.push_back(statistics_mark { 0, false,*wxBLACK }); + if (!reorganization) { + if (cc.IsOk()) + mark_color.push_back(el); + else + mark_color.push_back(statistics_mark { 0, false,*wxBLACK }); + } //search_rule wxJSONValue inc = indicator["include"]; wxJSONValue exc = indicator["exclude"]; diff --git a/ctl/ctlSQLBox.cpp b/ctl/ctlSQLBox.cpp index 1de38b7..3af8fe2 100644 --- a/ctl/ctlSQLBox.cpp +++ b/ctl/ctlSQLBox.cpp @@ -818,8 +818,10 @@ void ctlSQLBox::OnKeyDown(wxKeyEvent &event) bool isAddDict = false; s = GetTextRange(homewordpos, pos); if (uc != WXK_NONE) - if (uc == 8) s = s.Left(s.length() - 1); - else if (uc >= 'A') s += uc; + { + if (uc == 8) {s = s.Left(s.length() - 1);} + else {if (uc >= 'A') s += uc;} + } if (uc >= ' ' && uc < 'A') isAddDict = true; auto it = m_hint_words.lower_bound(s); wxString strlist; @@ -1459,7 +1461,7 @@ std::pair ctlSQLBox::SelectQuery(int startposition) int pend=endPos; int pstart=0; - if ((ch == ';')) { + if (ch == ';') { pend=pos; pos=pos-1; } else diff --git a/ctl/ctlSQLGrid.cpp b/ctl/ctlSQLGrid.cpp index 4ac24b5..2229744 100644 --- a/ctl/ctlSQLGrid.cpp +++ b/ctl/ctlSQLGrid.cpp @@ -315,12 +315,16 @@ wxString ctlSQLGrid::GetExportLine(int row, wxArrayInt cols) if (text.Length() != 0) { text.Replace(wxT("'"), wxT("''")); } - else text = wxT("null"); + else + text = wxT("null"); } - if (generatesql == 3) if (text == "null") str.Append(cname).Append(" is "); else - str.Append(cname).Append("="); - + if (generatesql == 3) { + if (text == "null") + str.Append(cname).Append(" is "); + else + str.Append(cname).Append("="); + } if (needQuote) str.Append(qtsimbol); diff --git a/ctl/ctlTreeJSON.cpp b/ctl/ctlTreeJSON.cpp index 50aaca1..9f16051 100644 --- a/ctl/ctlTreeJSON.cpp +++ b/ctl/ctlTreeJSON.cpp @@ -130,9 +130,12 @@ void ctlTreeJSON::BuildFind() { item = nextTreeItem(item); } if (findsId.size() > 0) - if (last.IsOk())SelectItem(last); + { + if (last.IsOk()) + SelectItem(last); else wxBell(); + } } wxTreeItemId ctlTreeJSON::nextTreeItem(const wxTreeItemId& item) { wxTreeItemId child; diff --git a/dlg/dlgFunction.cpp b/dlg/dlgFunction.cpp index be3cd98..b9617db 100644 --- a/dlg/dlgFunction.cpp +++ b/dlg/dlgFunction.cpp @@ -1053,9 +1053,12 @@ wxString dlgFunction::GetSql() { name = name + wxT("(") + GetArgs(false, true) + wxT(")"); - if (cbOwner->GetCurrentSelection() > 0) - if (!isProcedure) AppendOwnerNew(sql, wxT("FUNCTION ") + name); - else AppendOwnerNew(sql, wxT("PROCEDURE ") + name); + if (cbOwner->GetCurrentSelection() > 0) { + if (!isProcedure) + AppendOwnerNew(sql, wxT("FUNCTION ") + name); + else + AppendOwnerNew(sql, wxT("PROCEDURE ") + name); + } } if (false) diff --git a/dlg/dlgProJob.cpp b/dlg/dlgProJob.cpp index 42de4ab..ae41e0d 100644 --- a/dlg/dlgProJob.cpp +++ b/dlg/dlgProJob.cpp @@ -234,9 +234,9 @@ wxString dlgProJob::StrAttribute(const wxString &name,const wxString &value) void dlgProJob::append(wxString& str, const wxString& delimiter, const wxString& what) { if (!what.IsNull()) - if(str.IsNull()) str += what; + if(str.IsNull()) {str += what;} else - str += delimiter + what; + {str += delimiter + what;} } wxString dlgProJob::GetSql() { @@ -246,9 +246,9 @@ wxString dlgProJob::GetSql() { // edit mode if (chkEnabled->GetValue() != job->GetEnabled()) - if (chkEnabled->GetValue()) sql = wxT("select schedule.activate_job(") + NumToStr(job->GetRecId()) + wxT(");\n"); + if (chkEnabled->GetValue()) {sql = wxT("select schedule.activate_job(") + NumToStr(job->GetRecId()) + wxT(");\n");} else - sql = wxT("select schedule.deactivate_job(") + NumToStr(job->GetRecId()) + wxT(");\n"); + {sql = wxT("select schedule.deactivate_job(") + NumToStr(job->GetRecId()) + wxT(");\n");} wxString att; diff --git a/dlg/dlgSelectConnection.cpp b/dlg/dlgSelectConnection.cpp index 0c47285..322b2ec 100644 --- a/dlg/dlgSelectConnection.cpp +++ b/dlg/dlgSelectConnection.cpp @@ -141,9 +141,9 @@ void dlgSelectConnection::OnChangeServer(wxCommandEvent &ev) if (cbDatabase->GetCount()) if (item2>=0) - cbDatabase->SetSelection(item2); + {cbDatabase->SetSelection(item2);} else - cbDatabase->SetSelection(item); + {cbDatabase->SetSelection(item);} pgSetIterator set2(remoteServer->GetConnection(), wxT("SELECT DISTINCT usename\n") diff --git a/frm/frmQuery.cpp b/frm/frmQuery.cpp index a86903f..dc7dc3e 100644 --- a/frm/frmQuery.cpp +++ b/frm/frmQuery.cpp @@ -2826,13 +2826,14 @@ void frmQuery::OnExplain(wxCommandEvent &event) } wxString query = sqlQuery->GetSelectedText(); - if (query.IsNull()) + if (query.IsNull()) { if (queryMenu->IsChecked(MNU_AUTOSELECTQUERY)) { // Auto-select SelectQuery(); query = sqlQuery->GetSelectedText(); - } else query = sqlQuery->GetText(); - + } else + query = sqlQuery->GetText(); + } if (query.IsNull()) return; wxString sql; @@ -3032,13 +3033,14 @@ void frmQuery::OnExecute(wxCommandEvent &event) CheckModificationFile(); SaveTempFile(); wxString query = sqlQuery->GetSelectedText(); - if (query.IsNull()) + if (query.IsNull()) { if (queryMenu->IsChecked(MNU_AUTOSELECTQUERY)) { // Auto-select SelectQuery(); query = sqlQuery->GetSelectedText(); - } else query = sqlQuery->GetText(); - + } else + query = sqlQuery->GetText(); + } if (query.IsNull()) return; // set marker sqlQueryExec->MarkerAdd(line, 0); // wxSTC_MARK_CIRCLE @@ -3123,7 +3125,7 @@ void frmQuery::OnExecScript(wxCommandEvent &event) // Clear markers and indicators sqlQuery->MarkerDeleteAll(0); - sqlQuery->StartStyling(0, wxSTC_INDICS_MASK); + sqlQuery->StartStyling(0); sqlQuery->SetStyling(sqlQuery->GetText().Length(), 0); // Menu stuff to initialize diff --git a/frm/mathplot.cpp b/frm/mathplot.cpp index cc06670..75b2bc0 100644 --- a/frm/mathplot.cpp +++ b/frm/mathplot.cpp @@ -604,9 +604,9 @@ void mpFXY::Plot(wxDC &dc, mpWindow &w) { Rewind(); GetNextXY(x, y); maxDrawX = 0; - minDrawX = 10000000000; + minDrawX = 1000000000; maxDrawY = 0; - minDrawY = 10000000000; + minDrawY = 1000000000; // drawnPoints = 0; Rewind(); @@ -886,7 +886,7 @@ wxString mpScaleX::GetLabelTextValue(double &v) { fmt = (wxT("%04.0f-%02.0f-%02.0f %02.0f:%02.0f:%02.0f")); } else if (m_labelType == mpX_DATE) { fmt = (wxT("%04.0f-%02.0f-%02.0f")); - } else if ((m_labelType == mpX_TIME)) { + } else if (m_labelType == mpX_TIME) { fmt = (wxT("%02.0f:%02.3f")); } else { fmt = (wxT("%02.0f:%02.0f:%02.0f")); diff --git a/include/ctl/ctlSQLGrid.h b/include/ctl/ctlSQLGrid.h index 4eb1b78..6cddd5c 100644 --- a/include/ctl/ctlSQLGrid.h +++ b/include/ctl/ctlSQLGrid.h @@ -243,7 +243,7 @@ public: { wxColor color; color.Set(239, 228, 176); - if (sPos = text.Find(wxT('\n')) != wxNOT_FOUND) { + if ((sPos = text.Find(wxT('\n'))) != wxNOT_FOUND) { dc.SetBrush(*wxTheBrushList->FindOrCreateBrush(color)); multiline = true; } diff --git a/schema/pgPartition.cpp b/schema/pgPartition.cpp index d13674e..8702e45 100644 --- a/schema/pgPartition.cpp +++ b/schema/pgPartition.cpp @@ -473,7 +473,7 @@ pgPartitionFactory::pgPartitionFactory() : pgTableObjFactory(__("Partition"), __("New Partition..."), __("Create a new Partition."), table_png_img, table_sm_png_img) { metaType = PGM_TABLE; - typeName = wxT("TABLE"); + typeName = (wxChar *) L"TABLE"; } pgCollection *pgPartitionFactory::CreateCollection(pgObject *obj) diff --git a/schema/pgRole.cpp b/schema/pgRole.cpp index 2297682..24839ed 100644 --- a/schema/pgRole.cpp +++ b/schema/pgRole.cpp @@ -587,8 +587,12 @@ void pgRole::ShowTreeDetail(ctlTree *browser, frmMain *form, ctlListView *proper if (roles.GetBool(wxT("admin_option"))) opt += "A"; if (GetConnection()->BackendMinimumVersion(16, 0)) { - if (GetInherits() != roles.GetBool(wxT("inherit_option"))) - if (roles.GetBool(wxT("inherit_option"))) opt += "I"; else opt += "i"; + if (GetInherits() != roles.GetBool(wxT("inherit_option"))) { + if (roles.GetBool(wxT("inherit_option"))) + opt += "I"; + else + opt += "i"; + } if (!roles.GetBool(wxT("set_option"))) opt += "s"; }