From: George Tasker Date: Mon, 11 Jun 2001 16:54:28 +0000 (+0000) Subject: Changed the 'true's and 'false's back to TRUE and FALSE X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a144affed28cbd6828dfbe8c17b4cac989e7a6b3 Changed the 'true's and 'false's back to TRUE and FALSE git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10540 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/db.h b/include/wx/db.h index 708d6d74b2..29efb2b3a6 100644 --- a/include/wx/db.h +++ b/include/wx/db.h @@ -98,7 +98,7 @@ enum enumDummy {enumDum1}; #define SQL_C_BLOB SQL_VARBINARY #endif #endif - +/* #ifndef TRUE #define TRUE true #endif @@ -106,7 +106,7 @@ enum enumDummy {enumDum1}; #ifndef FALSE #define FALSE false #endif - +*/ const int wxDB_PATH_MAX = 254; extern wxChar const *SQL_LOG_FILENAME; @@ -586,7 +586,7 @@ public: bool DispAllErrors(HENV aHenv, HDBC aHdbc = SQL_NULL_HDBC, HSTMT aHstmt = SQL_NULL_HSTMT); bool GetNextError(HENV aHenv, HDBC aHdbc = SQL_NULL_HDBC, HSTMT aHstmt = SQL_NULL_HSTMT); void DispNextError(void); - bool CreateView(const wxString &viewName, const wxString &colList, const wxString &pSqlStmt, bool attemptDrop=true); + bool CreateView(const wxString &viewName, const wxString &colList, const wxString &pSqlStmt, bool attemptDrop=TRUE); bool DropView(const wxString &viewName); bool ExecSql(const wxString &pSqlStmt); bool GetNext(void); @@ -628,7 +628,7 @@ public: { logError(errMsg, SQLState); } void SetDebugErrorMessages(bool state) { silent = !state; } bool SetSqlLogging(wxDbSqlLogState state, const wxString &filename = SQL_LOG_FILENAME, - bool append = false); + bool append = FALSE); bool WriteSqlLog(const wxString &logMsg); wxDBMS Dbms(void); @@ -697,7 +697,7 @@ bool WXDLLEXPORT wxDbSqlLog(wxDbSqlLogState state, const wxString &filename = #if 0 // MSW/VC6 ONLY!!! Experimental int WXDLLEXPORT wxDbCreateDataSource(const wxString &driverName, const wxString &dsn, const wxString &description=wxEmptyString, - bool sysDSN=false, const wxString &defDir=wxEmptyString, wxWindow *parent=NULL); + bool sysDSN=FALSE, const wxString &defDir=wxEmptyString, wxWindow *parent=NULL); #endif // This routine allows you to query a driver manager diff --git a/include/wx/dbgrid.h b/include/wx/dbgrid.h index 8b6bf5d49a..a55ccfdcad 100644 --- a/include/wx/dbgrid.h +++ b/include/wx/dbgrid.h @@ -106,7 +106,7 @@ class wxDbGridTableBase : public wxGridTableBase { public: wxDbGridTableBase(wxDbTable *tab, wxDbGridColInfo *ColInfo, - int count = wxUSE_QUERY, bool takeOwnership = true); + int count = wxUSE_QUERY, bool takeOwnership = TRUE); ~wxDbGridTableBase(); virtual int GetNumberRows() @@ -138,12 +138,12 @@ public: virtual wxString wxDbGridTableBase::GetColLabelValue(int col); - virtual bool AssignDbTable(wxDbTable *tab, int count = wxUSE_QUERY, bool takeOwnership=true); + virtual bool AssignDbTable(wxDbTable *tab, int count = wxUSE_QUERY, bool takeOwnership=TRUE); virtual void ValidateRow(int row); virtual bool UpdateRow(int row) const { if (m_row != row) - return true; + return TRUE; else return Writeback(); } diff --git a/include/wx/dbtable.h b/include/wx/dbtable.h index 9c990ebfe3..c23c72370d 100644 --- a/include/wx/dbtable.h +++ b/include/wx/dbtable.h @@ -41,8 +41,8 @@ const int wxDB_ROWID_LEN = 24; // 18 is the max, 24 is in case it gets larger const int wxDB_DEFAULT_CURSOR = 0; -const bool wxDB_QUERY_ONLY = true; -const bool wxDB_DISABLE_VIEW = true; +const bool wxDB_QUERY_ONLY = TRUE; +const bool wxDB_DISABLE_VIEW = TRUE; // Used to indicate end of a variable length list of // column numbers passed to member functions @@ -64,7 +64,7 @@ public: SWORD SqlCtype; // C data type; e.g. SQL_C_LONG void *PtrDataObj; // Address of the data object int SzDataObj; // Size, in bytes, of the data object - bool KeyField; // true if this column is part of the PRIMARY KEY to the table; Date fields should NOT be KeyFields. + bool KeyField; // TRUE if this column is part of the PRIMARY KEY to the table; Date fields should NOT be KeyFields. bool Updateable; // Specifies whether this column is updateable bool InsertAllowed; // Specifies whether this column should be included in an INSERT statement bool DerivedCol; // Specifies whether this column is a derived value @@ -199,11 +199,11 @@ public: virtual ~wxDbTable(); - bool Open(bool checkPrivileges=false, bool checkTableExists=true); - bool CreateTable(bool attemptDrop=true); + bool Open(bool checkPrivileges=FALSE, bool checkTableExists=TRUE); + bool CreateTable(bool attemptDrop=TRUE); bool DropTable(void); bool CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCols, - wxDbIdxDef *pIdxDefs, bool attemptDrop=true); + wxDbIdxDef *pIdxDefs, bool attemptDrop=TRUE); bool DropIndex(const wxString &idxName); // Accessors @@ -246,10 +246,10 @@ public: bool Delete(void); bool DeleteWhere(const wxString &pWhereClause); bool DeleteMatching(void); - virtual bool Query(bool forUpdate = false, bool distinct = false); + virtual bool Query(bool forUpdate = FALSE, bool distinct = FALSE); bool QueryBySqlStmt(const wxString &pSqlStmt); - bool QueryMatching(bool forUpdate = false, bool distinct = false); - bool QueryOnKeyFields(bool forUpdate = false, bool distinct = false); + bool QueryMatching(bool forUpdate = FALSE, bool distinct = FALSE); + bool QueryOnKeyFields(bool forUpdate = FALSE, bool distinct = FALSE); bool Refresh(void); bool GetNext(void) { return(getRec(SQL_FETCH_NEXT)); } bool operator++(int) { return(getRec(SQL_FETCH_NEXT)); } @@ -273,8 +273,8 @@ public: void BuildUpdateStmt(wxString &pSqlStmt, int typeOfUpd, const wxString &pWhereClause=""); void BuildUpdateStmt(wxChar *pSqlStmt, int typeOfUpd, const wxString &pWhereClause=""); - void BuildWhereClause(wxString &pWhereClause, int typeOfWhere, const wxString &qualTableName="", bool useLikeComparison=false); - void BuildWhereClause(wxChar *pWhereClause, int typeOfWhere, const wxString &qualTableName="", bool useLikeComparison=false); + void BuildWhereClause(wxString &pWhereClause, int typeOfWhere, const wxString &qualTableName="", bool useLikeComparison=FALSE); + void BuildWhereClause(wxChar *pWhereClause, int typeOfWhere, const wxString &qualTableName="", bool useLikeComparison=FALSE); #if wxODBC_BACKWARD_COMPATABILITY // The following member functions are deprecated. You should use the BuildXxxxxStmt functions (above) @@ -285,42 +285,42 @@ public: void GetUpdateStmt(char *pSqlStmt, int typeOfUpd, const char *pWhereClause = NULL) { BuildUpdateStmt(pSqlStmt,typeOfUpd,pWhereClause); } void GetWhereClause(char *pWhereClause, int typeOfWhere, - const char *qualTableName = NULL, bool useLikeComparison=false) + const char *qualTableName = NULL, bool useLikeComparison=FALSE) { BuildWhereClause(pWhereClause,typeOfWhere,qualTableName,useLikeComparison); } #endif bool CanSelectForUpdate(void); bool CanUpdByROWID(void); - void ClearMemberVar(UWORD colNo, bool setToNull=false); - void ClearMemberVars(bool setToNull=false); + void ClearMemberVar(UWORD colNo, bool setToNull=FALSE); + void ClearMemberVars(bool setToNull=FALSE); bool SetQueryTimeout(UDWORD nSeconds); wxDbColDef *GetColDefs() { return colDefs; } void SetColDefs(UWORD index, const wxString &fieldName, int dataType, void *pData, SWORD cType, - int size, bool keyField = false, bool upd = true, - bool insAllow = true, bool derivedCol = false); + int size, bool keyField = FALSE, bool upd = TRUE, + bool insAllow = TRUE, bool derivedCol = FALSE); wxDbColDataPtr *SetColDefs(wxDbColInf *colInfs, UWORD numCols); bool CloseCursor(HSTMT cursor); bool DeleteCursor(HSTMT *hstmtDel); void SetCursor(HSTMT *hstmtActivate = (void **) wxDB_DEFAULT_CURSOR); HSTMT GetCursor(void) { return(hstmt); } - HSTMT *GetNewCursor(bool setCursor = false, bool bindColumns = true); + HSTMT *GetNewCursor(bool setCursor = FALSE, bool bindColumns = TRUE); #if wxODBC_BACKWARD_COMPATABILITY // The following member function is deprecated. You should use the GetNewCursor - HSTMT *NewCursor(bool setCursor = false, bool bindColumns = true) { return GetNewCursor(setCursor,bindColumns); } + HSTMT *NewCursor(bool setCursor = FALSE, bool bindColumns = TRUE) { return GetNewCursor(setCursor,bindColumns); } #endif ULONG Count(const wxString &args="*"); int DB_STATUS(void) { return(pDb->DB_STATUS); } bool IsColNull(UWORD colNo) const; - bool SetColNull(UWORD colNo, bool set=true); - bool SetColNull(const wxString &colName, bool set=true); + bool SetColNull(UWORD colNo, bool set=TRUE); + bool SetColNull(const wxString &colName, bool set=TRUE); #if wxODBC_BACKWARD_COMPATABILITY // The following member functions are deprecated. You should use the SetColNull() - bool SetNull(int colNo, bool set=true) { return (SetNull(colNo,set)); } - bool SetNull(const char *colName, bool set=true) { return (SetNull(colName,set)); } + bool SetNull(int colNo, bool set=TRUE) { return (SetNull(colNo,set)); } + bool SetNull(const char *colName, bool set=TRUE) { return (SetNull(colName,set)); } #endif #ifdef __WXDEBUG__ ULONG GetTableID() { return tableID; } diff --git a/src/common/db.cpp b/src/common/db.cpp index a4717bd380..57b25f226d 100644 --- a/src/common/db.cpp +++ b/src/common/db.cpp @@ -113,7 +113,7 @@ typedef struct wxDbConnectInf::wxDbConnectInf() { Henv = 0; - freeHenvOnDestroy = false; + freeHenvOnDestroy = FALSE; Initialize(); } // Constructor @@ -125,7 +125,7 @@ wxDbConnectInf::wxDbConnectInf(HENV henv, const wxString &dsn, const wxString &u const wxString &fileType, const wxString &description) { Henv = 0; - freeHenvOnDestroy = false; + freeHenvOnDestroy = FALSE; Initialize(); @@ -156,7 +156,7 @@ wxDbConnectInf::~wxDbConnectInf() /********** wxDbConnectInf::Initialize() **********/ bool wxDbConnectInf::Initialize() { - freeHenvOnDestroy = false; + freeHenvOnDestroy = FALSE; if (freeHenvOnDestroy && Henv) FreeHenv(); @@ -169,7 +169,7 @@ bool wxDbConnectInf::Initialize() FileType.Empty(); DefaultDir.Empty(); - return true; + return TRUE; } // wxDbConnectInf::Initialize() @@ -184,12 +184,12 @@ bool wxDbConnectInf::AllocHenv() if (SQLAllocEnv(&Henv) != SQL_SUCCESS) { wxLogDebug(wxT("A problem occured while trying to get a connection to the data source")); - return false; + return FALSE; } - freeHenvOnDestroy = true; + freeHenvOnDestroy = TRUE; - return true; + return TRUE; } // wxDbConnectInf::AllocHenv() @@ -201,7 +201,7 @@ void wxDbConnectInf::FreeHenv() SQLFreeEnv(Henv); Henv = 0; - freeHenvOnDestroy = false; + freeHenvOnDestroy = FALSE; } // wxDbConnectInf::FreeHenv() @@ -347,7 +347,7 @@ int wxDbColFor::Format(int Nation, int dbDataType, SWORD sqlDataType, s_Field.Printf(wxT("Unknown Format(%d)-SQL(%d)"),dbDataType,sqlDataType); // break; }; - return true; + return TRUE; } // wxDbColFor::Format() @@ -389,7 +389,7 @@ bool wxDbColInf::Initialize() FkTableName[0] = 0; pColFor = NULL; - return true; + return TRUE; } // wxDbColInf::Initialize() @@ -417,7 +417,7 @@ bool wxDbTableInf::Initialize() numCols = 0; pColInf = NULL; - return true; + return TRUE; } // wxDbTableInf::Initialize() @@ -445,7 +445,7 @@ bool wxDbInf::Initialize() numTables = 0; pTableInf = NULL; - return true; + return TRUE; } // wxDbInf::Initialize() @@ -526,7 +526,7 @@ void wxDb::initialize() typeInfBlob.MaximumScale = 0; // Error reporting is turned OFF by default - silent = true; + silent = TRUE; // Allocate a data source connection handle if (SQLAllocConnect(henv, &hdbc) != SQL_SUCCESS) @@ -536,8 +536,8 @@ void wxDb::initialize() DB_STATUS = 0; // Mark database as not open as of yet - dbIsOpen = false; - dbIsCached = false; + dbIsOpen = FALSE; + dbIsCached = FALSE; } // wxDb::initialize() @@ -623,7 +623,7 @@ bool wxDb::Open(const wxString &Dsn, const wxString &Uid, const wxString &AuthSt */ // Mark database as open - dbIsOpen = true; + dbIsOpen = TRUE; // Allocate a statement handle for the database connection if (SQLAllocStmt(hdbc, &hstmt) != SQL_SUCCESS) @@ -631,11 +631,11 @@ bool wxDb::Open(const wxString &Dsn, const wxString &Uid, const wxString &AuthSt // Set Connection Options if (!setConnectionOptions()) - return(false); + return(FALSE); // Query the data source for inf. about itself if (!getDbInfo()) - return(false); + return(FALSE); // Query the data source regarding data type information @@ -681,7 +681,7 @@ bool wxDb::Open(const wxString &Dsn, const wxString &Uid, const wxString &AuthSt // VARCHAR = Variable length character string if (!getDataTypeInfo(SQL_VARCHAR, typeInfVarchar)) if (!getDataTypeInfo(SQL_CHAR, typeInfVarchar)) - return(false); + return(FALSE); else typeInfVarchar.FsqlType = SQL_CHAR; else @@ -693,7 +693,7 @@ bool wxDb::Open(const wxString &Dsn, const wxString &Uid, const wxString &AuthSt if (!getDataTypeInfo(SQL_FLOAT,typeInfFloat)) if (!getDataTypeInfo(SQL_DECIMAL,typeInfFloat)) if (!getDataTypeInfo(SQL_NUMERIC,typeInfFloat)) - return(false); + return(FALSE); else typeInfFloat.FsqlType = SQL_NUMERIC; else @@ -711,7 +711,7 @@ bool wxDb::Open(const wxString &Dsn, const wxString &Uid, const wxString &AuthSt // If SQL_INTEGER is not supported, use the floating point // data type to store integers as well as floats if (!getDataTypeInfo(typeInfFloat.FsqlType, typeInfInteger)) - return(false); + return(FALSE); else typeInfInteger.FsqlType = typeInfFloat.FsqlType; } @@ -722,14 +722,14 @@ bool wxDb::Open(const wxString &Dsn, const wxString &Uid, const wxString &AuthSt if (Dbms() != dbmsDBASE) { if (!getDataTypeInfo(SQL_TIMESTAMP,typeInfDate)) - return(false); + return(FALSE); else typeInfDate.FsqlType = SQL_TIMESTAMP; } else { if (!getDataTypeInfo(SQL_DATE,typeInfDate)) - return(false); + return(FALSE); else typeInfDate.FsqlType = SQL_DATE; } @@ -737,7 +737,7 @@ bool wxDb::Open(const wxString &Dsn, const wxString &Uid, const wxString &AuthSt if (!getDataTypeInfo(SQL_LONGVARBINARY, typeInfBlob)) { if (!getDataTypeInfo(SQL_VARBINARY,typeInfBlob)) - return(false); + return(FALSE); else typeInfBlob.FsqlType = SQL_VARBINARY; } @@ -756,7 +756,7 @@ bool wxDb::Open(const wxString &Dsn, const wxString &Uid, const wxString &AuthSt #endif // Completed Successfully - return(true); + return(TRUE); } // wxDb::Open() @@ -807,7 +807,7 @@ bool wxDb::Open(wxDb *copyDb) */ // Mark database as open - dbIsOpen = true; + dbIsOpen = TRUE; // Allocate a statement handle for the database connection if (SQLAllocStmt(hdbc, &hstmt) != SQL_SUCCESS) @@ -815,7 +815,7 @@ bool wxDb::Open(wxDb *copyDb) // Set Connection Options if (!setConnectionOptions()) - return(false); + return(FALSE); // Instead of Querying the data source for info about itself, it can just be copied // from the wxDb instance that was passed in (copyDb). @@ -896,7 +896,7 @@ bool wxDb::Open(wxDb *copyDb) #endif // Completed Successfully - return(true); + return(TRUE); } // wxDb::Open() 2 @@ -963,7 +963,7 @@ bool wxDb::setConnectionOptions(void) #endif // Completed Successfully - return(true); + return(TRUE); } // wxDb::setConnectionOptions() @@ -1273,7 +1273,7 @@ bool wxDb::getDbInfo(void) #endif // Completed Successfully - return(true); + return(TRUE); } // wxDb::getDbInfo() @@ -1302,7 +1302,7 @@ bool wxDb::getDataTypeInfo(SWORD fSqlType, wxDbSqlTypeInfo &structSQLTypeInfo) #endif DispAllErrors(henv, hdbc, hstmt); SQLFreeStmt(hstmt, SQL_CLOSE); - return(false); + return(FALSE); } wxChar typeName[DB_TYPE_NAME_LEN+1]; @@ -1358,7 +1358,7 @@ bool wxDb::getDataTypeInfo(SWORD fSqlType, wxDbSqlTypeInfo &structSQLTypeInfo) return(DispAllErrors(henv, hdbc, hstmt)); // Completed Successfully - return(true); + return(TRUE); } // wxDb::getDataTypeInfo() @@ -1415,7 +1415,7 @@ void wxDb::Close(void) wxStrcpy(DBerrorList[i], errorList[i]); dbmsType = dbmsUNIDENTIFIED; - dbIsOpen = false; + dbIsOpen = FALSE; } // wxDb::Close() @@ -1431,7 +1431,7 @@ bool wxDb::CommitTrans(void) } // Completed successfully - return(true); + return(TRUE); } // wxDb::CommitTrans() @@ -1444,7 +1444,7 @@ bool wxDb::RollbackTrans(void) return(DispAllErrors(henv, hdbc)); // Completed successfully - return(true); + return(TRUE); } // wxDb::RollbackTrans() @@ -1461,7 +1461,7 @@ bool wxDb::DispAllErrors(HENV aHenv, HDBC aHdbc, HSTMT aHstmt) * If in DBDEBUG_CONSOLE mode, the constructed string will be displayed in the console * window and program execution will be paused until the user presses a key. * - * This function always returns a false, so that functions which call this function + * This function always returns a FALSE, so that functions which call this function * can have a line like "return (DispAllErrors(henv, hdbc));" to indicate the failure * of the users request, so that the calling code can then process the error msg log */ @@ -1487,7 +1487,7 @@ bool wxDb::DispAllErrors(HENV aHenv, HDBC aHdbc, HSTMT aHstmt) } } - return(false); // This function always returns false. + return(FALSE); // This function always returns FALSE. } // wxDb::DispAllErrors() @@ -1496,9 +1496,9 @@ bool wxDb::DispAllErrors(HENV aHenv, HDBC aHdbc, HSTMT aHstmt) bool wxDb::GetNextError(HENV aHenv, HDBC aHdbc, HSTMT aHstmt) { if (SQLError(aHenv, aHdbc, aHstmt, (UCHAR FAR *) sqlState, &nativeError, (UCHAR FAR *) errorMsg, SQL_MAX_MESSAGE_LENGTH - 1, &cbErrorMsg) == SQL_SUCCESS) - return(true); + return(TRUE); else - return(false); + return(FALSE); } // wxDb::GetNextError() @@ -1805,7 +1805,7 @@ bool wxDb::CreateView(const wxString &viewName, const wxString &colList, // Drop the view first if (attemptDrop && !DropView(viewName)) - return false; + return FALSE; // Build the create view statement sqlStmt = wxT("CREATE VIEW "); @@ -1836,7 +1836,7 @@ bool wxDb::CreateView(const wxString &viewName, const wxString &colList, bool wxDb::DropView(const wxString &viewName) { /* - * NOTE: This function returns true if the View does not exist, but + * NOTE: This function returns TRUE if the View does not exist, but * only for identified databases. Code will need to be added * below for any other databases when those databases are defined * to handle this situation consistently @@ -1863,16 +1863,16 @@ bool wxDb::DropView(const wxString &viewName) DispNextError(); DispAllErrors(henv, hdbc, hstmt); RollbackTrans(); - return(false); + return(FALSE); } } } // Commit the transaction if (!CommitTrans()) - return(false); + return(FALSE); - return true; + return TRUE; } // wxDb::DropView() @@ -1888,12 +1888,12 @@ bool wxDb::ExecSql(const wxString &pSqlStmt) if (retcode == SQL_SUCCESS || (Dbms() == dbmsDB2 && (retcode == SQL_SUCCESS_WITH_INFO || retcode == SQL_NO_DATA_FOUND))) { - return(true); + return(TRUE); } else { DispAllErrors(henv, hdbc, hstmt); - return(false); + return(FALSE); } } // wxDb::ExecSql() @@ -1903,11 +1903,11 @@ bool wxDb::ExecSql(const wxString &pSqlStmt) bool wxDb::GetNext(void) { if (SQLFetch(hstmt) == SQL_SUCCESS) - return(true); + return(TRUE); else { DispAllErrors(henv, hdbc, hstmt); - return(false); + return(FALSE); } } // wxDb::GetNext() @@ -1920,11 +1920,11 @@ bool wxDb::GetData(UWORD colNo, SWORD cType, PTR pData, SDWORD maxLen, SDWORD FA wxASSERT(cbReturned); if (SQLGetData(hstmt, colNo, cType, pData, maxLen, cbReturned) == SQL_SUCCESS) - return(true); + return(TRUE); else { DispAllErrors(henv, hdbc, hstmt); - return(false); + return(FALSE); } } // wxDb::GetData() @@ -2064,7 +2064,7 @@ int wxDb::GetKeyFields(const wxString &tableName, wxDbColInf* colInf, UWORD noCo } // while SQLFreeStmt(hstmt, SQL_CLOSE); /* Close the cursor (the hstmt is still allocated). */ - return true; + return TRUE; } // wxDb::GetKeyFields() @@ -2982,7 +2982,7 @@ bool wxDb::Catalog(const wxChar *userID, const wxString &fileName) FILE *fp = fopen(fileName.c_str(),wxT("wt")); if (fp == NULL) - return(false); + return(FALSE); SQLFreeStmt(hstmt, SQL_CLOSE); @@ -3013,7 +3013,7 @@ bool wxDb::Catalog(const wxChar *userID, const wxString &fileName) { DispAllErrors(henv, hdbc, hstmt); fclose(fp); - return(false); + return(FALSE); } wxString outStr; @@ -3055,7 +3055,7 @@ bool wxDb::Catalog(const wxChar *userID, const wxString &fileName) { SQLFreeStmt(hstmt, SQL_CLOSE); fclose(fp); - return(false); + return(FALSE); } cnt++; } @@ -3073,7 +3073,7 @@ bool wxDb::Catalog(const wxChar *userID, const wxString &fileName) bool wxDb::TableExists(const wxString &tableName, const wxChar *userID, const wxString &tablePath) /* - * Table name can refer to a table, view, alias or synonym. Returns true + * Table name can refer to a table, view, alias or synonym. Returns TRUE * if the object exists in the database. This function does not indicate * whether or not the user has privleges to query or perform other functions * on the table. @@ -3150,7 +3150,7 @@ bool wxDb::TableExists(const wxString &tableName, const wxChar *userID, const wx SQLFreeStmt(hstmt, SQL_CLOSE); - return(true); + return(TRUE); } // wxDb::TableExists() @@ -3211,30 +3211,30 @@ bool wxDb::TablePrivileges(const wxString &tableName, const wxString &priv, cons if ((retcode != SQL_SUCCESS) && (retcode != SQL_SUCCESS_WITH_INFO)) return(DispAllErrors(henv, hdbc, hstmt)); - bool failed = false; + bool failed = FALSE; retcode = SQLFetch(hstmt); while (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) { if (SQLGetData(hstmt, 1, SQL_C_CHAR, (UCHAR*) result.tableQual, sizeof(result.tableQual), &cbRetVal) != SQL_SUCCESS) - failed = true; + failed = TRUE; if (!failed && SQLGetData(hstmt, 2, SQL_C_CHAR, (UCHAR*) result.tableOwner, sizeof(result.tableOwner), &cbRetVal) != SQL_SUCCESS) - failed = true; + failed = TRUE; if (!failed && SQLGetData(hstmt, 3, SQL_C_CHAR, (UCHAR*) result.tableName, sizeof(result.tableName), &cbRetVal) != SQL_SUCCESS) - failed = true; + failed = TRUE; if (!failed && SQLGetData(hstmt, 4, SQL_C_CHAR, (UCHAR*) result.grantor, sizeof(result.grantor), &cbRetVal) != SQL_SUCCESS) - failed = true; + failed = TRUE; if (!failed && SQLGetData(hstmt, 5, SQL_C_CHAR, (UCHAR*) result.grantee, sizeof(result.grantee), &cbRetVal) != SQL_SUCCESS) - failed = true; + failed = TRUE; if (!failed && SQLGetData(hstmt, 6, SQL_C_CHAR, (UCHAR*) result.privilege, sizeof(result.privilege), &cbRetVal) != SQL_SUCCESS) - failed = true; + failed = TRUE; if (!failed && SQLGetData(hstmt, 7, SQL_C_CHAR, (UCHAR*) result.grantable, sizeof(result.grantable), &cbRetVal) != SQL_SUCCESS) - failed = true; + failed = TRUE; if (failed) { @@ -3246,31 +3246,31 @@ bool wxDb::TablePrivileges(const wxString &tableName, const wxString &priv, cons result.grantor, result.grantee); #endif - if (UserID.IsSameAs(result.tableOwner,false)) + if (UserID.IsSameAs(result.tableOwner,FALSE)) { SQLFreeStmt(hstmt, SQL_CLOSE); - return true; + return TRUE; } - if (UserID.IsSameAs(result.grantee,false) && + if (UserID.IsSameAs(result.grantee,FALSE) && !wxStrcmp(result.privilege,priv)) { SQLFreeStmt(hstmt, SQL_CLOSE); - return true; + return TRUE; } if (!wxStrcmp(result.grantee,curRole) && !wxStrcmp(result.privilege,priv)) { SQLFreeStmt(hstmt, SQL_CLOSE); - return true; + return TRUE; } retcode = SQLFetch(hstmt); } SQLFreeStmt(hstmt, SQL_CLOSE); - return false; + return FALSE; } // wxDb::TablePrivileges @@ -3287,7 +3287,7 @@ bool wxDb::SetSqlLogging(wxDbSqlLogState state, const wxString &filename, bool a { fpSqlLog = fopen(filename, (append ? wxT("at") : wxT("wt"))); if (fpSqlLog == NULL) - return(false); + return(FALSE); } } else // sqlLogOFF @@ -3295,13 +3295,13 @@ bool wxDb::SetSqlLogging(wxDbSqlLogState state, const wxString &filename, bool a if (fpSqlLog) { if (fclose(fpSqlLog)) - return(false); + return(FALSE); fpSqlLog = 0; } } sqlLogState = state; - return(true); + return(TRUE); } // wxDb::SetSqlLogging() @@ -3312,16 +3312,16 @@ bool wxDb::WriteSqlLog(const wxString &logMsg) wxASSERT(logMsg.Length()); if (fpSqlLog == 0 || sqlLogState == sqlLogOFF) - return(false); + return(FALSE); if (fputs(wxT("\n"), fpSqlLog) == EOF) - return(false); + return(FALSE); if (fputs(logMsg, fpSqlLog) == EOF) - return(false); + return(FALSE); if (fputs(wxT("\n"), fpSqlLog) == EOF) - return(false); + return(FALSE); - return(true); + return(TRUE); } // wxDb::WriteSqlLog() @@ -3349,7 +3349,7 @@ wxDBMS wxDb::Dbms(void) * - Does not support the SQL_TIMESTAMP structure * - Supports only one cursor and one connect (apparently? with Microsoft driver only?) * - Does not automatically create the primary index if the 'keyField' param of SetColDef - * is true. The user must create ALL indexes from their program. + * is TRUE. The user must create ALL indexes from their program. * - Table names can only be 8 characters long * - Column names can only be 10 characters long * @@ -3365,7 +3365,7 @@ wxDBMS wxDb::Dbms(void) * * MY_SQL * - If a column is part of the Primary Key, the column cannot be NULL - * - Cannot support selecting for update [::CanSelectForUpdate()]. Always returns false + * - Cannot support selecting for update [::CanSelectForUpdate()]. Always returns FALSE * - Columns that are part of primary or secondary keys must be defined as being NOT NULL * when they are created. Some code is added in ::CreateIndex to try to adjust the * column definition if it is not defined correctly, but it is experimental @@ -3473,7 +3473,7 @@ bool wxDb::ModifyColumn(const wxString &tableName, const wxString &columnName, // Must specify a columnLength if modifying a VARCHAR type column if (dataType == DB_DATA_TYPE_VARCHAR && !columnLength) - return false; + return FALSE; wxString dataTypeName; wxString sqlStmt; @@ -3497,7 +3497,7 @@ bool wxDb::ModifyColumn(const wxString &tableName, const wxString &columnName, dataTypeName = typeInfBlob.TypeName; break; default: - return false; + return FALSE; } // Set the modify or alter syntax depending on the type of database connected to @@ -3510,7 +3510,7 @@ bool wxDb::ModifyColumn(const wxString &tableName, const wxString &columnName, alterSlashModify = "ALTER COLUMN"; break; case dbmsUNIDENTIFIED : - return false; + return FALSE; case dbmsSYBASE_ASA : case dbmsSYBASE_ASE : case dbmsMY_SQL : @@ -3568,7 +3568,7 @@ wxDb WXDLLEXPORT *wxDbGetConnection(wxDbConnectInf *pDbConfig, bool FwdOnlyCurso (pList->PtrDb->FwdOnlyCursors() == FwdOnlyCursors) && (!wxStrcmp(pDbConfig->GetDsn(), pList->Dsn))) // Found a free connection { - pList->Free = false; + pList->Free = FALSE; return(pList->PtrDb); } @@ -3598,14 +3598,14 @@ wxDb WXDLLEXPORT *wxDbGetConnection(wxDbConnectInf *pDbConfig, bool FwdOnlyCurso // Initialize new node in the linked list pList->PtrNext = 0; - pList->Free = false; + pList->Free = FALSE; pList->Dsn = pDbConfig->GetDsn(); pList->Uid = pDbConfig->GetUserID(); pList->AuthStr = pDbConfig->GetPassword(); pList->PtrDb = new wxDb(pDbConfig->GetHenv(), FwdOnlyCursors); - bool opened = false; + bool opened = FALSE; if (!matchingDbConnection) opened = pList->PtrDb->Open(pDbConfig->GetDsn(), pDbConfig->GetUserID(), pDbConfig->GetPassword()); @@ -3615,8 +3615,8 @@ wxDb WXDLLEXPORT *wxDbGetConnection(wxDbConnectInf *pDbConfig, bool FwdOnlyCurso // Connect to the datasource if (opened) { - pList->PtrDb->setCached(true); // Prevent a user from deleting a cached connection - pList->PtrDb->SetSqlLogging(SQLLOGstate,SQLLOGfn,true); + pList->PtrDb->setCached(TRUE); // Prevent a user from deleting a cached connection + pList->PtrDb->SetSqlLogging(SQLLOGstate,SQLLOGfn,TRUE); return(pList->PtrDb); } else // Unable to connect, destroy list item @@ -3644,11 +3644,11 @@ bool WXDLLEXPORT wxDbFreeConnection(wxDb *pDb) for (pList = PtrBegDbList; pList; pList = pList->PtrNext) { if (pList->PtrDb == pDb) // Found it, now free it!!! - return (pList->Free = true); + return (pList->Free = TRUE); } // Never found the database object, return failure - return(false); + return(FALSE); } // wxDbFreeConnection() @@ -3664,7 +3664,7 @@ void WXDLLEXPORT wxDbCloseConnections(void) pNext = pList->PtrNext; // Save the pointer to next pList->PtrDb->CommitTrans(); // Commit any open transactions on wxDb object pList->PtrDb->Close(); // Close the wxDb object - pList->PtrDb->setCached(false); // Allows deletion of the wxDb instance + pList->PtrDb->setCached(FALSE); // Allows deletion of the wxDb instance delete pList->PtrDb; // Deletes the wxDb object delete pList; // Deletes the linked list object } @@ -3684,7 +3684,7 @@ int WXDLLEXPORT wxDbConnectionsInUse(void) // Scan the linked list counting db connections that are currently in use for (pList = PtrBegDbList; pList; pList = pList->PtrNext) { - if (pList->Free == false) + if (pList->Free == FALSE) cnt++; } @@ -3742,20 +3742,20 @@ const wxChar WXDLLEXPORT *wxDbLogExtendedErrorMsg(const wxChar *userText, wxDb * /********** wxDbSqlLog() **********/ bool wxDbSqlLog(wxDbSqlLogState state, const wxChar *filename) { - bool append = false; + bool append = FALSE; wxDbList *pList; for (pList = PtrBegDbList; pList; pList = pList->PtrNext) { if (!pList->PtrDb->SetSqlLogging(state,filename,append)) - return(false); - append = true; + return(FALSE); + append = TRUE; } SQLLOGstate = state; SQLLOGfn = filename; - return(true); + return(TRUE); } // wxDbSqlLog() @@ -3771,7 +3771,7 @@ int wxDbCreateDataSource(const wxString &driverName, const wxString &dsn, const * ODBC driver must be ODBC 3.0 compliant to use this function */ { - int result = false; + int result = FALSE; //!!!! ONLY FUNCTIONAL UNDER MSW with VC6 !!!! #ifdef __VISUALC__ @@ -3793,7 +3793,7 @@ int wxDbCreateDataSource(const wxString &driverName, const wxString &dsn, const int k; do { - k = setupStr.Find((wxChar)2,true); + k = setupStr.Find((wxChar)2,TRUE); if (k != wxNOT_FOUND) setupStr[(UINT)k] = wxT('\0'); } @@ -3827,14 +3827,14 @@ int wxDbCreateDataSource(const wxString &driverName, const wxString &dsn, const } } else - result = true; + result = TRUE; #else // Using iODBC/unixODBC or some other compiler which does not support the APIs // necessary to use this function, so this function is not supported #ifdef __WXDEBUG__ wxLogDebug(wxT("wxDbCreateDataSource() not available except under VC++/MSW"),wxT("ODBC DEBUG MESSAGE")); #endif - result = false; + result = FALSE; #endif // __VISUALC__ return result; @@ -3855,9 +3855,9 @@ bool wxDbGetDataSource(HENV henv, wxChar *Dsn, SWORD DsnMax, wxChar *DsDesc, if (SQLDataSources(henv, direction, (UCHAR FAR *) Dsn, DsnMax, &cb1, (UCHAR FAR *) DsDesc, DsDescMax, &cb2) == SQL_SUCCESS) - return(true); + return(TRUE); else - return(false); + return(FALSE); } // wxDbGetDataSource() diff --git a/src/common/dbgrid.cpp b/src/common/dbgrid.cpp index e541773ef2..261a098eb7 100644 --- a/src/common/dbgrid.cpp +++ b/src/common/dbgrid.cpp @@ -128,7 +128,7 @@ wxDbGridTableBase::wxDbGridTableBase(wxDbTable *tab, wxDbGridColInfo* ColInfo, m_keys(), m_data(tab), m_dbowner(takeOwnership), - m_rowmodified(false) + m_rowmodified(FALSE) { if (count == wxUSE_QUERY) @@ -197,7 +197,7 @@ bool wxDbGridTableBase::CanHaveAttributes() // use the default attr provider by default SetAttrProvider(new wxDbGridCellAttrProvider(m_data, m_ColInfo)); } - return true; + return TRUE; } @@ -255,8 +255,8 @@ bool wxDbGridTableBase::AssignDbTable(wxDbTable *tab, int count, bool takeOwners grid->EndBatch(); } m_dbowner = takeOwnership; - m_rowmodified = false; - return true; + m_rowmodified = FALSE; + return TRUE; } wxString wxDbGridTableBase::GetTypeName(int row, int col) @@ -327,19 +327,19 @@ bool wxDbGridTableBase::CanGetValueAs(int row, int col, const wxString& typeName if (typeName == wxGRID_VALUE_STRING) { //FIXME ummm What about blob field etc. - return true; + return TRUE; } if (m_data->IsColNull(m_ColInfo[col].DbCol)) { - return false; + return FALSE; } if (m_data->GetNumberOfColumns() <= m_ColInfo[col].DbCol) { //If a virtual column then we can't find it's type. we have to - // return false to get using wxVariant. - return false; + // return FALSE to get using wxVariant. + return FALSE; } int sqltype = m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype; @@ -349,9 +349,9 @@ bool wxDbGridTableBase::CanGetValueAs(int row, int col, const wxString& typeName (sqltype == SQL_C_TIME) || (sqltype == SQL_C_TIMESTAMP)) { - return true; + return TRUE; } - return false; + return FALSE; } if (typeName == wxGRID_VALUE_NUMBER) { @@ -360,9 +360,9 @@ bool wxDbGridTableBase::CanGetValueAs(int row, int col, const wxString& typeName (sqltype == SQL_C_SLONG) || (sqltype == SQL_C_ULONG)) { - return true; + return TRUE; } - return false; + return FALSE; } if (typeName == wxGRID_VALUE_FLOAT) { @@ -373,11 +373,11 @@ bool wxDbGridTableBase::CanGetValueAs(int row, int col, const wxString& typeName (sqltype == SQL_C_FLOAT) || (sqltype == SQL_C_DOUBLE)) { - return true; + return TRUE; } - return false; + return FALSE; } - return false; + return FALSE; } bool wxDbGridTableBase::CanSetValueAs(int row, int col, const wxString& typeName) @@ -387,25 +387,25 @@ bool wxDbGridTableBase::CanSetValueAs(int row, int col, const wxString& typeName if (m_data->IsColNull(m_ColInfo[col].DbCol)) { - return false; + return FALSE; } if (typeName == wxGRID_VALUE_STRING) { //FIXME ummm What about blob field etc. - return true; + return TRUE; } if (!(m_data->GetColDefs()[(m_ColInfo[col].DbCol)].Updateable)) { - return false; + return FALSE; } if (m_data->GetNumberOfColumns() <= m_ColInfo[col].DbCol) { //If a virtual column then we can't find it's type. we have to faulse to //get using wxVairent. - return false; + return FALSE; } int sqltype = m_data->GetColDefs()[(m_ColInfo[col].DbCol)].SqlCtype; @@ -415,9 +415,9 @@ bool wxDbGridTableBase::CanSetValueAs(int row, int col, const wxString& typeName (sqltype == SQL_C_TIME) || (sqltype == SQL_C_TIMESTAMP)) { - return true; + return TRUE; } - return false; + return FALSE; } if (typeName == wxGRID_VALUE_NUMBER) { @@ -426,9 +426,9 @@ bool wxDbGridTableBase::CanSetValueAs(int row, int col, const wxString& typeName (sqltype == SQL_C_SLONG) || (sqltype == SQL_C_ULONG)) { - return true; + return TRUE; } - return false; + return FALSE; } if (typeName == wxGRID_VALUE_FLOAT) { @@ -439,11 +439,11 @@ bool wxDbGridTableBase::CanSetValueAs(int row, int col, const wxString& typeName (sqltype == SQL_C_FLOAT) || (sqltype == SQL_C_DOUBLE)) { - return true; + return TRUE; } - return false; + return FALSE; } - return false; + return FALSE; } long wxDbGridTableBase::GetValueAsLong(int row, int col) @@ -574,7 +574,7 @@ void wxDbGridTableBase::SetValueAsCustom(int row, int col, const wxString& typeN return; } wxVariant val(date); - m_rowmodified = true; + m_rowmodified = TRUE; m_data->SetCol(m_ColInfo[col].DbCol,val); } } @@ -621,7 +621,7 @@ void wxDbGridTableBase::SetValue(int row, int col,const wxString& value) ValidateRow(row); wxVariant val(value); - m_rowmodified = true; + m_rowmodified = TRUE; m_data->SetCol(m_ColInfo[col].DbCol,val); } @@ -633,7 +633,7 @@ void wxDbGridTableBase::SetValueAsLong(int row, int col, long value) ValidateRow(row); wxVariant val(value); - m_rowmodified = true; + m_rowmodified = TRUE; m_data->SetCol(m_ColInfo[col].DbCol,val); } @@ -645,7 +645,7 @@ void wxDbGridTableBase::SetValueAsDouble(int row, int col, double value) ValidateRow(row); wxVariant val(value); - m_rowmodified = true; + m_rowmodified = TRUE; m_data->SetCol(m_ColInfo[col].DbCol,val); } @@ -658,7 +658,7 @@ void wxDbGridTableBase::SetValueAsBool(int row, int col, bool value) ValidateRow(row); wxVariant val(value); - m_rowmodified = true; + m_rowmodified = TRUE; m_data->SetCol(m_ColInfo[col].DbCol,val); } @@ -705,17 +705,17 @@ void wxDbGridTableBase::ValidateRow(int row) m_row = row; } - m_rowmodified = false; + m_rowmodified = FALSE; } bool wxDbGridTableBase::Writeback() const { if (!m_rowmodified) { - return true; + return TRUE; } - bool result=true; + bool result=TRUE; wxLogDebug(wxT("\trow key unknown")); // FIXME: this code requires dbtable support for record status diff --git a/src/common/dbtable.cpp b/src/common/dbtable.cpp index 47e31c9f00..234c9c72a5 100644 --- a/src/common/dbtable.cpp +++ b/src/common/dbtable.cpp @@ -91,14 +91,14 @@ bool wxDbColDef::Initialize() SqlCtype = SQL_C_LONG; PtrDataObj = NULL; SzDataObj = 0; - KeyField = false; - Updateable = false; - InsertAllowed = false; - DerivedCol = false; + KeyField = FALSE; + Updateable = FALSE; + InsertAllowed = FALSE; + DerivedCol = FALSE; CbValue = 0; - Null = false; + Null = FALSE; - return true; + return TRUE; } // wxDbColDef::Initialize() @@ -150,9 +150,9 @@ bool wxDbTable::initialize(wxDb *pwxDb, const wxString &tblName, const UWORD num where.Empty(); // Where clause orderBy.Empty(); // Order By clause from.Empty(); // From clause - selectForUpdate = false; // SELECT ... FOR UPDATE; Indicates whether to include the FOR UPDATE phrase + selectForUpdate = FALSE; // SELECT ... FOR UPDATE; Indicates whether to include the FOR UPDATE phrase queryOnly = qryOnly; - insertable = true; + insertable = TRUE; tablePath.Empty(); tableName.Empty(); queryTableName.Empty(); @@ -161,7 +161,7 @@ bool wxDbTable::initialize(wxDb *pwxDb, const wxString &tblName, const UWORD num wxASSERT(pDb); if (!pDb) - return false; + return FALSE; tableName = tblName; // Table Name if (tblPath.Length()) @@ -258,7 +258,7 @@ bool wxDbTable::initialize(wxDb *pwxDb, const wxString &tblName, const UWORD num { // Should never happen pDb->GetNextError(henv, hdbc, hstmtInternal); - return false; + return FALSE; } } } @@ -287,11 +287,11 @@ bool wxDbTable::initialize(wxDb *pwxDb, const wxString &tblName, const UWORD num } // Make the default cursor the active cursor - hstmtDefault = GetNewCursor(false,false); + hstmtDefault = GetNewCursor(FALSE,FALSE); wxASSERT(hstmtDefault); hstmt = *hstmtDefault; - return true; + return TRUE; } // wxDbTable::initialize() @@ -308,8 +308,8 @@ void wxDbTable::cleanup() #ifdef __WXDEBUG__ if (tableID) { - TablesInUse.DeleteContents(true); - bool found = false; + TablesInUse.DeleteContents(TRUE); + bool found = FALSE; wxNode *pNode; pNode = TablesInUse.First(); @@ -317,7 +317,7 @@ void wxDbTable::cleanup() { if (((wxTablesInUse *)pNode->Data())->tableID == tableID) { - found = true; + found = TRUE; if (!TablesInUse.DeleteNode(pNode)) wxLogDebug (s,wxT("Unable to delete node!")); } @@ -402,7 +402,7 @@ bool wxDbTable::bindParams(bool forUpdate) { wxASSERT(!queryOnly); if (queryOnly) - return(false); + return(FALSE); SWORD fSqlType = 0; UDWORD precision = 0; @@ -500,7 +500,7 @@ bool wxDbTable::bindParams(bool forUpdate) } // Completed successfully - return(true); + return(TRUE); } // wxDbTable::bindParams() @@ -508,14 +508,14 @@ bool wxDbTable::bindParams(bool forUpdate) /********** wxDbTable::bindInsertParams() **********/ bool wxDbTable::bindInsertParams(void) { - return bindParams(false); + return bindParams(FALSE); } // wxDbTable::bindInsertParams() /********** wxDbTable::bindUpdateParams() **********/ bool wxDbTable::bindUpdateParams(void) { - return bindParams(true); + return bindParams(TRUE); } // wxDbTable::bindUpdateParams() @@ -534,7 +534,7 @@ bool wxDbTable::bindCols(HSTMT cursor) } // Completed successfully - return(true); + return(TRUE); } // wxDbTable::bindCols() @@ -554,7 +554,7 @@ bool wxDbTable::getRec(UWORD fetchType) if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO) { if (retcode == SQL_NO_DATA_FOUND) - return(false); + return(FALSE); else return(pDb->DispAllErrors(henv, hdbc, hstmt)); } @@ -574,7 +574,7 @@ bool wxDbTable::getRec(UWORD fetchType) if (retcode != SQL_SUCCESS && retcode != SQL_SUCCESS_WITH_INFO) { if (retcode == SQL_NO_DATA_FOUND) - return(false); + return(FALSE); else return(pDb->DispAllErrors(henv, hdbc, hstmt)); } @@ -589,7 +589,7 @@ bool wxDbTable::getRec(UWORD fetchType) } // Completed successfully - return(true); + return(TRUE); } // wxDbTable::getRec() @@ -607,7 +607,7 @@ bool wxDbTable::execDelete(const wxString &pSqlStmt) retcode == SQL_SUCCESS_WITH_INFO) { // Record deleted successfully - return(true); + return(TRUE); } // Problem deleting record @@ -629,7 +629,7 @@ bool wxDbTable::execUpdate(const wxString &pSqlStmt) retcode == SQL_SUCCESS_WITH_INFO) { // Record updated successfully - return(true); + return(TRUE); } // Problem updating record @@ -647,7 +647,7 @@ bool wxDbTable::query(int queryType, bool forUpdate, bool distinct, const wxStri // The user may wish to select for update, but the DBMS may not be capable selectForUpdate = CanSelectForUpdate(); else - selectForUpdate = false; + selectForUpdate = FALSE; // Set the SQL SELECT string if (queryType != DB_SELECT_STATEMENT) // A select statement was not passed in, @@ -658,7 +658,7 @@ bool wxDbTable::query(int queryType, bool forUpdate, bool distinct, const wxStri // Make sure the cursor is closed first if (!CloseCursor(hstmt)) - return(false); + return(FALSE); // Execute the SQL SELECT statement int retcode; @@ -667,7 +667,7 @@ bool wxDbTable::query(int queryType, bool forUpdate, bool distinct, const wxStri return(pDb->DispAllErrors(henv, hdbc, hstmt)); // Completed successfully - return(true); + return(TRUE); } // wxDbTable::query() @@ -679,7 +679,7 @@ bool wxDbTable::query(int queryType, bool forUpdate, bool distinct, const wxStri bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists) { if (!pDb) - return false; + return FALSE; int i; wxString sqlStmt; @@ -733,7 +733,7 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists) p += s; pDb->LogError(p.GetData()); - return(false); + return(FALSE); } // Bind the member variables for field exchange between @@ -741,17 +741,17 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists) if (!queryOnly) { if (!bindInsertParams()) // Inserts - return(false); + return(FALSE); if (!bindUpdateParams()) // Updates - return(false); + return(FALSE); } if (!bindCols(*hstmtDefault)) // Selects - return(false); + return(FALSE); if (!bindCols(hstmtInternal)) // Internal use only - return(false); + return(FALSE); /* * Do NOT bind the hstmtCount cursor!!! @@ -760,7 +760,7 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists) // Build an insert statement using parameter markers if (!queryOnly && noCols > 0) { - bool needComma = false; + bool needComma = FALSE; sqlStmt.Printf(wxT("INSERT INTO %s ("), tableName.c_str()); for (i = 0; i < noCols; i++) { @@ -769,9 +769,9 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists) if (needComma) sqlStmt += wxT(","); sqlStmt += colDefs[i].ColName; - needComma = true; + needComma = TRUE; } - needComma = false; + needComma = FALSE; sqlStmt += wxT(") VALUES ("); int insertableCount = 0; @@ -783,7 +783,7 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists) if (needComma) sqlStmt += wxT(","); sqlStmt += wxT("?"); - needComma = true; + needComma = TRUE; insertableCount++; } sqlStmt += wxT(")"); @@ -795,11 +795,11 @@ bool wxDbTable::Open(bool checkPrivileges, bool checkTableExists) return(pDb->DispAllErrors(henv, hdbc, hstmtInsert)); } else - insertable= false; + insertable= FALSE; } // Completed successfully - return(true); + return(TRUE); } // wxDbTable::Open() @@ -818,7 +818,7 @@ bool wxDbTable::QueryBySqlStmt(const wxString &pSqlStmt) { pDb->WriteSqlLog(pSqlStmt); - return(query(DB_SELECT_STATEMENT, false, false, pSqlStmt)); + return(query(DB_SELECT_STATEMENT, FALSE, FALSE, pSqlStmt)); } // wxDbTable::QueryBySqlStmt() @@ -847,7 +847,7 @@ bool wxDbTable::GetPrev(void) if (pDb->FwdOnlyCursors()) { wxFAIL_MSG(wxT("GetPrev()::Backward scrolling cursors are not enabled for this instance of wxDbTable")); - return false; + return FALSE; } else return(getRec(SQL_FETCH_PRIOR)); @@ -861,7 +861,7 @@ bool wxDbTable::operator--(int) if (pDb->FwdOnlyCursors()) { wxFAIL_MSG(wxT("operator--:Backward scrolling cursors are not enabled for this instance of wxDbTable")); - return false; + return FALSE; } else return(getRec(SQL_FETCH_PRIOR)); @@ -875,7 +875,7 @@ bool wxDbTable::GetFirst(void) if (pDb->FwdOnlyCursors()) { wxFAIL_MSG(wxT("GetFirst():Backward scrolling cursors are not enabled for this instance of wxDbTable")); - return false; + return FALSE; } else return(getRec(SQL_FETCH_FIRST)); @@ -889,7 +889,7 @@ bool wxDbTable::GetLast(void) if (pDb->FwdOnlyCursors()) { wxFAIL_MSG(wxT("GetLast()::Backward scrolling cursors are not enabled for this instance of wxDbTable")); - return false; + return FALSE; } else return(getRec(SQL_FETCH_LAST)); @@ -982,13 +982,13 @@ void wxDbTable::BuildSelectStmt(wxString &pSqlStmt, int typeOfSelect, bool disti // Was a FROM clause specified to join tables to the base table? // Available for ::Query() only!!! - bool appendFromClause = false; + bool appendFromClause = FALSE; #if wxODBC_BACKWARD_COMPATABILITY if (typeOfSelect == DB_SELECT_WHERE && from && wxStrlen(from)) - appendFromClause = true; + appendFromClause = TRUE; #else if (typeOfSelect == DB_SELECT_WHERE && from.Length()) - appendFromClause = true; + appendFromClause = TRUE; #endif // Add the column list @@ -1108,7 +1108,7 @@ void wxDbTable::BuildUpdateStmt(wxString &pSqlStmt, int typeOfUpd, const wxStrin wxString whereClause; whereClause.Empty(); - bool firstColumn = true; + bool firstColumn = TRUE; pSqlStmt.Printf(wxT("UPDATE %s SET "), tableName.Upper().c_str()); @@ -1122,7 +1122,7 @@ void wxDbTable::BuildUpdateStmt(wxString &pSqlStmt, int typeOfUpd, const wxStrin if (!firstColumn) pSqlStmt += wxT(","); else - firstColumn = false; + firstColumn = FALSE; pSqlStmt += colDefs[i].ColName; pSqlStmt += wxT(" = ?"); } @@ -1181,7 +1181,7 @@ void wxDbTable::BuildWhereClause(wxString &pWhereClause, int typeOfWhere, * They are not included as part of the where clause. */ { - bool moreThanOneColumn = false; + bool moreThanOneColumn = FALSE; wxString colValue; // Loop through the columns building a where clause as you go @@ -1199,7 +1199,7 @@ void wxDbTable::BuildWhereClause(wxString &pWhereClause, int typeOfWhere, if (moreThanOneColumn) pWhereClause += wxT(" AND "); else - moreThanOneColumn = true; + moreThanOneColumn = TRUE; // Concatenate where phrase for the column if (qualTableName.Length()) { @@ -1275,7 +1275,7 @@ bool wxDbTable::CloseCursor(HSTMT cursor) return(pDb->DispAllErrors(henv, hdbc, cursor)); // Completed successfully - return(true); + return(TRUE); } // wxDbTable::CloseCursor() @@ -1284,7 +1284,7 @@ bool wxDbTable::CloseCursor(HSTMT cursor) bool wxDbTable::CreateTable(bool attemptDrop) { if (!pDb) - return false; + return FALSE; int i, j; wxString sqlStmt; @@ -1295,7 +1295,7 @@ bool wxDbTable::CreateTable(bool attemptDrop) // Drop table first if (attemptDrop && !DropTable()) - return false; + return FALSE; // Create the table #ifdef DBDEBUG_CONSOLE @@ -1328,7 +1328,7 @@ bool wxDbTable::CreateTable(bool attemptDrop) #endif // Build a CREATE TABLE string from the colDefs structure. - bool needComma = false; + bool needComma = FALSE; sqlStmt.Printf(wxT("CREATE TABLE %s ("), tableName.c_str()); for (i = 0; i < noCols; i++) @@ -1382,7 +1382,7 @@ bool wxDbTable::CreateTable(bool attemptDrop) } } - needComma = true; + needComma = TRUE; } // If there is a primary key defined, include it in the create statement for (i = j = 0; i < noCols; i++) @@ -1460,17 +1460,17 @@ bool wxDbTable::CreateTable(bool attemptDrop) pDb->DispAllErrors(henv, hdbc, hstmt); pDb->RollbackTrans(); CloseCursor(hstmt); - return(false); + return(FALSE); } // Commit the transaction and close the cursor if (!pDb->CommitTrans()) - return(false); + return(FALSE); if (!CloseCursor(hstmt)) - return(false); + return(FALSE); // Database table created successfully - return(true); + return(TRUE); } // wxDbTable::CreateTable() @@ -1478,7 +1478,7 @@ bool wxDbTable::CreateTable(bool attemptDrop) /********** wxDbTable::DropTable() **********/ bool wxDbTable::DropTable() { - // NOTE: This function returns true if the Table does not exist, but + // NOTE: This function returns TRUE if the Table does not exist, but // only for identified databases. Code will need to be added // below for any other databases when those databases are defined // to handle this situation consistently @@ -1514,18 +1514,18 @@ bool wxDbTable::DropTable() pDb->DispAllErrors(henv, hdbc, hstmt); pDb->RollbackTrans(); // CloseCursor(hstmt); - return(false); + return(FALSE); } } } // Commit the transaction and close the cursor if (! pDb->CommitTrans()) - return(false); + return(FALSE); if (! CloseCursor(hstmt)) - return(false); + return(FALSE); - return(true); + return(TRUE); } // wxDbTable::DropTable() @@ -1537,7 +1537,7 @@ bool wxDbTable::CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCol // Drop the index first if (attemptDrop && !DropIndex(idxName)) - return (false); + return (FALSE); // MySQL (and possibly Sybase ASE?? - gt) require that any columns which are used as portions // of an index have the columns defined as "NOT NULL". During initial table creation though, @@ -1551,11 +1551,11 @@ bool wxDbTable::CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCol { wxString sqlStmt; int i; - bool ok = true; + bool ok = TRUE; for (i = 0; i < noIdxCols && ok; i++) { int j = 0; - bool found = false; + bool found = FALSE; // Find the column definition that has the ColName that matches the // index column name. We need to do this to get the DB_DATA_TYPE of // the index column, as MySQL's syntax for the ALTER column requires @@ -1563,7 +1563,7 @@ bool wxDbTable::CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCol while (!found && (j < this->noCols)) { if (wxStrcmp(colDefs[j].ColName,pIdxDefs[i].ColName) == 0) - found = true; + found = TRUE; if (!found) j++; } @@ -1584,14 +1584,14 @@ bool wxDbTable::CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCol } } else - ok = false; + ok = FALSE; } if (ok) pDb->CommitTrans(); else { pDb->RollbackTrans(); - return(false); + return(FALSE); } } @@ -1643,17 +1643,17 @@ bool wxDbTable::CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCol pDb->DispAllErrors(henv, hdbc, hstmt); pDb->RollbackTrans(); CloseCursor(hstmt); - return(false); + return(FALSE); } // Commit the transaction and close the cursor if (! pDb->CommitTrans()) - return(false); + return(FALSE); if (! CloseCursor(hstmt)) - return(false); + return(FALSE); // Index Created Successfully - return(true); + return(TRUE); } // wxDbTable::CreateIndex() @@ -1661,7 +1661,7 @@ bool wxDbTable::CreateIndex(const wxString &idxName, bool unique, UWORD noIdxCol /********** wxDbTable::DropIndex() **********/ bool wxDbTable::DropIndex(const wxString &idxName) { - // NOTE: This function returns true if the Index does not exist, but + // NOTE: This function returns TRUE if the Index does not exist, but // only for identified databases. Code will need to be added // below for any other databases when those databases are defined // to handle this situation consistently @@ -1703,18 +1703,18 @@ bool wxDbTable::DropIndex(const wxString &idxName) pDb->DispAllErrors(henv, hdbc, hstmt); pDb->RollbackTrans(); CloseCursor(hstmt); - return(false); + return(FALSE); } } } // Commit the transaction and close the cursor if (! pDb->CommitTrans()) - return(false); + return(FALSE); if (! CloseCursor(hstmt)) - return(false); + return(FALSE); - return(true); + return(TRUE); } // wxDbTable::DropIndex() @@ -1724,7 +1724,7 @@ bool wxDbTable::SetOrderByColNums(UWORD first, ... ) int colNo = first; // using 'int' to be able to look for wxDB_NO_MORE_COLUN_NUMBERS va_list argptr; - bool abort = false; + bool abort = FALSE; wxString tempStr; va_start(argptr, first); /* Initialize variable arguments. */ @@ -1736,7 +1736,7 @@ bool wxDbTable::SetOrderByColNums(UWORD first, ... ) // Valid columns are 0 thru noCols-1 if (colNo >= noCols || colNo < 0) { - abort = true; + abort = TRUE; continue; } @@ -1791,7 +1791,7 @@ bool wxDbTable::Update(void) { wxASSERT(!queryOnly); if (queryOnly) - return(false); + return(FALSE); wxString sqlStmt; @@ -1815,7 +1815,7 @@ bool wxDbTable::Update(const wxString &pSqlStmt) { wxASSERT(!queryOnly); if (queryOnly) - return(false); + return(FALSE); pDb->WriteSqlLog(pSqlStmt); @@ -1829,7 +1829,7 @@ bool wxDbTable::UpdateWhere(const wxString &pWhereClause) { wxASSERT(!queryOnly); if (queryOnly) - return(false); + return(FALSE); wxString sqlStmt; @@ -1853,7 +1853,7 @@ bool wxDbTable::Delete(void) { wxASSERT(!queryOnly); if (queryOnly) - return(false); + return(FALSE); wxString sqlStmt; sqlStmt.Empty(); @@ -1874,7 +1874,7 @@ bool wxDbTable::DeleteWhere(const wxString &pWhereClause) { wxASSERT(!queryOnly); if (queryOnly) - return(false); + return(FALSE); wxString sqlStmt; sqlStmt.Empty(); @@ -1895,7 +1895,7 @@ bool wxDbTable::DeleteMatching(void) { wxASSERT(!queryOnly); if (queryOnly) - return(false); + return(FALSE); wxString sqlStmt; sqlStmt.Empty(); @@ -1915,7 +1915,7 @@ bool wxDbTable::DeleteMatching(void) bool wxDbTable::IsColNull(UWORD colNo) const { /* - This logic is just not right. It would indicate true + This logic is just not right. It would indicate TRUE if a numeric field were set to a value of 0. switch(colDefs[colNo].SqlCtype) @@ -1938,11 +1938,11 @@ bool wxDbTable::IsColNull(UWORD colNo) const TIMESTAMP_STRUCT *pDt; pDt = (TIMESTAMP_STRUCT *) colDefs[colNo].PtrDataObj; if (pDt->year == 0 && pDt->month == 0 && pDt->day == 0) - return(true); + return(TRUE); else - return(false); + return(FALSE); default: - return(true); + return(TRUE); } */ return (colDefs[colNo].Null); @@ -1953,16 +1953,16 @@ bool wxDbTable::IsColNull(UWORD colNo) const bool wxDbTable::CanSelectForUpdate(void) { if (queryOnly) - return false; + return FALSE; if (pDb->Dbms() == dbmsMY_SQL) - return false; + return FALSE; if ((pDb->Dbms() == dbmsORACLE) || (pDb->dbInf.posStmts & SQL_PS_SELECT_FOR_UPDATE)) - return(true); + return(TRUE); else - return(false); + return(FALSE); } // wxDbTable::CanSelectForUpdate() @@ -1971,15 +1971,15 @@ bool wxDbTable::CanSelectForUpdate(void) bool wxDbTable::CanUpdByROWID(void) { /* - * NOTE: Returning false for now until this can be debugged, + * NOTE: Returning FALSE for now until this can be debugged, * as the ROWID is not getting updated correctly */ - return false; + return FALSE; /* if (pDb->Dbms() == dbmsORACLE) - return(true); + return(TRUE); else - return(false); + return(FALSE); */ } // wxDbTable::CanUpdByROWID() @@ -1988,9 +1988,9 @@ bool wxDbTable::CanUpdByROWID(void) bool wxDbTable::IsCursorClosedOnCommit(void) { if (pDb->dbInf.cursorCommitBehavior == SQL_CB_PRESERVE) - return(false); + return(FALSE); else - return(true); + return(TRUE); } // wxDbTable::IsCursorClosedOnCommit() @@ -2067,7 +2067,7 @@ bool wxDbTable::SetQueryTimeout(UDWORD nSeconds) return(pDb->DispAllErrors(henv, hdbc, hstmtInternal)); // Completed Successfully - return(true); + return(TRUE); } // wxDbTable::SetQueryTimeout() @@ -2101,8 +2101,8 @@ void wxDbTable::SetColDefs(UWORD index, const wxString &fieldName, int dataType, // Derived columns by definition would NOT be "Insertable" or "Updateable" if (derivedCol) { - colDefs[index].Updateable = false; - colDefs[index].InsertAllowed = false; + colDefs[index].Updateable = FALSE; + colDefs[index].InsertAllowed = FALSE; } else { @@ -2110,7 +2110,7 @@ void wxDbTable::SetColDefs(UWORD index, const wxString &fieldName, int dataType, colDefs[index].InsertAllowed = insAllow; } - colDefs[index].Null = false; + colDefs[index].Null = FALSE; } // wxDbTable::SetColDefs() @@ -2246,7 +2246,7 @@ ULONG wxDbTable::Count(const wxString &args) // Initialize the Count cursor if it's not already initialized if (!hstmtCount) { - hstmtCount = GetNewCursor(false,false); + hstmtCount = GetNewCursor(FALSE,FALSE); wxASSERT(hstmtCount); if (!hstmtCount) return(0); @@ -2286,7 +2286,7 @@ ULONG wxDbTable::Count(const wxString &args) /********** wxDbTable::Refresh() **********/ bool wxDbTable::Refresh(void) { - bool result = true; + bool result = TRUE; // Switch to the internal cursor so any active cursors are not corrupted HSTMT currCursor = GetCursor(); @@ -2329,10 +2329,10 @@ bool wxDbTable::Refresh(void) where = whereClause; orderBy.Empty(); if (!Query()) - result = false; + result = FALSE; if (result && !GetNext()) - result = false; + result = FALSE; // Switch back to original cursor SetCursor(&currCursor); @@ -2357,11 +2357,11 @@ bool wxDbTable::SetColNull(UWORD colNo, bool set) { colDefs[colNo].Null = set; if (set) // Blank out the values in the member variable - ClearMemberVar(colNo,false); // Must call with false, or infinite recursion will happen - return(true); + ClearMemberVar(colNo,FALSE); // Must call with FALSE, or infinite recursion will happen + return(TRUE); } else - return(false); + return(FALSE); } // wxDbTable::SetColNull() @@ -2380,11 +2380,11 @@ bool wxDbTable::SetColNull(const wxString &colName, bool set) { colDefs[i].Null = set; if (set) // Blank out the values in the member variable - ClearMemberVar(i,false); // Must call with false, or infinite recursion will happen - return(true); + ClearMemberVar(i,FALSE); // Must call with FALSE, or infinite recursion will happen + return(TRUE); } else - return(false); + return(FALSE); } // wxDbTable::SetColNull() @@ -2431,7 +2431,7 @@ HSTMT *wxDbTable::GetNewCursor(bool setCursor, bool bindColumns) /********** wxDbTable::DeleteCursor() **********/ bool wxDbTable::DeleteCursor(HSTMT *hstmtDel) { - bool result = true; + bool result = TRUE; if (!hstmtDel) // Cursor already deleted return(result); @@ -2444,7 +2444,7 @@ ODBC 3.0 says to use this form if (SQLFreeStmt(*hstmtDel, SQL_DROP) != SQL_SUCCESS) { pDb->DispAllErrors(henv, hdbc); - result = false; + result = FALSE; } delete hstmtDel; @@ -2461,7 +2461,7 @@ void wxDbTable::SetRowMode(const rowmode_t rowmode) { if (!m_hstmtGridQuery) { - m_hstmtGridQuery = GetNewCursor(false,false); + m_hstmtGridQuery = GetNewCursor(FALSE,FALSE); if (!bindCols(*m_hstmtGridQuery)) return; } @@ -2555,7 +2555,7 @@ void wxDbTable::SetCol(const int col, const wxVariant val) { //Returns null if invalid! if (!dateval.ParseDate(val.GetString())) - SetColNull(col,true); + SetColNull(col,TRUE); } switch (colDefs[col].SqlCtype) @@ -2668,7 +2668,7 @@ void wxDbTable::SetKey(const GenericKey& k) { if (colDefs[i].KeyField) { - SetColNull(i, false); + SetColNull(i, FALSE); memcpy(colDefs[i].PtrDataObj, blkptr, colDefs[i].SzDataObj); blkptr += colDefs[i].SzDataObj; }