summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Göttsche2024-05-29 20:38:33 +0200
committerjvoisin2024-06-06 16:27:31 +0200
commitd82ab8d20191a9ebdb83f918c62fc6c32f068b01 (patch)
tree8847596b0016a17f5a207f00b8e0002eff0bd349
parent7e7678a0e5927af625e42627ed9f5757ecf9ca89 (diff)
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.
-rw-r--r--src/snuffleupagus.c2
-rw-r--r--src/sp_upload_validation.c5
-rw-r--r--src/sp_utils.c2
-rw-r--r--src/sp_var_parser.c2
-rw-r--r--src/tweetnacl.c2
5 files changed, 6 insertions, 7 deletions
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) {
619 return SUCCESS; 619 return SUCCESS;
620} 620}
621 621
622const zend_function_entry snuffleupagus_functions[] = {PHP_FE_END}; 622static const zend_function_entry snuffleupagus_functions[] = {PHP_FE_END};
623 623
624zend_module_entry snuffleupagus_module_entry = { 624zend_module_entry snuffleupagus_module_entry = {
625 STANDARD_MODULE_HEADER, 625 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 @@
1#include "php_snuffleupagus.h" 1#include "php_snuffleupagus.h"
2 2
3int (*sp_rfc1867_orig_callback)(unsigned int event, void *event_data, 3static int (*sp_rfc1867_orig_callback)(unsigned int event, void *event_data,
4 void **extra); 4 void **extra);
5int sp_rfc1867_callback(unsigned int event, void *event_data, void **extra);
6 5
7#define EFREE_3(env) \ 6#define EFREE_3(env) \
8 for (size_t i = 0; i < 4; i++) { \ 7 for (size_t i = 0; i < 4; i++) { \
@@ -23,7 +22,7 @@ int sp_rfc1867_callback_win(unsigned int event, void *event_data,
23 22
24#else 23#else
25 24
26int sp_rfc1867_callback(unsigned int event, void *event_data, void **extra) { 25static int sp_rfc1867_callback(unsigned int event, void *event_data, void **extra) {
27 int retval = SUCCESS; 26 int retval = SUCCESS;
28 27
29 if (sp_rfc1867_orig_callback) { 28 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
395 return false; 395 return false;
396} 396}
397 397
398bool /* success */ _hook_function(const char* original_name, HashTable* hook_table, zif_handler new_function) { 398static bool /* success */ _hook_function(const char* original_name, HashTable* hook_table, zif_handler new_function) {
399 zend_function* func; 399 zend_function* func;
400 if ((func = zend_hash_str_find_ptr(CG(function_table), VAR_AND_LEN(original_name)))) { 400 if ((func = zend_hash_str_find_ptr(CG(function_table), VAR_AND_LEN(original_name)))) {
401 if (func->type != ZEND_INTERNAL_FUNCTION) { 401 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:
100 return err; 100 return err;
101} 101}
102 102
103int cmp_tokens(sp_list_node const *const list1, 103static int cmp_tokens(sp_list_node const *const list1,
104 sp_list_node const *const list2) { 104 sp_list_node const *const list2) {
105 return (((sp_conf_token *)list1->data)->pos - 105 return (((sp_conf_token *)list1->data)->pos -
106 ((sp_conf_token *)list2->data)->pos); 106 ((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.*/
3#include "php_snuffleupagus.h" 3#include "php_snuffleupagus.h"
4#include "ext/standard/php_random.h" 4#include "ext/standard/php_random.h"
5 5
6void randombytes(unsigned char *x, unsigned long long xlen) { 6static void randombytes(unsigned char *x, unsigned long long xlen) {
7 assert(SIZE_MAX >= ULLONG_MAX); // max(size_t) > max(ull) ? 7 assert(SIZE_MAX >= ULLONG_MAX); // max(size_t) > max(ull) ?
8 php_random_bytes(x, xlen, 1); 8 php_random_bytes(x, xlen, 1);
9} 9}