From d82ab8d20191a9ebdb83f918c62fc6c32f068b01 Mon Sep 17 00:00:00 2001 From: Christian Göttsche Date: Wed, 29 May 2024 20:38:33 +0200 Subject: Declare file local variables and functions static Avoid missing prototype warnings by declaring variables and functions that are only used in a single file static. --- src/snuffleupagus.c | 2 +- src/sp_upload_validation.c | 5 ++--- src/sp_utils.c | 2 +- src/sp_var_parser.c | 2 +- src/tweetnacl.c | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/snuffleupagus.c b/src/snuffleupagus.c index 53e610a..e549692 100644 --- a/src/snuffleupagus.c +++ b/src/snuffleupagus.c @@ -619,7 +619,7 @@ static PHP_INI_MH(OnUpdateConfiguration) { return SUCCESS; } -const zend_function_entry snuffleupagus_functions[] = {PHP_FE_END}; +static const zend_function_entry snuffleupagus_functions[] = {PHP_FE_END}; zend_module_entry snuffleupagus_module_entry = { STANDARD_MODULE_HEADER, diff --git a/src/sp_upload_validation.c b/src/sp_upload_validation.c index 38b4cb3..6f13249 100644 --- a/src/sp_upload_validation.c +++ b/src/sp_upload_validation.c @@ -1,8 +1,7 @@ #include "php_snuffleupagus.h" -int (*sp_rfc1867_orig_callback)(unsigned int event, void *event_data, +static int (*sp_rfc1867_orig_callback)(unsigned int event, void *event_data, void **extra); -int sp_rfc1867_callback(unsigned int event, void *event_data, void **extra); #define EFREE_3(env) \ for (size_t i = 0; i < 4; i++) { \ @@ -23,7 +22,7 @@ int sp_rfc1867_callback_win(unsigned int event, void *event_data, #else -int sp_rfc1867_callback(unsigned int event, void *event_data, void **extra) { +static int sp_rfc1867_callback(unsigned int event, void *event_data, void **extra) { int retval = SUCCESS; if (sp_rfc1867_orig_callback) { diff --git a/src/sp_utils.c b/src/sp_utils.c index eeebcc4..82714c5 100644 --- a/src/sp_utils.c +++ b/src/sp_utils.c @@ -395,7 +395,7 @@ bool sp_match_array_value(const zval* arr, const zend_string* to_match, const sp return false; } -bool /* success */ _hook_function(const char* original_name, HashTable* hook_table, zif_handler new_function) { +static bool /* success */ _hook_function(const char* original_name, HashTable* hook_table, zif_handler new_function) { zend_function* func; if ((func = zend_hash_str_find_ptr(CG(function_table), VAR_AND_LEN(original_name)))) { if (func->type != ZEND_INTERNAL_FUNCTION) { diff --git a/src/sp_var_parser.c b/src/sp_var_parser.c index 81d696f..c7562f3 100644 --- a/src/sp_var_parser.c +++ b/src/sp_var_parser.c @@ -100,7 +100,7 @@ err: return err; } -int cmp_tokens(sp_list_node const *const list1, +static int cmp_tokens(sp_list_node const *const list1, sp_list_node const *const list2) { return (((sp_conf_token *)list1->data)->pos - ((sp_conf_token *)list2->data)->pos); diff --git a/src/tweetnacl.c b/src/tweetnacl.c index 9f66546..746cabc 100644 --- a/src/tweetnacl.c +++ b/src/tweetnacl.c @@ -3,7 +3,7 @@ we're using the one from PHP.*/ #include "php_snuffleupagus.h" #include "ext/standard/php_random.h" -void randombytes(unsigned char *x, unsigned long long xlen) { +static void randombytes(unsigned char *x, unsigned long long xlen) { assert(SIZE_MAX >= ULLONG_MAX); // max(size_t) > max(ull) ? php_random_bytes(x, xlen, 1); } -- cgit v1.3