Skip to content

Commit dad2d56

Browse files
authored
adding const attribute to trailing/leading zeros helpers. (#13861)
and adding noreturn to php_sighup_handler for compiler/dev clarification sake.
1 parent ce2dd0b commit dad2d56

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Zend/zend_bitset.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ typedef zend_ulong *zend_bitset;
4545
(zend_bitset)do_alloca((n) * ZEND_BITSET_ELM_SIZE, use_heap)
4646

4747
/* Number of trailing zero bits (0x01 -> 0; 0x40 -> 6; 0x00 -> LEN) */
48-
static zend_always_inline int zend_ulong_ntz(zend_ulong num)
48+
ZEND_ATTRIBUTE_CONST static zend_always_inline int zend_ulong_ntz(zend_ulong num)
4949
{
5050
#if (defined(__GNUC__) || __has_builtin(__builtin_ctzl)) \
5151
&& SIZEOF_ZEND_LONG == SIZEOF_LONG && defined(PHP_HAVE_BUILTIN_CTZL)
@@ -83,7 +83,7 @@ static zend_always_inline int zend_ulong_ntz(zend_ulong num)
8383
}
8484

8585
/* Number of leading zero bits (Undefined for zero) */
86-
static zend_always_inline int zend_ulong_nlz(zend_ulong num)
86+
ZEND_ATTRIBUTE_CONST static zend_always_inline int zend_ulong_nlz(zend_ulong num)
8787
{
8888
#if (defined(__GNUC__) || __has_builtin(__builtin_clzl)) \
8989
&& SIZEOF_ZEND_LONG == SIZEOF_LONG && defined(PHP_HAVE_BUILTIN_CLZL)

sapi/phpdbg/phpdbg.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,7 @@ void phpdbg_signal_handler(int sig, siginfo_t *info, void *context) /* {{{ */
10661066
} /* }}} */
10671067

10681068

1069-
void phpdbg_sighup_handler(int sig) /* {{{ */
1069+
ZEND_NORETURN void phpdbg_sighup_handler(int sig) /* {{{ */
10701070
{
10711071
exit(0);
10721072
} /* }}} */

0 commit comments

Comments
 (0)