Date: Friday, February 24, 2006 @ 16:08:55
  Author: marc
    Path: /cvsroot/carob/odbsequoia/src

Modified: stmt.cpp (1.12 -> 1.13)

hid static_cast<ODBCItem *> into new objectify() function.


----------+
 stmt.cpp |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)


Index: odbsequoia/src/stmt.cpp
diff -u odbsequoia/src/stmt.cpp:1.12 odbsequoia/src/stmt.cpp:1.13
--- odbsequoia/src/stmt.cpp:1.12        Mon Jan 23 13:00:44 2006
+++ odbsequoia/src/stmt.cpp     Fri Feb 24 16:08:55 2006
@@ -29,11 +29,23 @@
 using namespace ODBSeqNS;
 using namespace CarobNS;
 
+namespace {
+
+ODBCStatement *
+objectify(SQLHANDLE StatementHandle)
+{
+    // We don't expect the driver manager to give us corrupted handles
+    return static_cast<ODBCStatement *>(StatementHandle);
+
+}
+
+}
+
 SQLRETURN      
 SQLExecDirectW(SQLHSTMT StatementHandle,
                SQLWCHAR *StatementText, SQLINTEGER TextLength)
 {
-    ODBCStatement * self_p = static_cast<ODBCStatement *>(StatementHandle);
+    ODBCStatement * self_p = objectify(StatementHandle);
     self_p->clear_diags();
 
     _PROTECT_SQLRETURN(self_p, exec_directw(StatementText, TextLength));
@@ -53,10 +65,10 @@
     return SQL_SUCCESS;
 }
 
-SQLRETURN
+SQLRETURN // FIXME : use descriptors instead
 SQLRowCount(SQLHSTMT shdle, SQLLEN * rowcount)
 {
-    ODBCStatement * self_p = (ODBCStatement *)shdle;
+    ODBCStatement * self_p = objectify(shdle);
     self_p->clear_diags();
 
     if (S5 != self_p->state

_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits

Reply via email to