diff --git a/pgadmin/ctl/ctlSQLBox.cpp b/pgadmin/ctl/ctlSQLBox.cpp index 06d04e1..4660da7 100644 --- a/pgadmin/ctl/ctlSQLBox.cpp +++ b/pgadmin/ctl/ctlSQLBox.cpp @@ -338,7 +338,9 @@ bool ctlSQLBox::DoFind(const wxString &find, const wxString &replace, bool doRep selEnd = selStart + find.Length(); } - if (selStart >= 0 && selStart != (size_t)(-1)) + // Check condition (selStart > 0 || setStart == 0) instead of (selStart >= 0) + // to fixed the compiler warning. + if ((selStart > 0 || selStart == 0) && selStart != (size_t)(-1)) { if (reverse) { diff --git a/pgadmin/dd/dditems/figures/ddColumnKindIcon.cpp b/pgadmin/dd/dditems/figures/ddColumnKindIcon.cpp index 52b208c..083ef75 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())); } @@ -208,7 +210,9 @@ bool ddColumnKindIcon::uniqueConstraintManager(bool ukCol, hdDrawingView *view, 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); getOwnerColumn()->getOwnerTable()->getUkConstraintsNames().RemoveAt(getOwnerColumn()->getOwnerTable()->getUkConstraintsNames().Count() - 1); - if(i >= 0) + // Check condition (i > 0 || i == 0) instead of (i >= 0) + // to fixed the compiler warning. + if(i > 0 || i == 0) { if(i == getOwnerColumn()->getOwnerTable()->getUkConstraintsNames().Count()) { 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..5b4afa6 100644 --- a/pgadmin/debugger/dbgTargetInfo.cpp +++ b/pgadmin/debugger/dbgTargetInfo.cpp @@ -362,7 +362,9 @@ 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--) + // Check condition (idx > 0 || idx == 0) instead of (idx >= 0) + // to fixed the compiler warning. + for (idx = argCnt - 1; (idx > 0 || idx == 0); idx--) { dbgArgInfo *arg = (dbgArgInfo *)((*m_args)[idx]); @@ -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..a12451d 100644 --- a/pgadmin/dlg/dlgProperty.cpp +++ b/pgadmin/dlg/dlgProperty.cpp @@ -339,11 +339,13 @@ int dlgProperty::Go(bool modal) { if (factory) SetTitle(wxGetTranslation(factory->GetNewString())); - if (cbSchema) + 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..ec9c92f 100644 --- a/pgadmin/gqb/gqbGridRestTable.cpp +++ b/pgadmin/gqb/gqbGridRestTable.cpp @@ -142,7 +142,9 @@ void gqbGridRestTable::AppendItem(gqbQueryRestriction *item) bool gqbGridRestTable::DeleteRows(size_t pos = 0, size_t numRows = 1) { - if(pos >= 0 && numRows == 1) + // Check condition (pos > 0 || pos == 0) instead of (pos >= 0) + // to fixed the compiler warning. + if((pos > 0 || pos == 0) && 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); } }