com php-src: fix ibase handle initialization, mostly compiler warnings: ext/pdo_firebird/firebird_driver.c ext/pdo_firebird/f irebird_statement.c
ext/pdo_firebird/php_pdo_firebi rd_int.h

From: Date: Mon, 06 Jun 2016 11:30:17 +0000
Subject: com php-src: fix ibase handle initialization, mostly compiler warnings: ext/pdo_firebird/firebird_driver.c ext/pdo_firebird/f irebird_statement.c
ext/pdo_firebird/php_pdo_firebi rd_int.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-92325@lists.php.net to get a copy of this message
Commit: 3e6c02b91a62e3fd640dfa199f8e4178a6680821 Author: Anatol Belski <ab@php.net> Mon, 6 Jun 2016 13:30:17 +0200 Parents: 174c3371bd8004d27d6c0548afea5ff6f479e2a4 Branches: PHP-7.0 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3e6c02b91a62e3fd640dfa199f8e4178a6680821 Log: fix ibase handle initialization, mostly compiler warnings Changed paths: M ext/pdo_firebird/firebird_driver.c M ext/pdo_firebird/firebird_statement.c M ext/pdo_firebird/php_pdo_firebird_int.h Diff: diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c index 5f85796..b26939c 100644 --- a/ext/pdo_firebird/firebird_driver.c +++ b/ext/pdo_firebird/firebird_driver.c @@ -138,7 +138,7 @@ static int firebird_handle_preparer(pdo_dbh_t *dbh, const char *sql, size_t sql_ HashTable *np; do { - isc_stmt_handle s = NULL; + isc_stmt_handle s = PDO_FIREBIRD_HANDLE_INITIALIZER; XSQLDA num_sqlda; static char const info[] = { isc_info_sql_stmt_type }; char result[8]; @@ -219,7 +219,7 @@ static int firebird_handle_preparer(pdo_dbh_t *dbh, const char *sql, size_t sql_ static zend_long firebird_handle_doer(pdo_dbh_t *dbh, const char *sql, size_t sql_len) /* {{{ */ { pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data; - isc_stmt_handle stmt = NULL; + isc_stmt_handle stmt = PDO_FIREBIRD_HANDLE_INITIALIZER; static char const info_count[] = { isc_info_sql_records }; char result[64]; int ret = 0; diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c index 11f39e0..d6bfa02 100644 --- a/ext/pdo_firebird/firebird_statement.c +++ b/ext/pdo_firebird/firebird_statement.c @@ -223,7 +223,7 @@ static int firebird_fetch_blob(pdo_stmt_t *stmt, int colno, char **ptr, /* {{{ * { pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data; pdo_firebird_db_handle *H = S->H; - isc_blob_handle blobh = NULL; + isc_blob_handle blobh = PDO_FIREBIRD_HANDLE_INITIALIZER; char const bl_item = isc_info_blob_total_length; char bl_info[20]; unsigned short i; @@ -412,7 +412,7 @@ static int firebird_bind_blob(pdo_stmt_t *stmt, ISC_QUAD *blob_id, zval *param) { pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data; pdo_firebird_db_handle *H = S->H; - isc_blob_handle h = NULL; + isc_blob_handle h = PDO_FIREBIRD_HANDLE_INITIALIZER; zend_ulong put_cnt = 0, rem_cnt; unsigned short chunk_size; int result = 1; diff --git a/ext/pdo_firebird/php_pdo_firebird_int.h b/ext/pdo_firebird/php_pdo_firebird_int.h index b7b00bf..917f224 100644 --- a/ext/pdo_firebird/php_pdo_firebird_int.h +++ b/ext/pdo_firebird/php_pdo_firebird_int.h @@ -61,6 +61,12 @@ typedef void (*info_func_t)(char*); #define min(a,b) ((a)<(b)?(a):(b)) #endif +#if defined(_LP64) || defined(__LP64__) || defined(__arch64__) || defined(_WIN64) +# define PDO_FIREBIRD_HANDLE_INITIALIZER 0U +#else +# define PDO_FIREBIRD_HANDLE_INITIALIZER NULL +#endif + typedef struct { /* the result of the last API call */

« previous php.cvs (#92325) next »