From: Jason Greene Date: Mon, 25 Jun 2001 17:56:23 +0000 (+0000) Subject: Fix casting wierdness that broke compiled code with Sun CC. X-Git-Tag: PRE_TSRM_MERGE_PATCH~343 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=333b1bf9c8d993afc2ecfea25539d2e039289443;p=php Fix casting wierdness that broke compiled code with Sun CC. (Also easier to read) --- diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index 6c14fd81c8..6c7b4cc212 100755 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -256,7 +256,6 @@ PHP_FUNCTION(pcntl_signal) /* }}} */ /* Note Old */ -/* Our custom signal handler that calls the appropriate php_function */ static void old_pcntl_signal_handler(int signo) { char *func_name; @@ -286,7 +285,7 @@ static void old_pcntl_signal_handler(int signo) return; } - +/* Our custom signal handler that calls the appropriate php_function */ static void pcntl_signal_handler(int signo) { long signal_num=signo; @@ -362,12 +361,13 @@ void pcntl_zend_extension_statement_handler(zend_op_array *op_array) { /* Traverse through our signal queue and call the appropriate php functions */ for (element=(&PCNTL_G(php_signal_queue))->head; element; element=element->next) { - if (zend_hash_index_find(&PCNTL_G(php_signal_table), (long) *element->data, (void *) &func_name)==FAILURE) { + long *signal_num=(long *)&element->data; + if (zend_hash_index_find(&PCNTL_G(php_signal_table), *signal_num, (void *) &func_name)==FAILURE) { continue; } convert_to_long_ex(¶m); convert_to_string_ex(&call_name); - ZVAL_LONG(param, (long) *element->data); + ZVAL_LONG(param, *signal_num); ZVAL_STRING(call_name, func_name, 0); /* Call php singal handler - Note that we do not report errors, and we ignore the return value */