com php-src: fixed ext/sysvmsg: ext/sysvmsg/php_sysvmsg.h ext/sysvmsg/sysvmsg.c

From: Date: Fri, 13 Dec 2013 14:15:47 +0000
Subject: com php-src: fixed ext/sysvmsg: ext/sysvmsg/php_sysvmsg.h ext/sysvmsg/sysvmsg.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-74416@lists.php.net to get a copy of this message
Commit: 79c06bb896a0b015ac49b6b8fe56cfb554423cb9 Author: Anatol Belski <ab@php.net> Fri, 13 Dec 2013 06:15:47 -0800 Parents: e64e7e6ffc6d0102df6a2b4ec956741ad5d68aed Branches: str_size_and_int64 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=79c06bb896a0b015ac49b6b8fe56cfb554423cb9 Log: fixed ext/sysvmsg Changed paths: M ext/sysvmsg/php_sysvmsg.h M ext/sysvmsg/sysvmsg.c Diff: diff --git a/ext/sysvmsg/php_sysvmsg.h b/ext/sysvmsg/php_sysvmsg..h index 86c8c1e..7c81706 100644 --- a/ext/sysvmsg/php_sysvmsg.h +++ b/ext/sysvmsg/php_sysvmsg.h @@ -52,11 +52,11 @@ PHP_FUNCTION(msg_queue_exists); typedef struct { key_t key; - long id; + php_int_t id; } sysvmsg_queue_t; struct php_msgbuf { - long mtype; + php_int_t mtype; char mtext[1]; }; diff --git a/ext/sysvmsg/sysvmsg.c b/ext/sysvmsg/sysvmsg.c index a57e25e..e0c747d 100644 --- a/ext/sysvmsg/sysvmsg.c +++ b/ext/sysvmsg/sysvmsg.c @@ -231,9 +231,9 @@ PHP_FUNCTION(msg_stat_queue) Check whether a message queue exists */ PHP_FUNCTION(msg_queue_exists) { - long key; + php_int_t key; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &key) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &key) == FAILURE) { return; } @@ -250,11 +250,11 @@ PHP_FUNCTION(msg_queue_exists) Attach to a message queue */ PHP_FUNCTION(msg_get_queue) { - long key; - long perms = 0666; + php_int_t key; + php_int_t perms = 0666; sysvmsg_queue_t *mq; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l", &key, &perms) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i|i", &key, &perms) == FAILURE) { return; } @@ -301,8 +301,8 @@ PHP_FUNCTION(msg_remove_queue) PHP_FUNCTION(msg_receive) { zval *out_message, *queue, *out_msgtype, *zerrcode = NULL; - long desiredmsgtype, maxsize, flags = 0; - long realflags = 0; + php_int_t desiredmsgtype, maxsize, flags = 0; + php_int_t realflags = 0; zend_bool do_unserialize = 1; sysvmsg_queue_t *mq = NULL; struct php_msgbuf *messagebuffer = NULL; /* buffer to transmit */ @@ -310,7 +310,7 @@ PHP_FUNCTION(msg_receive) RETVAL_FALSE; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlzlz|blz", + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "riziz|biz", &queue, &desiredmsgtype, &out_msgtype, &maxsize, &out_message, &do_unserialize, &flags, &zerrcode) == FAILURE) { return; @@ -389,12 +389,12 @@ PHP_FUNCTION(msg_receive) PHP_FUNCTION(msg_send) { zval *message, *queue, *zerror=NULL; - long msgtype; + php_int_t msgtype; zend_bool do_serialize = 1, blocking = 1; sysvmsg_queue_t * mq = NULL; struct php_msgbuf * messagebuffer = NULL; /* buffer to transmit */ int result; - int message_len = 0; + php_int_t message_len = 0; RETVAL_FALSE; @@ -424,12 +424,12 @@ PHP_FUNCTION(msg_send) switch (Z_TYPE_P(message)) { case IS_STRING: p = Z_STRVAL_P(message); - message_len = Z_STRLEN_P(message); + message_len = Z_STRSIZE_P(message); break; case IS_LONG: case IS_BOOL: - message_len = spprintf(&p, 0, "%ld", Z_LVAL_P(message)); + message_len = spprintf(&p, 0, "%pd", Z_LVAL_P(message)); break; case IS_DOUBLE:

« previous php.cvs (#74416) next »