From e62f226c3ed885808c832040872fc2d73ca46dac Mon Sep 17 00:00:00 2001 From: jvoisin Date: Wed, 28 Jul 2021 11:55:57 +0200 Subject: Sprinkle even more `const` --- src/snuffleupagus.c | 8 ++++---- src/sp_config.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/snuffleupagus.c b/src/snuffleupagus.c index f0737b4..7bf3649 100644 --- a/src/snuffleupagus.c +++ b/src/snuffleupagus.c @@ -21,7 +21,7 @@ ZEND_DLEXPORT int sp_zend_startup(zend_extension *extension) { } // LCOV_EXCL_END -static inline void sp_op_array_handler(zend_op_array *op) { +static inline void sp_op_array_handler(zend_op_array *const op) { // We need a filename, and strict mode not already enabled on this op if (NULL == op->filename || op->fn_flags & ZEND_ACC_STRICT_TYPES) { return; @@ -121,7 +121,7 @@ PHP_MINIT_FUNCTION(snuffleupagus) { return SUCCESS; } -static void free_disabled_functions_hashtable(HashTable *ht) { +static void free_disabled_functions_hashtable(HashTable *const ht) { void *ptr = NULL; ZEND_HASH_FOREACH_PTR(ht, ptr) { sp_list_free(ptr); } ZEND_HASH_FOREACH_END(); @@ -186,7 +186,7 @@ PHP_MSHUTDOWN_FUNCTION(snuffleupagus) { } PHP_RINIT_FUNCTION(snuffleupagus) { - const sp_config_wrapper *config_wrapper = + const sp_config_wrapper *const config_wrapper = SNUFFLEUPAGUS_G(config).config_wrapper; #if defined(COMPILE_DL_SNUFFLEUPAGUS) && defined(ZTS) ZEND_TSRMLS_CACHE_UPDATE(); @@ -254,7 +254,7 @@ static PHP_INI_MH(OnUpdateConfiguration) { while (1) { // We don't care about overwriting new_value->val - char *config_file = strsep(&str, ","); + const char *config_file = strsep(&str, ","); if (config_file == NULL) break; glob_t globbuf; diff --git a/src/sp_config.c b/src/sp_config.c index 26476a2..c12b435 100644 --- a/src/sp_config.c +++ b/src/sp_config.c @@ -6,7 +6,7 @@ size_t sp_line_no; -sp_config_tokens const sp_func[] = { +static sp_config_tokens const sp_func[] = { {.func = parse_unserialize, .token = SP_TOKEN_UNSERIALIZE_HMAC}, {.func = parse_random, .token = SP_TOKEN_HARDEN_RANDOM}, {.func = parse_log_media, .token = SP_TOKEN_LOG_MEDIA}, -- cgit v1.3