diff --git a/pgadmin/ctl/ctlSQLBox.cpp b/pgadmin/ctl/ctlSQLBox.cpp index 06d04e1..cf33207 100644 --- a/pgadmin/ctl/ctlSQLBox.cpp +++ b/pgadmin/ctl/ctlSQLBox.cpp @@ -338,7 +338,7 @@ bool ctlSQLBox::DoFind(const wxString &find, const wxString &replace, bool doRep selEnd = selStart + find.Length(); } - if (selStart >= 0 && selStart != (size_t)(-1)) + if (selStart != (size_t)(-1)) { if (reverse) { diff --git a/pgadmin/ctl/ctlSQLGrid.cpp b/pgadmin/ctl/ctlSQLGrid.cpp index 5fd01b9..d82b3ff 100644 --- a/pgadmin/ctl/ctlSQLGrid.cpp +++ b/pgadmin/ctl/ctlSQLGrid.cpp @@ -348,7 +348,7 @@ void ctlSQLGrid::OnLabelDoubleClick(wxGridEvent &event) else // toggle between some predefined sizes { - if (col < colMaxSizes.GetCount() && colMaxSizes[col] >= 0) + if (col < (int)colMaxSizes.GetCount() && colMaxSizes[col] >= 0) extentWant = colMaxSizes[col]; else { @@ -395,7 +395,7 @@ void ctlSQLGrid::OnLabelDoubleClick(wxGridEvent &event) void ctlSQLGrid::AutoSizeColumn(int col, bool setAsMin, bool doLimit) { - if (col < colMaxSizes.GetCount() && colMaxSizes[col] >= 0) + if (col < (int)colMaxSizes.GetCount() && colMaxSizes[col] >= 0) SetColSize(col, colMaxSizes[col]); else wxGrid::AutoSizeColumn(col, setAsMin); @@ -490,7 +490,7 @@ void ctlSQLGrid::AutoSizeColumns(bool setAsMin) { oldSize = GetColSize(col); // Is too wide and no user-specified size - if (oldSize > maxSize && !(col < colMaxSizes.GetCount() && colMaxSizes[col] == -1)) + if (oldSize > maxSize && !(col < (int)colMaxSizes.GetCount() && colMaxSizes[col] == -1)) { totalSize -= oldSize; /* Shrink wide column to maxSize. diff --git a/pgadmin/ctl/ctlSQLResult.cpp b/pgadmin/ctl/ctlSQLResult.cpp index 72b3cc7..1467569 100644 --- a/pgadmin/ctl/ctlSQLResult.cpp +++ b/pgadmin/ctl/ctlSQLResult.cpp @@ -354,7 +354,7 @@ wxString sqlResultTable::GetValue(int row, int col) { wxString data = thread->DataSet()->GetVal(col); - if (data.Length() > settings->GetMaxColSize()) + if (data.Length() > (size_t)settings->GetMaxColSize()) return thread->DataSet()->GetVal(col).Left(settings->GetMaxColSize()) + wxT(" (...)"); else return thread->DataSet()->GetVal(col); diff --git a/pgadmin/dd/dditems/figures/ddColumnKindIcon.cpp b/pgadmin/dd/dditems/figures/ddColumnKindIcon.cpp index 52b208c..7a44a4b 100644 --- a/pgadmin/dd/dditems/figures/ddColumnKindIcon.cpp +++ b/pgadmin/dd/dditems/figures/ddColumnKindIcon.cpp @@ -104,6 +104,8 @@ void ddColumnKindIcon::toggleColumnKind(ddColumnType type, hdDrawingView *view, uniqueConstraintManager(false, view, interaction); } break; + default: + break; } getBasicDisplayBox().SetSize(wxSize(getWidth(), getHeight())); } @@ -206,7 +208,7 @@ bool ddColumnKindIcon::uniqueConstraintManager(bool ukCol, hdDrawingView *view, else //>0 { getOwnerColumn()->getOwnerTable()->getUkConstraintsNames().Add(wxString(wxT("Add new Unique Constraint..."))); - unsigned int i = wxGetSingleChoiceIndex(wxT("Select Unique Key to add Column"), wxT("Select Unique Key to add Column:"), getOwnerColumn()->getOwnerTable()->getUkConstraintsNames(), view); + int i = wxGetSingleChoiceIndex(wxT("Select Unique Key to add Column"), wxT("Select Unique Key to add Column:"), getOwnerColumn()->getOwnerTable()->getUkConstraintsNames(), view); getOwnerColumn()->getOwnerTable()->getUkConstraintsNames().RemoveAt(getOwnerColumn()->getOwnerTable()->getUkConstraintsNames().Count() - 1); if(i >= 0) { diff --git a/pgadmin/dd/dditems/tools/ddColumnTextTool.cpp b/pgadmin/dd/dditems/tools/ddColumnTextTool.cpp index bc741e9..ee097ba 100644 --- a/pgadmin/dd/dditems/tools/ddColumnTextTool.cpp +++ b/pgadmin/dd/dditems/tools/ddColumnTextTool.cpp @@ -59,7 +59,7 @@ bool ddColumnTextTool::callDialog(hdDrawingView *view) int answer = nameAliasDialog->ShowModal(); bool change = false; - if(answer = wxOK) + if(answer == wxOK) { //check if names changed change = ! (colShortName.IsSameAs(nameAliasDialog->GetValue1()) && colShortName.IsSameAs(nameAliasDialog->GetValue2())); diff --git a/pgadmin/debugger/dbgController.cpp b/pgadmin/debugger/dbgController.cpp index b4f2054..f60608f 100644 --- a/pgadmin/debugger/dbgController.cpp +++ b/pgadmin/debugger/dbgController.cpp @@ -795,6 +795,8 @@ bool dbgController::Stop() } } break; + default: + break; } if (m_dbgThread) diff --git a/pgadmin/debugger/dbgTargetInfo.cpp b/pgadmin/debugger/dbgTargetInfo.cpp index 7200017..9de2d36 100644 --- a/pgadmin/debugger/dbgTargetInfo.cpp +++ b/pgadmin/debugger/dbgTargetInfo.cpp @@ -362,7 +362,7 @@ dbgTargetInfo::dbgTargetInfo(Oid _target, pgConn *_conn) argCnt = m_args->GetCount(); // Set the default as the value for the argument - for (idx = argCnt - 1; idx >= 0; idx--) + for (idx = argCnt - 1;; idx--) { dbgArgInfo *arg = (dbgArgInfo *)((*m_args)[idx]); @@ -381,6 +381,8 @@ dbgTargetInfo::dbgTargetInfo(Oid _target, pgConn *_conn) break; } } + if (idx == 0) + break; } } } @@ -404,7 +406,7 @@ dbgArgInfo *dbgTargetInfo::operator[](int index) dbgArgInfo::dbgArgInfo(const wxString &_name, const wxString &_type, Oid _typeOid, short _mode) : m_name(_name), m_type(_type), m_typeOid(_typeOid), m_mode(_mode), - m_hasDefault(false), m_useDefault(false), m_null(NULL) + m_hasDefault(false), m_useDefault(false), m_null(false) { if (!_type.EndsWith(wxT("[]"), &m_baseType)) { diff --git a/pgadmin/dlg/dlgProperty.cpp b/pgadmin/dlg/dlgProperty.cpp index 7bb17f6..5518026 100644 --- a/pgadmin/dlg/dlgProperty.cpp +++ b/pgadmin/dlg/dlgProperty.cpp @@ -340,10 +340,12 @@ int dlgProperty::Go(bool modal) if (factory) SetTitle(wxGetTranslation(factory->GetNewString())); if (cbSchema) + { if (obj->GetMetaType() == PGM_SCHEMA) cbSchema->SetValue(obj->GetName()); else cbSchema->SetValue(obj->GetSchema()->GetName()); + } } if (statusBar) statusBar->SetStatusText(wxEmptyString); diff --git a/pgadmin/gqb/gqbGridRestTable.cpp b/pgadmin/gqb/gqbGridRestTable.cpp index 285065a..43bd379 100644 --- a/pgadmin/gqb/gqbGridRestTable.cpp +++ b/pgadmin/gqb/gqbGridRestTable.cpp @@ -142,7 +142,7 @@ void gqbGridRestTable::AppendItem(gqbQueryRestriction *item) bool gqbGridRestTable::DeleteRows(size_t pos = 0, size_t numRows = 1) { - if(pos >= 0 && numRows == 1) + if((pos < (size_t)GetNumberRows()) && numRows == 1) { gqbQueryRestriction *r = restrictions->getRestrictionAt(pos); restrictions->removeRestriction(r); diff --git a/pgadmin/hotdraw/utilities/hdGeometry.cpp b/pgadmin/hotdraw/utilities/hdGeometry.cpp index f2118a5..44ce0a5 100644 --- a/pgadmin/hotdraw/utilities/hdGeometry.cpp +++ b/pgadmin/hotdraw/utilities/hdGeometry.cpp @@ -172,7 +172,7 @@ bool hdGeometry::intersection(hdPoint p1, hdPoint p2, hdPoint p3, hdPoint p4) float d = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4); // If d is zero, there is no intersection - if (d == 0) return NULL; + if (d == 0) return false; // Get the x and y float pre = (x1 * y2 - y1 * x2), post = (x3 * y4 - y3 * x4); diff --git a/pgadmin/ogl/lines.cpp b/pgadmin/ogl/lines.cpp index e5eef51..703d2e3 100644 --- a/pgadmin/ogl/lines.cpp +++ b/pgadmin/ogl/lines.cpp @@ -990,11 +990,7 @@ void wxLineShape::OnMoveLink(bool moveControlPoints) FindLineEndPoints(&end_x, &end_y, &other_end_x, &other_end_y); wxNode *first = m_lineControlPoints->GetFirst(); - /* wxRealPoint *first_point = */ - (wxRealPoint *)first->GetData(); wxNode *last = m_lineControlPoints->GetLast(); - /* wxRealPoint *last_point = */ - (wxRealPoint *)last->GetData(); /* This is redundant, surely? Done by SetEnds. first_point->x = end_x; first_point->y = end_y; @@ -1049,11 +1045,7 @@ void wxLineShape::FindLineEndPoints(double *fromX, double *fromY, double *toX, d double other_end_x, other_end_y; wxNode *first = m_lineControlPoints->GetFirst(); - /* wxRealPoint *first_point = */ - (wxRealPoint *)first->GetData(); wxNode *last = m_lineControlPoints->GetLast(); - /* wxRealPoint *last_point = */ - (wxRealPoint *)last->GetData(); wxNode *second = first->GetNext(); wxRealPoint *second_point = (wxRealPoint *)second->GetData(); diff --git a/pgadmin/utils/factory.cpp b/pgadmin/utils/factory.cpp index 083b44b..56dd1dd 100644 --- a/pgadmin/utils/factory.cpp +++ b/pgadmin/utils/factory.cpp @@ -230,7 +230,7 @@ menuFactoryList::~menuFactoryList() { while (GetCount()) { - delete (actionFactory *)Item(0); + delete (menuFactory *)Item(0); RemoveAt(0); } }