]> granicus.if.org Git - php/commitdiff
Fix compile warnings in PDO Firebird
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 14 Dec 2020 09:36:36 +0000 (10:36 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 14 Dec 2020 09:36:36 +0000 (10:36 +0100)
ext/pdo_firebird/firebird_driver.c
ext/pdo_firebird/php_pdo_firebird_int.h

index c299907f0fea10fc9d70eda8dd863c40fdd0b5e8..390871cc200c8ec548f236f53ef3d2a1a924083d 100644 (file)
@@ -171,10 +171,11 @@ static const char classes_array[] = {
        /* 127     */ 0
 };
 
-inline char classes(char idx)
+static inline char classes(char idx)
 {
-       if (idx > 127) return 0;
-       return classes_array[idx];
+       unsigned char uidx = (unsigned char) idx;
+       if (uidx > 127) return 0;
+       return classes_array[uidx];
 }
 
 typedef enum {
@@ -1085,7 +1086,7 @@ static int pdo_firebird_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /*
                char errmsg[512];
                const ISC_STATUS *s = H->isc_status;
                fb_interpret(errmsg, sizeof(errmsg),&s);
-               zend_throw_exception_ex(php_pdo_get_exception(), H->isc_status[1], "SQLSTATE[%s] [%d] %s",
+               zend_throw_exception_ex(php_pdo_get_exception(), H->isc_status[1], "SQLSTATE[%s] [%ld] %s",
                                "HY000", H->isc_status[1], errmsg);
        }
 
index 094767fa355d36227a5804411b8b140cc838e4b0..70a895b4b9f83f1efbe118a755915199b4a54181 100644 (file)
 #define SHORT_MAX (1 << (8*sizeof(short)-1))
 
 #if SIZEOF_ZEND_LONG == 8 && !defined(PHP_WIN32)
-# define LL_MASK "l"
 # define LL_LIT(lit) lit ## L
 #else
-# define LL_MASK "ll"
 # define LL_LIT(lit) lit ## LL
 #endif
+#define LL_MASK "ll"
 
 /* Firebird API has a couple of missing const decls in its API */
 #define const_cast(s) ((char*)(s))