]> granicus.if.org Git - php/commitdiff
Fix [-Wundef] warning in MySQLnd extension
authorGeorge Peter Banyard <girgias@php.net>
Sun, 17 May 2020 21:10:10 +0000 (23:10 +0200)
committerGeorge Peter Banyard <girgias@php.net>
Sun, 17 May 2020 22:37:20 +0000 (00:37 +0200)
ext/mysqlnd/mysqlnd.h
ext/mysqlnd/mysqlnd_debug.c
ext/mysqlnd/mysqlnd_driver.c
ext/mysqlnd/mysqlnd_plugin.c
ext/mysqlnd/mysqlnd_protocol_frame_codec.c
ext/mysqlnd/mysqlnd_ps.c
ext/mysqlnd/mysqlnd_wireprotocol.c

index b914afed6a4f78079d0fde003133fba9b8104680..dc153f208e659a448cf9724eaa174a50214813c1 100644 (file)
@@ -36,7 +36,7 @@
   on production systems, if of course measured performance degradation is not
   minimal.
 */
-#if A0 && PHP_DEBUG
+#if defined(A0) && PHP_DEBUG
 #define MYSQLND_DO_WIRE_CHECK_BEFORE_COMMAND 1
 #endif
 
index 5d4e06b0b19c3ef5205c5272c658aee270f68f38..54c243d63bb742390e4b529525f862c6f2ca4ac3 100644 (file)
@@ -76,7 +76,7 @@ MYSQLND_METHOD(mysqlnd_debug, log)(MYSQLND_DEBUG * self,
        }
        if (flags & MYSQLND_DEBUG_DUMP_TIME) {
                /* The following from FF's DBUG library, which is in the public domain */
-#if defined(PHP_WIN32)
+#ifdef PHP_WIN32
                /* FIXME This doesn't give microseconds as in Unix case, and the resolution is
                in system ticks, 10 ms intervals. See my_getsystime.c for high res */
                SYSTEMTIME loc_t;
@@ -173,7 +173,7 @@ MYSQLND_METHOD(mysqlnd_debug, log_va)(MYSQLND_DEBUG *self,
        }
        if (flags & MYSQLND_DEBUG_DUMP_TIME) {
                /* The following from FF's DBUG library, which is in the public domain */
-#if defined(PHP_WIN32)
+#ifdef PHP_WIN32
                /* FIXME This doesn't give microseconds as in Unix case, and the resolution is
                in system ticks, 10 ms intervals. See my_getsystime.c for high res */
                SYSTEMTIME loc_t;
index 6ca1441bb6af64f37e7dedfb751dd8f801e6bf8f..4762d4e720dde8524faf08ec0ccda2b51ddd50bd 100644 (file)
@@ -80,7 +80,7 @@ PHPAPI void mysqlnd_library_init(void)
                        mysqlnd_plugin_core.plugin_header.plugin_stats.values = mysqlnd_global_stats;
                        mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_plugin_core);
                }
-#if defined(MYSQLND_DBG_ENABLED) && MYSQLND_DBG_ENABLED == 1
+#if MYSQLND_DBG_ENABLED == 1
                mysqlnd_example_plugin_register();
 #endif
                mysqlnd_debug_trace_plugin_register();
index 25ba2669e101b2c0433566f9d3e8eceab8a63458..3d8273ad180b2a486bc9d8ebecd7d3504ea01e9f 100644 (file)
@@ -22,7 +22,7 @@
 #include "mysqlnd_debug.h"
 
 /*--------------------------------------------------------------------*/
-#if defined(MYSQLND_DBG_ENABLED) && MYSQLND_DBG_ENABLED == 1
+#if MYSQLND_DBG_ENABLED == 1
 static enum_func_status mysqlnd_example_plugin_end(void * p);
 
 static MYSQLND_STATS * mysqlnd_plugin_example_stats = NULL;
@@ -84,7 +84,7 @@ mysqlnd_example_plugin_register(void)
        mysqlnd_plugin_register_ex((struct st_mysqlnd_plugin_header *) &mysqlnd_example_plugin);
 }
 /* }}} */
-#endif /* defined(MYSQLND_DBG_ENABLED) && MYSQLND_DBG_ENABLED == 1 */
+#endif /* MYSQLND_DBG_ENABLED == 1 */
 /*--------------------------------------------------------------------*/
 
 static HashTable mysqlnd_registered_plugins;
index 6997ed9b26374523d9efb0f3dd51cfd1d34de905..5ec7dd03e316c2b5b38d70b727d3ec35754f4c2c 100644 (file)
@@ -115,7 +115,7 @@ MYSQLND_METHOD(mysqlnd_pfc, send)(MYSQLND_PFC * const pfc, MYSQLND_VIO * const v
                        DBG_INF_FMT("writing "MYSQLND_SZ_T_SPEC" bytes to the network", payload_size + MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE);
                        bytes_sent = vio->data->m.network_write(vio, compress_buf, payload_size + MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE, conn_stats, error_info);
                        pfc->data->compressed_envelope_packet_no++;
-  #if WHEN_WE_NEED_TO_CHECK_WHETHER_COMPRESSION_WORKS_CORRECTLY
+  #ifdef WHEN_WE_NEED_TO_CHECK_WHETHER_COMPRESSION_WORKS_CORRECTLY
                        if (res == Z_OK) {
                                size_t decompressed_size = left + MYSQLND_HEADER_SIZE;
                                zend_uchar * decompressed_data = mnd_malloc(decompressed_size);
index 01ee53e0a85b39b1d701f2ea0eae2e75e734a5a3..2415b91a3b837376ec7cdcf2a4e46bd1da81a69c 100644 (file)
@@ -1299,7 +1299,7 @@ MYSQLND_METHOD(mysqlnd_stmt, send_long_data)(MYSQLND_STMT * const s, unsigned in
                  max_allowed_packet_size on the server and resending the data.
                */
 #ifdef MYSQLND_DO_WIRE_CHECK_BEFORE_COMMAND
-#if HAVE_USLEEP && !defined(PHP_WIN32)
+#if defined(HAVE_USLEEP) && !defined(PHP_WIN32)
                usleep(120000);
 #endif
                if ((packet_len = conn->protocol_frame_codec->m.consume_uneaten_data(conn->protocol_frame_codec, COM_STMT_SEND_LONG_DATA))) {
index 4b31b9dffbb516d365e1ca31e96efd1cd6399698..10fabd59dacbfb2442d2c989d5d7d8f535f02f49 100644 (file)
@@ -1561,7 +1561,7 @@ php_mysqlnd_rowp_read_text_protocol_aux(MYSQLND_ROW_BUFFER * row_buffer, zval *
                                                                                          " bytes after end of packet", (p + len) - packet_end - 1);
                        DBG_RETURN(FAIL);
                } else {
-#if defined(MYSQLND_STRING_TO_INT_CONVERSION)
+#ifdef MYSQLND_STRING_TO_INT_CONVERSION
                        struct st_mysqlnd_perm_bind perm_bind =
                                        mysqlnd_ps_fetch_functions[fields_metadata[i].type];
 #endif