From commits-return-10217-apmail-apr-commits-archive=apr.apache.org@apr.apache.org Wed Feb 25 00:48:41 2009 Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 14378 invoked from network); 25 Feb 2009 00:48:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Feb 2009 00:48:40 -0000 Received: (qmail 78439 invoked by uid 500); 25 Feb 2009 00:48:40 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 78408 invoked by uid 500); 25 Feb 2009 00:48:40 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 78399 invoked by uid 99); 25 Feb 2009 00:48:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Feb 2009 16:48:40 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Feb 2009 00:48:39 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 66B132388999; Wed, 25 Feb 2009 00:48:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r747630 - /apr/apr-util/trunk/dbd/apr_dbd_odbc.c Date: Wed, 25 Feb 2009 00:48:19 -0000 To: commits@apr.apache.org From: bojan@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090225004819.66B132388999@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: bojan Date: Wed Feb 25 00:48:18 2009 New Revision: 747630 URL: http://svn.apache.org/viewvc?rev=747630&view=rev Log: Clean up ODBC types. Warnings seen when compiling packages for Fedora 11. Modified: apr/apr-util/trunk/dbd/apr_dbd_odbc.c Modified: apr/apr-util/trunk/dbd/apr_dbd_odbc.c URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/dbd/apr_dbd_odbc.c?rev=747630&r1=747629&r2=747630&view=diff ============================================================================== --- apr/apr-util/trunk/dbd/apr_dbd_odbc.c (original) +++ apr/apr-util/trunk/dbd/apr_dbd_odbc.c Wed Feb 25 00:48:18 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); }