Skip to content

Commit eb753f7

Browse files
committed
Merge remote-tracking branch 'php/master' into win_mb_path_w_only
* php/master: fix ibase handle initialization, mostly compiler warnings
2 parents a98765f + da280d4 commit eb753f7

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

ext/pdo_firebird/firebird_driver.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ static int firebird_handle_preparer(pdo_dbh_t *dbh, const char *sql, size_t sql_
138138
HashTable *np;
139139

140140
do {
141-
isc_stmt_handle s = NULL;
141+
isc_stmt_handle s = PDO_FIREBIRD_HANDLE_INITIALIZER;
142142
XSQLDA num_sqlda;
143143
static char const info[] = { isc_info_sql_stmt_type };
144144
char result[8];
@@ -219,7 +219,7 @@ static int firebird_handle_preparer(pdo_dbh_t *dbh, const char *sql, size_t sql_
219219
static zend_long firebird_handle_doer(pdo_dbh_t *dbh, const char *sql, size_t sql_len) /* {{{ */
220220
{
221221
pdo_firebird_db_handle *H = (pdo_firebird_db_handle *)dbh->driver_data;
222-
isc_stmt_handle stmt = NULL;
222+
isc_stmt_handle stmt = PDO_FIREBIRD_HANDLE_INITIALIZER;
223223
static char const info_count[] = { isc_info_sql_records };
224224
char result[64];
225225
int ret = 0;

ext/pdo_firebird/firebird_statement.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ static int firebird_fetch_blob(pdo_stmt_t *stmt, int colno, char **ptr, /* {{{ *
223223
{
224224
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
225225
pdo_firebird_db_handle *H = S->H;
226-
isc_blob_handle blobh = NULL;
226+
isc_blob_handle blobh = PDO_FIREBIRD_HANDLE_INITIALIZER;
227227
char const bl_item = isc_info_blob_total_length;
228228
char bl_info[20];
229229
unsigned short i;
@@ -412,7 +412,7 @@ static int firebird_bind_blob(pdo_stmt_t *stmt, ISC_QUAD *blob_id, zval *param)
412412
{
413413
pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt->driver_data;
414414
pdo_firebird_db_handle *H = S->H;
415-
isc_blob_handle h = NULL;
415+
isc_blob_handle h = PDO_FIREBIRD_HANDLE_INITIALIZER;
416416
zend_ulong put_cnt = 0, rem_cnt;
417417
unsigned short chunk_size;
418418
int result = 1;

ext/pdo_firebird/php_pdo_firebird_int.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ typedef void (*info_func_t)(char*);
6161
#define min(a,b) ((a)<(b)?(a):(b))
6262
#endif
6363

64+
#if defined(_LP64) || defined(__LP64__) || defined(__arch64__) || defined(_WIN64)
65+
# define PDO_FIREBIRD_HANDLE_INITIALIZER 0U
66+
#else
67+
# define PDO_FIREBIRD_HANDLE_INITIALIZER NULL
68+
#endif
69+
6470
typedef struct {
6571

6672
/* the result of the last API call */

0 commit comments

Comments
 (0)