Changeset: 150f184a0eb7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/150f184a0eb7
Modified Files:
clients/odbc/driver/ODBCDbc.c
clients/odbc/driver/ODBCDbc.h
clients/odbc/driver/ODBCDesc.c
clients/odbc/driver/ODBCDesc.h
clients/odbc/driver/ODBCEnv.c
clients/odbc/driver/ODBCEnv.h
clients/odbc/driver/ODBCStmt.c
clients/odbc/driver/ODBCStmt.h
Branch: default
Log Message:
Use bool instead of int as return type for internal isValidXxx() functions.
diffs (140 lines):
diff --git a/clients/odbc/driver/ODBCDbc.c b/clients/odbc/driver/ODBCDbc.c
--- a/clients/odbc/driver/ODBCDbc.c
+++ b/clients/odbc/driver/ODBCDbc.c
@@ -97,10 +97,10 @@ newODBCDbc(ODBCEnv *env)
* and save usage of the handle and prevent crashes as much as possible.
*
* Precondition: none
- * Postcondition: returns 1 if it is a valid connection handle,
- * returns 0 if is invalid and thus an unusable handle.
+ * Postcondition: returns true if it is a valid connection handle,
+ * returns false if is invalid and thus an unusable handle.
*/
-int
+bool
isValidDbc(ODBCDbc *dbc)
{
#ifdef ODBCDEBUG
diff --git a/clients/odbc/driver/ODBCDbc.h b/clients/odbc/driver/ODBCDbc.h
--- a/clients/odbc/driver/ODBCDbc.h
+++ b/clients/odbc/driver/ODBCDbc.h
@@ -93,10 +93,10 @@ ODBCDbc *newODBCDbc(ODBCEnv *env);
* and save usage of the handle and prevent crashes as much as possible.
*
* Precondition: none
- * Postcondition: returns 1 if it is a valid connection handle,
- * returns 0 if is invalid and thus an unusable handle.
+ * Postcondition: returns true if it is a valid connection handle,
+ * returns false if is invalid and thus an unusable handle.
*/
-int isValidDbc(ODBCDbc *dbc);
+bool isValidDbc(ODBCDbc *dbc);
/*
diff --git a/clients/odbc/driver/ODBCDesc.c b/clients/odbc/driver/ODBCDesc.c
--- a/clients/odbc/driver/ODBCDesc.c
+++ b/clients/odbc/driver/ODBCDesc.c
@@ -52,10 +52,10 @@ newODBCDesc(ODBCDbc *dbc)
* and save usage of the handle and prevent crashes as much as possible.
*
* Precondition: none
- * Postcondition: returns 1 if it is a valid statement handle,
- * returns 0 if is invalid and thus an unusable handle.
+ * Postcondition: returns true if it is a valid statement handle,
+ * returns false if is invalid and thus an unusable handle.
*/
-int
+bool
isValidDesc(ODBCDesc *desc)
{
#ifdef ODBCDEBUG
diff --git a/clients/odbc/driver/ODBCDesc.h b/clients/odbc/driver/ODBCDesc.h
--- a/clients/odbc/driver/ODBCDesc.h
+++ b/clients/odbc/driver/ODBCDesc.h
@@ -79,7 +79,7 @@ typedef struct {
#define isIPD(desc) (isID(desc) && (desc)->Stmt->ImplParamDescr == (desc))
ODBCDesc *newODBCDesc(ODBCDbc *dbc);
-int isValidDesc(ODBCDesc *desc);
+bool isValidDesc(ODBCDesc *desc);
void addDescError(ODBCDesc *desc, const char *SQLState, const char *errMsg,
int nativeErrCode);
ODBCError *getDescError(ODBCDesc *desc);
diff --git a/clients/odbc/driver/ODBCEnv.c b/clients/odbc/driver/ODBCEnv.c
--- a/clients/odbc/driver/ODBCEnv.c
+++ b/clients/odbc/driver/ODBCEnv.c
@@ -66,10 +66,10 @@ newODBCEnv(void)
* and save usage of the handle and prevent crashes as much as possible.
*
* Precondition: none
- * Postcondition: returns 1 if it is a valid environment handle,
- * returns 0 if is invalid and thus an unusable handle.
+ * Postcondition: returns true if it is a valid environment handle,
+ * returns false if is invalid and thus an unusable handle.
*/
-int
+bool
isValidEnv(ODBCEnv *env)
{
#ifdef ODBCDEBUG
diff --git a/clients/odbc/driver/ODBCEnv.h b/clients/odbc/driver/ODBCEnv.h
--- a/clients/odbc/driver/ODBCEnv.h
+++ b/clients/odbc/driver/ODBCEnv.h
@@ -67,10 +67,10 @@ ODBCEnv *newODBCEnv(void);
* and save usage of the handle and prevent crashes as much as possible.
*
* Precondition: none
- * Postcondition: returns 1 if it is a valid environment handle,
- * returns 0 if is invalid and thus an unusable handle.
+ * Postcondition: returns true if it is a valid environment handle,
+ * returns false if is invalid and thus an unusable handle.
*/
-int isValidEnv(ODBCEnv *env);
+bool isValidEnv(ODBCEnv *env);
/*
diff --git a/clients/odbc/driver/ODBCStmt.c b/clients/odbc/driver/ODBCStmt.c
--- a/clients/odbc/driver/ODBCStmt.c
+++ b/clients/odbc/driver/ODBCStmt.c
@@ -123,10 +123,10 @@ newODBCStmt(ODBCDbc *dbc)
* and save usage of the handle and prevent crashes as much as possible.
*
* Precondition: none
- * Postcondition: returns 1 if it is a valid statement handle,
- * returns 0 if is invalid and thus an unusable handle.
+ * Postcondition: returns true if it is a valid statement handle,
+ * returns false if is invalid and thus an unusable handle.
*/
-int
+bool
isValidStmt(ODBCStmt *stmt)
{
#ifdef ODBCDEBUG
@@ -165,7 +165,7 @@ addStmtError(ODBCStmt *stmt, const char
* The error object itself is removed from the error list.
* The caller is now responsible for freeing the error object memory.
*
- * Precondition: stmt and error must be valid
+ * Precondition: stmt must be valid
* Postcondition: returns a ODBCError object or null when no error is
available.
*/
ODBCError *
diff --git a/clients/odbc/driver/ODBCStmt.h b/clients/odbc/driver/ODBCStmt.h
--- a/clients/odbc/driver/ODBCStmt.h
+++ b/clients/odbc/driver/ODBCStmt.h
@@ -119,10 +119,10 @@ ODBCStmt *newODBCStmt(ODBCDbc *dbc);
* and save usage of the handle and prevent crashes as much as possible.
*
* Precondition: none
- * Postcondition: returns 1 if it is a valid statement handle,
- * returns 0 if is invalid and thus an unusable handle.
+ * Postcondition: returns true if it is a valid statement handle,
+ * returns false if is invalid and thus an unusable handle.
*/
-int isValidStmt(ODBCStmt *stmt);
+bool isValidStmt(ODBCStmt *stmt);
/*
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]