diff options
author | Anatol Belski <ab@php.net> | 2016-06-06 13:30:17 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2016-06-06 13:30:17 +0200 |
commit | 3e6c02b91a62e3fd640dfa199f8e4178a6680821 (patch) | |
tree | e52117b924e7527740cf5ee0a851e3aa7fe03cd8 /ext/pdo_firebird | |
parent | 174c3371bd8004d27d6c0548afea5ff6f479e2a4 (diff) | |
download | php-git-3e6c02b91a62e3fd640dfa199f8e4178a6680821.tar.gz |
fix ibase handle initialization, mostly compiler warnings
Diffstat (limited to 'ext/pdo_firebird')
-rw-r--r-- | ext/pdo_firebird/firebird_driver.c | 4 | ||||
-rw-r--r-- | ext/pdo_firebird/firebird_statement.c | 4 | ||||
-rw-r--r-- | ext/pdo_firebird/php_pdo_firebird_int.h | 6 |
3 files changed, 10 insertions, 4 deletions
diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c index 5f85796f8a..b26939ccd2 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 11f39e08a0..d6bfa021a5 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 b7b00bf924..917f224e80 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 */ |