apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject svn commit: r747631 - in /apr/apr-util/branches/1.4.x: ./ dbd/apr_dbd_odbc.c
Date Wed, 25 Feb 2009 00:50:11 GMT
Author: bojan
Date: Wed Feb 25 00:50:10 2009
New Revision: 747631

URL: http://svn.apache.org/viewvc?rev=747631&view=rev
Log:
Backport r747630 from the trunk.
Clean up ODBC types. Warnings seen when compiling packages for Fedora 11.

Modified:
    apr/apr-util/branches/1.4.x/   (props changed)
    apr/apr-util/branches/1.4.x/dbd/apr_dbd_odbc.c

Propchange: apr/apr-util/branches/1.4.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Feb 25 00:50:10 2009
@@ -1 +1 @@
-/apr/apr-util/trunk:731033-731034,731225,731236,731291,731293,731379,743986,744009,745771,747612,747623
+/apr/apr-util/trunk:731033-731034,731225,731236,731291,731293,731379,743986,744009,745771,747612,747623,747630

Modified: apr/apr-util/branches/1.4.x/dbd/apr_dbd_odbc.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.4.x/dbd/apr_dbd_odbc.c?rev=747631&r1=747630&r2=747631&view=diff
==============================================================================
--- apr/apr-util/branches/1.4.x/dbd/apr_dbd_odbc.c (original)
+++ apr/apr-util/branches/1.4.x/dbd/apr_dbd_odbc.c Wed Feb 25 00:50:10 2009
@@ -500,9 +500,9 @@
     SQLRETURN rc;
     SQLSMALLINT baseType, cType;
     void *ptr;
-    SQLUINTEGER len;
-    SQLINTEGER *indicator;
-    static SQLINTEGER nullValue = SQL_NULL_DATA;
+    SQLULEN len;
+    SQLLEN *indicator;
+    static SQLLEN nullValue = SQL_NULL_DATA;
     static SQLSMALLINT inOut = SQL_PARAM_INPUT;     /* only input params */
 
     /* bind a NULL data value */
@@ -522,7 +522,7 @@
         /* LOBs */
         if (IS_LOB(cType)) {
             ptr = (void *) args[*argp];
-            len = (SQLUINTEGER) * (apr_size_t *) args[*argp + 1];
+            len = (SQLULEN) * (apr_size_t *) args[*argp + 1];
             cType = (IS_CLOB(cType)) ? SQL_C_CHAR : SQL_C_DEFAULT;
             (*argp) += 4;  /* LOBs consume 4 args (last two are unused) */
         }
@@ -534,7 +534,7 @@
             case SQL_TIME:
             case SQL_TIMESTAMP:
                 ptr = (void *) args[*argp];
-                len = (SQLUINTEGER) strlen(ptr);
+                len = (SQLULEN) strlen(ptr);
                 break;
             case SQL_TINYINT:
                 ptr = apr_palloc(pool, sizeof(unsigned char));
@@ -619,7 +619,7 @@
                                          apr_size_t *len, apr_read_type_e block)
 {
     SQLRETURN rc;
-    SQLINTEGER len_indicator;
+    SQLLEN len_indicator;
     SQLSMALLINT type;
     odbc_bucket *bd = (odbc_bucket *) e->data;
     apr_bucket *nxt;
@@ -666,8 +666,8 @@
              * We try to handle both interpretations.
              */
             *len =  (len_indicator > bufsize 
-                     && len_indicator >= (SQLINTEGER) e->start)
-                ? (len_indicator - (SQLINTEGER) e->start) : len_indicator;
+                     && len_indicator >= (SQLLEN) e->start)
+                ? (len_indicator - (SQLLEN) e->start) : len_indicator;
 
             eos = 1;
         }
@@ -731,7 +731,7 @@
                       const SQLSMALLINT sqltype)
 {
     SQLRETURN rc;
-    SQLINTEGER indicator;
+    SQLLEN indicator;
     int state = row->res->colstate[col];
     int options = row->res->apr_dbd->dboptions;
 
@@ -1028,7 +1028,7 @@
             err_step="SQLSetConnectAttr (from DBD Parameters)";
             err_htype = SQL_HANDLE_DBC;
             err_h = hdbc;
-            rc = SQLSetConnectAttr(hdbc, attrs[i], (void *) attrvals[i], 0);
+            rc = SQLSetConnectAttr(hdbc, attrs[i], (SQLPOINTER) attrvals[i], 0);
         }
     }
     if (SQL_SUCCEEDED(rc)) {
@@ -1119,8 +1119,8 @@
     SQLRETURN rc = SQL_SUCCESS;
 
     if (handle->transaction_mode) {
-        rc = SQLSetConnectAttr(handle->dbc, SQL_ATTR_TXN_ISOLATION, (void *)
-                               handle->transaction_mode, 0);
+        rc = SQLSetConnectAttr(handle->dbc, SQL_ATTR_TXN_ISOLATION,
+                               (SQLPOINTER) handle->transaction_mode, 0);
         CHECK_ERROR(handle, "SQLSetConnectAttr (SQL_ATTR_TXN_ISOLATION)", rc,
                     SQL_HANDLE_DBC, handle->dbc);
     }
@@ -1180,7 +1180,10 @@
     CHECK_ERROR(handle, "SQLExecDirect", rc, SQL_HANDLE_STMT, hstmt);
 
     if SQL_SUCCEEDED(rc) {
-        rc = SQLRowCount(hstmt,  (SQLINTEGER *) nrows);
+        SQLLEN rowcount;
+
+        rc = SQLRowCount(hstmt, &rowcount);
+        *nrows = (int) rowcount;
         CHECK_ERROR(handle, "SQLRowCount", rc, SQL_HANDLE_STMT, hstmt);
     }
 
@@ -1242,7 +1245,7 @@
 static int odbc_num_tuples(apr_dbd_results_t *res)
 {
     SQLRETURN rc;
-    SQLINTEGER  nrows;
+    SQLLEN nrows;
 
     rc = SQLRowCount(res->stmt, &nrows);
     CHECK_ERROR(res->apr_dbd, "SQLRowCount", rc, SQL_HANDLE_STMT, res->stmt);
@@ -1425,7 +1428,10 @@
                     statement->stmt);
         }
     if (SQL_SUCCEEDED(rc)) {
-        rc = SQLRowCount(statement->stmt, (SQLINTEGER *) nrows);
+        SQLLEN rowcount;
+
+        rc = SQLRowCount(statement->stmt, &rowcount);
+        *nrows = (int) rowcount;
         CHECK_ERROR(handle, "SQLRowCount", rc, SQL_HANDLE_STMT,
                     statement->stmt);
         }
@@ -1500,7 +1506,7 @@
     SQLRETURN rc;
     char buffer[MAX_COLUMN_NAME];
     SQLSMALLINT colnamelength, coltype, coldecimal, colnullable;
-    SQLUINTEGER colsize;
+    SQLULEN colsize;
 
     if (col >= res->ncols)
         return NULL;            /* bogus column number */
@@ -1555,7 +1561,10 @@
                     statement->stmt);
         }
     if (SQL_SUCCEEDED(rc)) {
-        rc = SQLRowCount(statement->stmt, (SQLINTEGER *) nrows);
+        SQLLEN rowcount;
+
+        rc = SQLRowCount(statement->stmt, &rowcount);
+        *nrows = (int) rowcount;
         CHECK_ERROR(handle, "SQLRowCount", rc, SQL_HANDLE_STMT,
                     statement->stmt);
         }



Mime
View raw message