From: root Date: Mon, 18 Jan 2010 12:41:24 +0000 (+0800) Subject: supressing gcc warning X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=101b4fc27540f7ef1eaeb5118b12be0ae995b1fa;p=users%2Fquan74%2Fpgadmin-import.git supressing gcc warning --- diff --git a/pgadmin/frm/frmImport.cpp b/pgadmin/frm/frmImport.cpp index 702a6b529..d27f17ca5 100755 --- a/pgadmin/frm/frmImport.cpp +++ b/pgadmin/frm/frmImport.cpp @@ -838,7 +838,8 @@ void frmImport::OnArchFilePathKillFocus(wxFocusEvent &ev) { if (txtArchFilePath->IsModified()) { - OnArchFileChange(&txtArchFilePath->GetValue()); + wxString archfilepath = txtArchFilePath->GetValue(); + OnArchFileChange(&archfilepath); txtArchFilePath->SetModified(false); } } @@ -1455,7 +1456,7 @@ void frmImport::ImportData() } bool logerror = chkLogError->GetValue(); - bool logwarn = chkLogWarn->GetValue(); + //bool logwarn = chkLogWarn->GetValue(); bool logstmt = chkLogStmt->GetValue(); bool loginfo = chkLogInfo->GetValue(); bool logproc = chkLogInfo->GetValue(); @@ -1799,6 +1800,11 @@ void frmImport::ImportData() else imponlyrows = spinFileImpOnlyRows->GetValue(); } + else + { + skipemptyline = false; + skipfirstrows = false; + } int commitevery = spinCommitEvery->GetValue(); int stoponerror = spinStopOnError->GetValue(); @@ -1835,7 +1841,7 @@ void frmImport::ImportData() wxString impdatalist, insstmt, rowlog; wxChar imptranssn[32]; bool copybolcking = false; - bool rowdataok; + bool rowdataisok; int commres; while (true) @@ -2079,13 +2085,15 @@ void frmImport::ImportData() rowlog.Empty(); if (m_datasrctype==TEXTFILEPAGE || m_datasrctype==ARCHFILEPAGE) - rowdataok = GenCSVSQLData(impdatalist, rowlog, linevals, valsnum, clienttime, impmode, fmtstyle); + rowdataisok = GenCSVSQLData(impdatalist, rowlog, linevals, valsnum, clienttime, impmode, fmtstyle); #if defined(__WXMSW__) || defined(__WITHIODBC__) || defined(__WITHUNIXODBC__) else if (m_datasrctype==SRCODBCPAGE) - rowdataok = GenODBCSQLData(impdatalist, rowlog, odbcrowdata, clienttime, impmode); + rowdataisok = GenODBCSQLData(impdatalist, rowlog, odbcrowdata, clienttime, impmode); #endif + else + rowdataisok = false; - if (rowdataok) + if (rowdataisok) { if (impmode==IMPORTMODECOPY) { @@ -3037,7 +3045,7 @@ bool frmImport::CheckWizardPage() bool isvalid = false; - int impdest; + int impdest = IMPDESTNONE; if (m_curpagenr==DESTLOGPAGE) impdest = (int)chcImpDest->GetClientData(chcImpDest->GetSelection()); @@ -3418,7 +3426,6 @@ void frmImport::GenColsPreview() bool rowhaserr, normtrans = true; m_datapverr = false; - int errcount = 0; size_t dbcolidx, pvgridrowidx = 0, pvgridcolidx, datpvrownr; wxDateTime clienttime; @@ -3776,7 +3783,6 @@ void frmImport::GenColsPreview() { bool firstrowisheader = chkFileFirstRowIsHeader->GetValue(); bool chktruefirst = chkFileCheckTrueFirst->GetValue(); - bool skipemptyline = chkFileSkipEmptyRow->GetValue(); datpvrownr = firstrowisheader?1:0; @@ -4196,7 +4202,7 @@ bool frmImport::GenCSVSQLData(wxString& rowdatalist, wxString& rowlog, wxString* bool isfirstcol = true, haserror = false; wxDateTime tsfromval; - size_t dbcolidx, pvgridrowidx = 0, pvgridcolidx; + size_t dbcolidx, /*pvgridrowidx = 0, */pvgridcolidx; wxString curcdate = clienttime.FormatISODate(); wxString curctime = clienttime.FormatISOTime(); @@ -4556,7 +4562,7 @@ bool frmImport::GenODBCSQLData(wxString& rowvals, wxString& rowlog, SQLWCHAR** o wxDateTime tsfromval; SQLSMALLINT odbccoltype; - size_t dbcolidx, pvgridrowidx = 0, pvgridcolidx; + size_t dbcolidx, pvgridcolidx; wxString curcdate = clienttime.FormatISODate(); wxString curctime = clienttime.FormatISOTime(); @@ -5513,7 +5519,6 @@ void frmImport::ResetColSettingSrcColEditor(bool resetsrccol) #endif else { - bool firstish = chkFileFirstRowIsHeader->GetValue(); for (rowidx=(size_t)0; rowidxSetCellEditor(rowidx, SRCCOLNAMENUM, new pgGridCellChioceEditor()); @@ -6188,7 +6193,7 @@ void frmImport::ParseColsImpSetting(int dbcolnr) bool isfirstcol = true, origcolerr; int wrncnt=0; - int origsrccolnr; + int origsrccolnr = wxNOT_FOUND; #if defined(__WXMSW__) || defined(__WITHIODBC__) || defined(__WITHUNIXODBC__) SQLSMALLINT stmtcolsnum, *stmttypes; @@ -6824,7 +6829,6 @@ frmImport::exprSnippet *frmImport::ParseImportExpr(const wxString& origexpr) long colpos; wxString parsedsnip, colname; exprSnippet *exprsnip = NULL, *cursnip = NULL; - bool incoldef = false; while(exprdata[dataidx]) { diff --git a/pgadmin/utils/pgcsvfile.cpp b/pgadmin/utils/pgcsvfile.cpp index 321270997..f228a87d4 100755 --- a/pgadmin/utils/pgcsvfile.cpp +++ b/pgadmin/utils/pgcsvfile.cpp @@ -1193,7 +1193,7 @@ wxFileOffset pgCSVFile::GenMoreFilePreview(wxString *pvstr) if (leftbyte) memcpy(readbuf+MAXWORDSZ-leftbyte, bufdata + m_pvdecoffset, leftbyte); - wxCSConv *txtconv; + wxCSConv *txtconv = NULL; #if wxUSE_STREAMS && wxUSE_ARCHIVE_STREAMS && (wxUSE_ZIPSTREAM || wxUSE_TARSTREAM) #if wxUSE_ZIPSTREAM if (m_zipinstrm) @@ -1483,7 +1483,7 @@ wxString **pgCSVFile::ParseLine(const wxChar *csvdata, size_t *parsedoffset, boo { *curcolnr = (size_t)0; parsedvals = new wxString *[m_widthdlmsnum]; - memset(parsedvals, NULL, sizeof(parsedvals)*m_widthdlmsnum); + memset(parsedvals, 0, sizeof(parsedvals)*m_widthdlmsnum); } if (curval)