Fix compile warnings in PDO Firebird

This commit is contained in:
Nikita Popov 2020-12-14 10:36:36 +01:00
parent f2ddfcc7bb
commit c288b5294b
2 changed files with 6 additions and 6 deletions

View file

@ -171,10 +171,11 @@ static const char classes_array[] = {
/* 127 */ 0 /* 127 */ 0
}; };
inline char classes(char idx) static inline char classes(char idx)
{ {
if (idx > 127) return 0; unsigned char uidx = (unsigned char) idx;
return classes_array[idx]; if (uidx > 127) return 0;
return classes_array[uidx];
} }
typedef enum { typedef enum {
@ -1085,7 +1086,7 @@ static int pdo_firebird_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /*
char errmsg[512]; char errmsg[512];
const ISC_STATUS *s = H->isc_status; const ISC_STATUS *s = H->isc_status;
fb_interpret(errmsg, sizeof(errmsg),&s); 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); "HY000", H->isc_status[1], errmsg);
} }

View file

@ -34,12 +34,11 @@
#define SHORT_MAX (1 << (8*sizeof(short)-1)) #define SHORT_MAX (1 << (8*sizeof(short)-1))
#if SIZEOF_ZEND_LONG == 8 && !defined(PHP_WIN32) #if SIZEOF_ZEND_LONG == 8 && !defined(PHP_WIN32)
# define LL_MASK "l"
# define LL_LIT(lit) lit ## L # define LL_LIT(lit) lit ## L
#else #else
# define LL_MASK "ll"
# define LL_LIT(lit) lit ## LL # define LL_LIT(lit) lit ## LL
#endif #endif
#define LL_MASK "ll"
/* Firebird API has a couple of missing const decls in its API */ /* Firebird API has a couple of missing const decls in its API */
#define const_cast(s) ((char*)(s)) #define const_cast(s) ((char*)(s))