From: Włodzimierz Skiba Date: Tue, 9 Nov 2004 18:48:38 +0000 (+0000) Subject: Warning fixes, IsEmpty->empty. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/bb8a8478124fa273921e96abf0ede83e6c7a6110 Warning fixes, IsEmpty->empty. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30392 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index 9f275a8158..9a102f00c6 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -500,7 +500,7 @@ static bool GetNumericToken(size_t len, const wxChar*& p, unsigned long *number) break; } - return !s.IsEmpty() && s.ToULong(number); + return !s.empty() && s.ToULong(number); } // scans all alphabetic characters and returns the resulting string @@ -542,8 +542,8 @@ wxDateTime::Tm::Tm(const struct tm& tm, const TimeZone& tz) mday = (wxDateTime::wxDateTime_t)tm.tm_mday; mon = (wxDateTime::Month)tm.tm_mon; year = 1900 + tm.tm_year; - wday = tm.tm_wday; - yday = tm.tm_yday; + wday = (wxDateTime::wxDateTime_t)tm.tm_wday; + yday = (wxDateTime::wxDateTime_t)tm.tm_yday; } bool wxDateTime::Tm::IsValid() const @@ -559,7 +559,7 @@ void wxDateTime::Tm::ComputeWeekDay() // compute the week day from day/month/year: we use the dumbest algorithm // possible: just compute our JDN and then use the (simple to derive) // formula: weekday = (JDN + 1.5) % 7 - wday = (wxDateTime::WeekDay)(GetTruncatedJDN(mday, mon, year) + 2) % 7; + wday = (wxDateTime::wxDateTime_t)((wxDateTime::WeekDay)(GetTruncatedJDN(mday, mon, year) + 2) % 7); } void wxDateTime::Tm::AddMonths(int monDiff) @@ -2392,7 +2392,7 @@ wxString wxDateTime::Format(const wxChar *format, const TimeZone& tz) const fmt += *p; } - if ( !fmt.IsEmpty() ) + if ( !fmt.empty() ) { // we've only got the flags and width so far in fmt fmt.Prepend(_T('%')); @@ -2964,7 +2964,7 @@ const wxChar *wxDateTime::ParseFormat(const wxChar *date, wxString am, pm, token = GetAlphaToken(input); GetAmPmStrings(&am, &pm); - if (am.IsEmpty() && pm.IsEmpty()) + if (am.empty() && pm.empty()) return (wxChar *)NULL; // no am/pm strings defined if ( token.CmpNoCase(pm) == 0 ) { diff --git a/src/common/db.cpp b/src/common/db.cpp index 26c397b678..1cc07c08f1 100644 --- a/src/common/db.cpp +++ b/src/common/db.cpp @@ -1013,8 +1013,8 @@ bool wxDb::setConnectionOptions(void) if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO) return(DispAllErrors(henv, hdbc)); - retcode = SQLSetConnectOption(hdbc, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF); - retcode = SQLSetConnectOption(hdbc, SQL_OPT_TRACE, SQL_OPT_TRACE_OFF); + /* retcode = */ SQLSetConnectOption(hdbc, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF); + /* retcode = */ SQLSetConnectOption(hdbc, SQL_OPT_TRACE, SQL_OPT_TRACE_OFF); // SQLSetConnectOption(hdbc, SQL_TXN_ISOLATION, SQL_TXN_READ_COMMITTED); // No dirty reads // By default, MS Sql Server closes cursors on commit and rollback. The following @@ -1026,7 +1026,7 @@ bool wxDb::setConnectionOptions(void) { const long SQL_PRESERVE_CURSORS = 1204L; const long SQL_PC_ON = 1L; - retcode = SQLSetConnectOption(hdbc, SQL_PRESERVE_CURSORS, SQL_PC_ON); + /* retcode = */ SQLSetConnectOption(hdbc, SQL_PRESERVE_CURSORS, SQL_PC_ON); } // Display the connection options to verify them @@ -2192,7 +2192,7 @@ bool wxDb::ExecSql(const wxString &pSqlStmt, wxDbColInf** columns, short& numcol //fill in column information (name, datatype) for (colNum = 0; colNum < noCols; colNum++) { - if (SQLColAttributes(hstmt, colNum+1, SQL_COLUMN_NAME, + if (SQLColAttributes(hstmt, (UWORD)(colNum+1), SQL_COLUMN_NAME, name, sizeof(name), &Sword, &Sdword) != SQL_SUCCESS) { @@ -2203,7 +2203,7 @@ bool wxDb::ExecSql(const wxString &pSqlStmt, wxDbColInf** columns, short& numcol wxStrncpy(pColInf[colNum].colName, name, DB_MAX_COLUMN_NAME_LEN); - if (SQLColAttributes(hstmt, colNum+1, SQL_COLUMN_TYPE, + if (SQLColAttributes(hstmt, (UWORD)(colNum+1), SQL_COLUMN_TYPE, NULL, 0, &Sword, &Sdword) != SQL_SUCCESS) { DispAllErrors(henv, hdbc, hstmt); @@ -2240,7 +2240,7 @@ bool wxDb::ExecSql(const wxString &pSqlStmt, wxDbColInf** columns, short& numcol #ifdef __WXDEBUG__ default: wxString errMsg; - errMsg.Printf(wxT("SQL Data type %d currently not supported by wxWidgets"), Sdword); + errMsg.Printf(wxT("SQL Data type %ld currently not supported by wxWidgets"), (long)Sdword); wxLogDebug(errMsg,wxT("ODBC DEBUG MESSAGE")); #endif } @@ -2371,7 +2371,7 @@ int wxDb::GetKeyFields(const wxString &tableName, wxDbColInf* colInf, UWORD noCo } // while tempStr.Trim(); // Get rid of any unneeded blanks - if (!tempStr.IsEmpty()) + if (!tempStr.empty()) { for (i=0; i