]> granicus.if.org Git - php/commitdiff
fix ibase handle initialization, mostly compiler warnings
authorAnatol Belski <ab@php.net>
Mon, 6 Jun 2016 11:30:17 +0000 (13:30 +0200)
committerAnatol Belski <ab@php.net>
Mon, 6 Jun 2016 11:30:17 +0000 (13:30 +0200)
ext/pdo_firebird/firebird_driver.c
ext/pdo_firebird/firebird_statement.c
ext/pdo_firebird/php_pdo_firebird_int.h

index 5f85796f8a844d455d6ab3ed9b957b8a96c28102..b26939ccd21ca7c39d449f2786b135f9bd10ac73 100644 (file)
@@ -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;
index 11f39e08a0759ed458f0e1aea3f2fae0cd629781..d6bfa021a5d252ab21bfeb7650bb99bc96e9fbc7 100644 (file)
@@ -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;
index b7b00bf924380362fc39d080b64823f666ebd7ea..917f224e80aeb469c9462b0c74e167d1d70453e9 100644 (file)
@@ -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 */