]> granicus.if.org Git - php/commitdiff
Fix some clang warnings
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 23 Jul 2020 08:35:40 +0000 (10:35 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 23 Jul 2020 08:35:40 +0000 (10:35 +0200)
ext/intl/dateformat/dateformat_parse.c
ext/mysqli/mysqli_nonapi.c
ext/mysqli/php_mysqli_structs.h
ext/opcache/jit/zend_jit_x86.dasc

index 0089fbe5b63fbe11fe283f1174e07ab47ed23680..f5c73a1245be257ceea21e4f21b212e831584b74 100644 (file)
@@ -51,7 +51,7 @@ static void internal_parse_to_timestamp(IntlDateFormatter_object *dfo, char* tex
 
        /* Since return is in  sec. */
        result = (double)timestamp / U_MILLIS_PER_SECOND;
-       if(result > LONG_MAX || result < -LONG_MAX) {
+       if (result > (double)LONG_MAX || result < (double)LONG_MIN) {
                ZVAL_DOUBLE(return_value, result<0?ceil(result):floor(result));
        } else {
                ZVAL_LONG(return_value, (zend_long)result);
index ba97e0aa24d73028621c3147cd02ae3bdfe07e8a..5dc16b9552ec9090452a6378edd633a716ec8e7a 100644 (file)
@@ -734,7 +734,7 @@ static int mysqlnd_zval_array_to_mysqlnd_array(zval *in_array, MYSQLND ***out_ar
                                return FAILURE;
                        }
                        mysql = (MY_MYSQL*) my_res->ptr;
-                       if (MYSQLI_STATUS_VALID && my_res->status < MYSQLI_STATUS_VALID) {
+                       if (my_res->status < MYSQLI_STATUS_VALID) {
                                zend_throw_error(NULL, "%s object is not fully initialized", ZSTR_VAL(intern->zo.ce->name));
                                return FAILURE;
                        }
index 43c9b64fa8a3f15dfb8757cc0f1c592accb31373..f02da598488f3c9207542f6fd2c0d79c06dd87da 100644 (file)
@@ -229,7 +229,7 @@ extern void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * resul
                RETURN_THROWS();\
        }\
        __ptr = (__type)my_res->ptr; \
-       if (__check && my_res->status < __check) { \
+       if (my_res->status < __check) { \
                zend_throw_error(NULL, "%s object is not fully initialized", ZSTR_VAL(intern->zo.ce->name)); \
                RETURN_THROWS();\
        }\
@@ -243,7 +243,7 @@ extern void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * resul
                return;\
        }\
        __ptr = (__type)my_res->ptr; \
-       if (__check && my_res->status < __check) { \
+       if (my_res->status < __check) { \
                zend_throw_error(NULL, "%s object is not fully initialized", ZSTR_VAL(intern->zo.ce->name)); \
                return;\
        }\
index 605295758a79725fcbbebfb44f6c3a2b948cf40a..97e126932342b7a2b3d54125994de1e5e7e2e0c3 100644 (file)
 #if defined(__clang__)
 # pragma clang diagnostic push
 # pragma clang diagnostic ignored "-Wtautological-compare"
+# pragma clang diagnostic ignored "-Wstring-compare"
 #endif
 
 const char* zend_reg_name[] = {