GCC warning fixes
authordpage <dpage@a7884b65-44f6-0310-8a51-81a127f17b15>
Fri, 27 Feb 2009 16:58:10 +0000 (16:58 +0000)
committerdpage <dpage@a7884b65-44f6-0310-8a51-81a127f17b15>
Fri, 27 Feb 2009 16:58:10 +0000 (16:58 +0000)
git-svn-id: svn://svn.pgadmin.org/trunk/pgadmin3@7627 a7884b65-44f6-0310-8a51-81a127f17b15

pgadmin/ctl/ctlSQLBox.cpp
pgadmin/ctl/timespin.cpp
pgadmin/debugger/dlgDirectDbg.cpp
pgadmin/dlg/dlgRole.cpp
pgadmin/dlg/dlgSequence.cpp
pgadmin/frm/frmMaintenance.cpp
pgadmin/frm/frmQuery.cpp
pgadmin/frm/frmStatus.cpp
pgadmin/pgscript/utilities/m_apm/mapm_fft.cpp
pgadmin/schema/edbPackageFunction.cpp

index 4df48e6a260d3d7031d7e7eccb66e7a8374cdd44..5c15ecad8f2b549b70058a5a8bcbc1cb7669f925 100644 (file)
@@ -456,7 +456,7 @@ void ctlSQLBox::OnKeyDown(wxKeyEvent& event)
         // line, up until the current cursor position.
         int x = 0;
         int max = line.Length() - (GetLineEndPosition(GetCurrentLine()) - GetCurrentPos()) - offset;
-        while (line[x] == '\t' || line[x] == ' ' && x < max)
+        while ((line[x] == '\t' || line[x] == ' ') && x < max)
             indent += line[x++];
 
         // Select any indent in front of the cursor to be removed. If
index d4ec260697f8c20101aa78a5ad0cbfd1ac876390..d4d66098816c04d39895e0cd9674123f5384c087 100644 (file)
@@ -327,7 +327,7 @@ void wxTimeSpinCtrl::OnNavigate(wxNavigationKeyEvent &ev)
             tp++;
         else
             tp--;
-        if (tp >= 0 && tp < 3 || (hasDay && tp == 3))
+        if ((tp >= 0 && tp < 3) || (hasDay && tp == 3))
         {
             Highlight(tp);
             return;
index f433982016df786d9bf0b1d03ce9911b54ba749a..c96de27f01dbcd5b463dafbdc93356e109b7de7e 100644 (file)
@@ -598,9 +598,9 @@ void dlgDirectDbg::invokeTargetCallable()
             if (strcmp(tmp, "") == 0)
                 params->paramValues[i] = 0;
             else if (strcmp(tmp, "''") == 0)
-                params->paramValues[i] = "";
+                params->paramValues[i] = (char *)"";
             else if (strcmp(tmp, "\\'\\'") == 0)
-                params->paramValues[i] = "''";
+                params->paramValues[i] = (char *)"''";
             else
                 params->paramValues[i] = tmp;
         }
@@ -614,9 +614,9 @@ void dlgDirectDbg::invokeTargetCallable()
             if (strcmp(tmp, "") == 0)
                 params->paramValues[i] = 0;
             else if (strcmp(tmp, "''") == 0)
-                params->paramValues[i] = "";
+                params->paramValues[i] = (char *)"";
             else if (strcmp(tmp, "\\'\\'") == 0)
-                params->paramValues[i] = "''";
+                params->paramValues[i] = (char *)"''";
             else
                 params->paramValues[i] = tmp;
         }
