1
0
mirror of https://github.com/php/php-src.git synced 2026-03-30 20:22:36 +02:00

ext/pcntl: Fix [-Wsign-compare] warnings

This commit is contained in:
Gina Peter Banyard
2024-06-04 18:33:48 +01:00
parent 672539870d
commit 2fa3e8094c

View File

@@ -714,8 +714,7 @@ PHP_FUNCTION(pcntl_signal)
if (!PCNTL_G(spares)) {
/* since calling malloc() from within a signal handler is not portable,
* pre-allocate a few records for recording signals */
int i;
for (i = 0; i < PCNTL_G(num_signals); i++) {
for (unsigned int i = 0; i < PCNTL_G(num_signals); i++) {
struct php_pcntl_pending_signal *psig;
psig = emalloc(sizeof(*psig));
@@ -903,7 +902,7 @@ PHP_FUNCTION(pcntl_sigprocmask)
RETURN_THROWS();
}
for (int signal_no = 1; signal_no < PCNTL_G(num_signals); ++signal_no) {
for (unsigned int signal_no = 1; signal_no < PCNTL_G(num_signals); ++signal_no) {
if (sigismember(&old_set, signal_no) != 1) {
continue;
}
@@ -1656,7 +1655,7 @@ PHP_FUNCTION(pcntl_setcpuaffinity)
// 0 == getpid in this context, we're just saving a syscall
pid = pid_is_null ? 0 : pid;
zend_ulong maxcpus = (zend_ulong)sysconf(_SC_NPROCESSORS_CONF);
zend_long maxcpus = sysconf(_SC_NPROCESSORS_CONF);
PCNTL_CPU_ZERO(mask);
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(hmask), ncpu) {