Skip to content

Commit 8e62e2b

Browse files
authored
Mark multple functions as static (#13864)
* Mark many functions as static Multiple functions are missing the static qualifier. * remove unused struct sigactions struct sigaction act, old_term, old_quit, old_int; all unused. * optimizer: minXOR and maxXOR are unused
1 parent 46540a0 commit 8e62e2b

37 files changed

+75
-88
lines changed

Zend/Optimizer/zend_inference.c

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ ZEND_API void zend_ssa_find_false_dependencies(const zend_op_array *op_array, ze
543543
/* }}} */
544544

545545
/* From "Hacker's Delight" */
546-
zend_ulong minOR(zend_ulong a, zend_ulong b, zend_ulong c, zend_ulong d)
546+
static zend_ulong minOR(zend_ulong a, zend_ulong b, zend_ulong c, zend_ulong d)
547547
{
548548
zend_ulong m, temp;
549549

@@ -567,7 +567,7 @@ zend_ulong minOR(zend_ulong a, zend_ulong b, zend_ulong c, zend_ulong d)
567567
return a | c;
568568
}
569569

570-
zend_ulong maxOR(zend_ulong a, zend_ulong b, zend_ulong c, zend_ulong d)
570+
static zend_ulong maxOR(zend_ulong a, zend_ulong b, zend_ulong c, zend_ulong d)
571571
{
572572
zend_ulong m, temp;
573573

@@ -590,7 +590,7 @@ zend_ulong maxOR(zend_ulong a, zend_ulong b, zend_ulong c, zend_ulong d)
590590
return b | d;
591591
}
592592

593-
zend_ulong minAND(zend_ulong a, zend_ulong b, zend_ulong c, zend_ulong d)
593+
static zend_ulong minAND(zend_ulong a, zend_ulong b, zend_ulong c, zend_ulong d)
594594
{
595595
zend_ulong m, temp;
596596

@@ -613,7 +613,7 @@ zend_ulong minAND(zend_ulong a, zend_ulong b, zend_ulong c, zend_ulong d)
613613
return a & c;
614614
}
615615

616-
zend_ulong maxAND(zend_ulong a, zend_ulong b, zend_ulong c, zend_ulong d)
616+
static zend_ulong maxAND(zend_ulong a, zend_ulong b, zend_ulong c, zend_ulong d)
617617
{
618618
zend_ulong m, temp;
619619

@@ -637,16 +637,6 @@ zend_ulong maxAND(zend_ulong a, zend_ulong b, zend_ulong c, zend_ulong d)
637637
return b & d;
638638
}
639639

640-
zend_ulong minXOR(zend_ulong a, zend_ulong b, zend_ulong c, zend_ulong d)
641-
{
642-
return minAND(a, b, ~d, ~c) | minAND(~b, ~a, c, d);
643-
}
644-
645-
zend_ulong maxXOR(zend_ulong a, zend_ulong b, zend_ulong c, zend_ulong d)
646-
{
647-
return maxOR(0, maxAND(a, b, ~d, ~c), 0, maxAND(~b, ~a, c, d));
648-
}
649-
650640
/* Based on "Hacker's Delight" */
651641

652642
/*

Zend/zend_ast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ static zend_result zend_ast_add_unpacked_element(zval *result, zval *expr) {
491491
return FAILURE;
492492
}
493493

494-
zend_class_entry *zend_ast_fetch_class(zend_ast *ast, zend_class_entry *scope)
494+
static zend_class_entry *zend_ast_fetch_class(zend_ast *ast, zend_class_entry *scope)
495495
{
496496
return zend_fetch_class_with_scope(zend_ast_get_str(ast), (ast->attr >> ZEND_CONST_EXPR_NEW_FETCH_TYPE_SHIFT) | ZEND_FETCH_CLASS_EXCEPTION, scope);
497497
}

Zend/zend_builtin_functions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ ZEND_MINIT_FUNCTION(core) { /* {{{ */
4343
}
4444
/* }}} */
4545

46-
zend_module_entry zend_builtin_module = { /* {{{ */
46+
static zend_module_entry zend_builtin_module = { /* {{{ */
4747
STANDARD_MODULE_HEADER,
4848
"Core",
4949
ext_functions,

Zend/zend_compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,7 @@ static zend_string *zend_resolve_class_name(zend_string *name, uint32_t type) /*
11491149
}
11501150
/* }}} */
11511151

1152-
zend_string *zend_resolve_class_name_ast(zend_ast *ast) /* {{{ */
1152+
static zend_string *zend_resolve_class_name_ast(zend_ast *ast) /* {{{ */
11531153
{
11541154
zval *class_name = zend_ast_get_zval(ast);
11551155
if (Z_TYPE_P(class_name) != IS_STRING) {

Zend/zend_generators.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,7 @@ static const zend_object_iterator_funcs zend_generator_iterator_functions = {
11351135
};
11361136

11371137
/* by_ref is int due to Iterator API */
1138-
zend_object_iterator *zend_generator_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
1138+
static zend_object_iterator *zend_generator_get_iterator(zend_class_entry *ce, zval *object, int by_ref) /* {{{ */
11391139
{
11401140
zend_object_iterator *iterator;
11411141
zend_generator *generator = (zend_generator*)Z_OBJ_P(object);

Zend/zend_inheritance.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,7 @@ static void do_inherit_method(zend_string *key, zend_function *parent, zend_clas
12391239
}
12401240
/* }}} */
12411241

1242-
inheritance_status property_types_compatible(
1242+
static inheritance_status property_types_compatible(
12431243
const zend_property_info *parent_info, const zend_property_info *child_info) {
12441244
if (ZEND_TYPE_PURE_MASK(parent_info->type) == ZEND_TYPE_PURE_MASK(child_info->type)
12451245
&& ZEND_TYPE_NAME(parent_info->type) == ZEND_TYPE_NAME(child_info->type)) {

Zend/zend_ini_parser.y

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include "win32/syslog.h"
3333
#endif
3434

35-
int ini_parse(void);
35+
static int ini_parse(void);
3636

3737
#define ZEND_INI_PARSER_CB (CG(ini_parser_param))->ini_parser_cb
3838
#define ZEND_INI_PARSER_ARG (CG(ini_parser_param))->arg

Zend/zend_observer.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232
#define ZEND_OBSERVABLE_FN(function) \
3333
(ZEND_MAP_PTR(function->common.run_time_cache) && !(function->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE))
3434

35-
zend_llist zend_observers_fcall_list;
36-
zend_llist zend_observer_function_declared_callbacks;
37-
zend_llist zend_observer_class_linked_callbacks;
38-
zend_llist zend_observer_error_callbacks;
39-
zend_llist zend_observer_fiber_init;
40-
zend_llist zend_observer_fiber_switch;
41-
zend_llist zend_observer_fiber_destroy;
35+
static zend_llist zend_observers_fcall_list;
36+
static zend_llist zend_observer_function_declared_callbacks;
37+
static zend_llist zend_observer_class_linked_callbacks;
38+
static zend_llist zend_observer_error_callbacks;
39+
static zend_llist zend_observer_fiber_init;
40+
static zend_llist zend_observer_fiber_switch;
41+
static zend_llist zend_observer_fiber_destroy;
4242

4343
int zend_observer_fcall_op_array_extension;
4444
int zend_observer_fcall_internal_function_extension;

Zend/zend_signal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static sigset_t global_sigmask;
8181

8282
/* {{{ zend_signal_handler_defer
8383
* Blocks signals if in critical section */
84-
void zend_signal_handler_defer(int signo, siginfo_t *siginfo, void *context)
84+
static void zend_signal_handler_defer(int signo, siginfo_t *siginfo, void *context)
8585
{
8686
int errno_save = errno;
8787
zend_signal_queue_t *queue, *qtmp;

Zend/zend_weakrefs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ typedef struct _zend_weakmap_iterator {
5454
#define ZEND_WEAKREF_ENCODE(p, t) ((void *) (((uintptr_t) (p)) | (t)))
5555

5656
zend_class_entry *zend_ce_weakref;
57-
zend_class_entry *zend_ce_weakmap;
57+
static zend_class_entry *zend_ce_weakmap;
5858
static zend_object_handlers zend_weakref_handlers;
5959
static zend_object_handlers zend_weakmap_handlers;
6060

0 commit comments

Comments
 (0)