index 8843f5c4d44750ce2fed785222bf17dfd0d3166d..56605eb4e4bfa7eaf095e71c5bb7f35b8cd2f175 100644 (file)
@@ -254,7 +254,7 @@ void dlgRole::OnOK(wxCommandEvent &ev)
 {
     dlgProperty::OnOK(ev);
 
-    if (role && role->GetCanLogin() != chkCanLogin->GetValue() == !btnOK->IsEnabled())
+    if (role && ((role->GetCanLogin() != chkCanLogin->GetValue()) == !btnOK->IsEnabled()))
     {
         // LOGIN attribute changed successfully; need to put object under different collection
     }
index 176614310d6e4fa8ba3ab1e1381552e7392c733a..675de5f9603ee2a8fe20aa9223bda4ee66df0ea7 100644 (file)
@@ -249,10 +249,12 @@ wxString dlgSequence::GetSql()
                 tmp += wxT("\n   CACHE ") + txtCache->GetValue();
 
             if (chkCycled->GetValue() != sequence->GetCycled())
+            {
                 if (chkCycled->GetValue())
                     tmp += wxT("\n   CYCLE");
                 else
                     tmp += wxT("\n   NO CYCLE");
+            }
 
             if (!tmp.IsEmpty())
             {
index a2b141043375f6c6c1f468665964a5170cbfea1c..4a4153b160011d91d63d59f7c47e0ccc0172b2b6 100644 (file)
@@ -101,7 +101,7 @@ void frmMaintenance::OnAction(wxCommandEvent& ev)
     chkAnalyze->Enable(isVacuum);
 
     bool isReindex = (rbxAction->GetSelection() == 2);
-    sbxReindexOptions->Enable(isReindex && object->GetMetaType() == PGM_DATABASE || object->GetMetaType() == PGM_INDEX || object->GetMetaType() == PGM_PRIMARYKEY || object->GetMetaType() == PGM_UNIQUE);
+    sbxReindexOptions->Enable(isReindex && (object->GetMetaType() == PGM_DATABASE || object->GetMetaType() == PGM_INDEX || object->GetMetaType() == PGM_PRIMARYKEY || object->GetMetaType() == PGM_UNIQUE));
     chkRecreate->Enable(isReindex && object->GetMetaType() == PGM_INDEX);
 }
 
index 215bc60688ba7958197862a094ef90d7484f077d..5bbfe1154d5d9b9d47d67bc9eb5ff5bdc1a9c4a8 100644 (file)
@@ -1470,9 +1470,9 @@ void frmQuery::SetLineEndingStyle()
     bool haveCR = reCR->Matches(sqlQuery->GetText());
     int mode = GetLineEndingStyle();
 
-    if (haveLF && haveCR ||
-        haveLF && haveCRLF ||
-        haveCR && haveCRLF)
+    if ((haveLF && haveCR) ||
+        (haveLF && haveCRLF) ||
+        (haveCR && haveCRLF))
     {
         wxMessageBox(_("This file contains mixed line endings. They will be converted to the current setting."), _("Warning"), wxICON_INFORMATION);
         sqlQuery->ConvertEOLs(mode);
index 3c77a1a05369be45e5a1f646bae1d7a4c825907f..d36e22dc9f974bba267aede9b02ab8a4876c2c3d 100644 (file)
@@ -98,7 +98,7 @@ void ChangeButtonId(wxButton *btn, int id, const wxChar *txt)
 
 long cboToRate(wxComboBox *cbo)
 {
-    long rate;
+    long rate = 0;
 
     if (cbo->GetValue() == _("Don't refresh"))
         rate = 0;
index e2e76daf7a4ef7accc35319b7d634a1a89708ae0..d3467a1dcf36d6d75811bbd7b5d4af31d9339fde 100644 (file)
@@ -48,7 +48,7 @@ extern void   M_cftmdl(int, int, double *);
 static double *M_aa_array, *M_bb_array;
 static int    M_size = -1;
 
-static char   *M_fft_error_msg = "\'M_fast_mul_fft\', Out of memory";
+static char   *M_fft_error_msg = (char *)"\'M_fast_mul_fft\', Out of memory";
 
 /****************************************************************************/
 void   M_free_all_fft()
index f5c6964607e7078034c0b73041476c638413af49..4dddbfc32d0ca412ceb7520c9286b270afed4c8e 100644 (file)
@@ -63,10 +63,12 @@ wxString edbPackageFunction::GetArgListWithNames()
                 arg += qtIdent(argNamesArray.Item(i));\r
 \r
             if (!argModesArray.Item(i).IsEmpty())\r
+            {\r
                 if (arg.IsEmpty())\r
                     arg += argModesArray.Item(i);\r
                 else\r
                     arg += wxT(" ") + argModesArray.Item(i);\r
+            }\r
         }\r
         else\r
         {\r
@@ -74,10 +76,12 @@ wxString edbPackageFunction::GetArgListWithNames()
                 arg += argModesArray.Item(i);\r
 \r
             if (!argNamesArray.Item(i).IsEmpty())\r
+            {\r
                 if (arg.IsEmpty())\r
                     arg += qtIdent(argNamesArray.Item(i));\r
                 else\r
                     arg += wxT(" ") + qtIdent(argNamesArray.Item(i));\r
+            }\r
         }\r
 \r
         if (!arg.IsEmpty())\r