fix warning clang

This commit is contained in:
lsv 2026-03-18 09:09:01 +05:00
parent 2cde1c04f4
commit 2583f616d9
3 changed files with 11 additions and 11 deletions

View file

@ -1047,9 +1047,6 @@ bool pgConn::IsAlive()
int pgConn::GetStatus() const
{
if (!this)
return PGCONN_BAD;
if (conn)
((pgConn *)this)->connStatus = PQstatus(conn);
@ -1246,7 +1243,7 @@ bool pgConn::TableHasColumn(wxString schemaname, wxString tblname, const wxStrin
if (schemaname.IsEmpty())
schemaname = wxT("public");
if (this && GetStatus() == PGCONN_OK)
if (GetStatus() == PGCONN_OK)
{
tblname.Replace(wxT("\\"), wxT("\\\\"));
tblname.Replace(wxT("'"), wxT("''"));

View file

@ -220,7 +220,7 @@ wxSize GetBestSize(wxGrid& grid,
public:
void Draw(wxGrid& grid, wxGridCellAttr& attr, wxDC& dc,
const wxRect& rect, int row, int col, bool isSelected);
const wxRect& rect, int row, int col, bool isSelected) wxOVERRIDE;
CursorCellRenderer(int thous_pixel_sep);
private:
int thousands_pixel_sep;

View file

@ -972,16 +972,16 @@ int FormatterSQL::ParseSql(int flags) {
vi.txt = tmp;
vi.type = keyword;
vi.flags = flg;
if (tmp == "from" && i2 >= 2) {
if (tmp == "from" && i2 >= 2) { // special case "distinct from" this no "from"
wxString s = items[items.size() - 2].txt;
if (s.Len() >= 8 && s.substr(s.Len() - 8).CmpNoCase("distinct") == 0) {
vi.flags = 0;
}
}
if (keyEntities[n].name == "case") {
if (strcmp(keyEntities[n].name,"case") == 0) {
bracket.push(items.size());
}
else if (keyEntities[n].name == "end") {
else if (strcmp(keyEntities[n].name,"end") == 0) {
int idx = -1;
if (bracket.size() > 0) {
idx = bracket.top();
@ -994,14 +994,17 @@ int FormatterSQL::ParseSql(int flags) {
vi.endlevel = idx;
if (idx != -1) items[idx].endlevel = items.size();
} else if (keyEntities[n].name == "then"||
keyEntities[n].name == "loop" ) { // for plpgsql
} else if (strcmp(keyEntities[n].name, "then")== 0 ||
strcmp(keyEntities[n].name,"loop") == 0 ) { // for plpgsql query without ";"
// if ... then
// while ... loop or for .. in query loop
// special break parse query ONLY recurse level == 0
if (bracket.size() == 0) {
i=i+tmp.Len()-1;
i=i+tmp.Len()-1; // skip stop keyword
break;
}
//
}
}
i += tmp.Len() - 1;