mirror of
https://github.com/php/php-src.git
synced 2024-11-25 02:44:58 +08:00
Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src: fixed several long vs zend_long casts
This commit is contained in:
commit
d17790b35e
@ -1331,7 +1331,7 @@ static char *zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{{
|
|||||||
++idx;
|
++idx;
|
||||||
while (op < end) {
|
while (op < end) {
|
||||||
if ((op->opcode == ZEND_RECV || op->opcode == ZEND_RECV_INIT)
|
if ((op->opcode == ZEND_RECV || op->opcode == ZEND_RECV_INIT)
|
||||||
&& op->op1.num == (long)idx)
|
&& op->op1.num == (zend_ulong)idx)
|
||||||
{
|
{
|
||||||
precv = op;
|
precv = op;
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
# define ZEND_ENABLE_ZVAL_LONG64 1
|
# define ZEND_ENABLE_ZVAL_LONG64 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Integer types or the old bad long. */
|
/* Integer types. */
|
||||||
#ifdef ZEND_ENABLE_ZVAL_LONG64
|
#ifdef ZEND_ENABLE_ZVAL_LONG64
|
||||||
typedef int64_t zend_long;
|
typedef int64_t zend_long;
|
||||||
typedef uint64_t zend_ulong;
|
typedef uint64_t zend_ulong;
|
||||||
@ -58,7 +58,7 @@ typedef int32_t zend_off_t;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* conversion macros */
|
/* Conversion macros. */
|
||||||
#define ZEND_LTOA_BUF_LEN 65
|
#define ZEND_LTOA_BUF_LEN 65
|
||||||
|
|
||||||
#ifdef ZEND_ENABLE_ZVAL_LONG64
|
#ifdef ZEND_ENABLE_ZVAL_LONG64
|
||||||
|
@ -1410,10 +1410,10 @@ static size_t curl_progress(void *clientp, double dltotal, double dlnow, double
|
|||||||
|
|
||||||
ZVAL_RES(&argv[0], ch->res);
|
ZVAL_RES(&argv[0], ch->res);
|
||||||
Z_ADDREF(argv[0]);
|
Z_ADDREF(argv[0]);
|
||||||
ZVAL_LONG(&argv[1], (long)dltotal);
|
ZVAL_LONG(&argv[1], (zend_long)dltotal);
|
||||||
ZVAL_LONG(&argv[2], (long)dlnow);
|
ZVAL_LONG(&argv[2], (zend_long)dlnow);
|
||||||
ZVAL_LONG(&argv[3], (long)ultotal);
|
ZVAL_LONG(&argv[3], (zend_long)ultotal);
|
||||||
ZVAL_LONG(&argv[4], (long)ulnow);
|
ZVAL_LONG(&argv[4], (zend_long)ulnow);
|
||||||
|
|
||||||
fci.size = sizeof(fci);
|
fci.size = sizeof(fci);
|
||||||
fci.function_table = EG(function_table);
|
fci.function_table = EG(function_table);
|
||||||
@ -2558,9 +2558,9 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue TSRMLS_
|
|||||||
} else {
|
} else {
|
||||||
error = curl_formadd(&first, &last,
|
error = curl_formadd(&first, &last,
|
||||||
CURLFORM_COPYNAME, string_key->val,
|
CURLFORM_COPYNAME, string_key->val,
|
||||||
CURLFORM_NAMELENGTH, (long)string_key->len,
|
CURLFORM_NAMELENGTH, (zend_long)string_key->len,
|
||||||
CURLFORM_COPYCONTENTS, postval,
|
CURLFORM_COPYCONTENTS, postval,
|
||||||
CURLFORM_CONTENTSLENGTH, (long)Z_STRLEN_P(current),
|
CURLFORM_CONTENTSLENGTH, (zend_long)Z_STRLEN_P(current),
|
||||||
CURLFORM_END);
|
CURLFORM_END);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4821,7 +4821,7 @@ static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC) /* {
|
|||||||
zend_hash_str_update(props, "interval", sizeof("interval")-1, &zv);
|
zend_hash_str_update(props, "interval", sizeof("interval")-1, &zv);
|
||||||
|
|
||||||
/* converted to larger type (int->long); must check when unserializing */
|
/* converted to larger type (int->long); must check when unserializing */
|
||||||
ZVAL_LONG(&zv, (long) period_obj->recurrences);
|
ZVAL_LONG(&zv, (zend_long) period_obj->recurrences);
|
||||||
zend_hash_str_update(props, "recurrences", sizeof("recurrences")-1, &zv);
|
zend_hash_str_update(props, "recurrences", sizeof("recurrences")-1, &zv);
|
||||||
|
|
||||||
ZVAL_BOOL(&zv, period_obj->include_start_date);
|
ZVAL_BOOL(&zv, period_obj->include_start_date);
|
||||||
|
@ -45,7 +45,7 @@ static zend_object_handlers php_converter_object_handlers;
|
|||||||
|
|
||||||
#define CONV_GET(pzv) (Z_INTL_CONVERTER_P((pzv)))
|
#define CONV_GET(pzv) (Z_INTL_CONVERTER_P((pzv)))
|
||||||
#define THROW_UFAILURE(obj, fname, error) php_converter_throw_failure(obj, error TSRMLS_CC, \
|
#define THROW_UFAILURE(obj, fname, error) php_converter_throw_failure(obj, error TSRMLS_CC, \
|
||||||
fname "() returned error %ld: %s", (long)error, u_errorName(error))
|
fname "() returned error " ZEND_LONG_FMT ": %s", (zend_long)error, u_errorName(error))
|
||||||
|
|
||||||
/* {{{ php_converter_throw_failure */
|
/* {{{ php_converter_throw_failure */
|
||||||
static inline void php_converter_throw_failure(php_converter_object *objval, UErrorCode error TSRMLS_DC, const char *format, ...) {
|
static inline void php_converter_throw_failure(php_converter_object *objval, UErrorCode error TSRMLS_DC, const char *format, ...) {
|
||||||
|
@ -1299,7 +1299,7 @@ PHP_FUNCTION(mysql_thread_id)
|
|||||||
ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, -1, "MySQL-Link", le_link, le_plink);
|
ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, mysql_link, -1, "MySQL-Link", le_link, le_plink);
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN_LONG((long) mysql_thread_id(mysql->conn));
|
RETURN_LONG((zend_long) mysql_thread_id(mysql->conn));
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
@ -1837,7 +1837,7 @@ PHP_FUNCTION(mysql_affected_rows)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* conversion from int64 to long happing here */
|
/* conversion from int64 to long happing here */
|
||||||
RETURN_LONG((long)mysql_affected_rows(mysql->conn));
|
RETURN_LONG((zend_long)mysql_affected_rows(mysql->conn));
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
@ -1918,7 +1918,7 @@ PHP_FUNCTION(mysql_insert_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* conversion from int64 to long happing here */
|
/* conversion from int64 to long happing here */
|
||||||
RETURN_LONG((long)mysql_insert_id(mysql->conn));
|
RETURN_LONG((zend_long)mysql_insert_id(mysql->conn));
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
@ -2040,7 +2040,7 @@ PHP_FUNCTION(mysql_num_rows)
|
|||||||
ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result);
|
ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result);
|
||||||
|
|
||||||
/* conversion from int64 to long happing here */
|
/* conversion from int64 to long happing here */
|
||||||
RETURN_LONG((long) mysql_num_rows(mysql_result));
|
RETURN_LONG((zend_long) mysql_num_rows(mysql_result));
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
|
@ -539,7 +539,7 @@ l1:
|
|||||||
if ( res->values[indx].valtype == SQL_LONGVARCHAR ) {
|
if ( res->values[indx].valtype == SQL_LONGVARCHAR ) {
|
||||||
RETURN_STRING(res->values[indx].value,TRUE);
|
RETURN_STRING(res->values[indx].value,TRUE);
|
||||||
} else {
|
} else {
|
||||||
RETURN_LONG((long)res->values[indx].value);
|
RETURN_LONG((zend_long)res->values[indx].value);
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
if ( res->values[indx].value != NULL ) {
|
if ( res->values[indx].value != NULL ) {
|
||||||
|
@ -2928,7 +2928,7 @@ PHP_FUNCTION(odbc_autocommit)
|
|||||||
odbc_sql_error(conn, SQL_NULL_HSTMT, "Get commit status");
|
odbc_sql_error(conn, SQL_NULL_HSTMT, "Get commit status");
|
||||||
RETURN_FALSE;
|
RETURN_FALSE;
|
||||||
}
|
}
|
||||||
RETVAL_LONG((long)status);
|
RETVAL_LONG((zend_long)status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
@ -548,7 +548,7 @@ PHP_FUNCTION(pcntl_fork)
|
|||||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d", errno);
|
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error %d", errno);
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN_LONG((long) id);
|
RETURN_LONG((zend_long) id);
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
|
@ -2523,7 +2523,7 @@ static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_typ
|
|||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
RETURN_LONG((long)oid);
|
RETURN_LONG((zend_long)oid);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -111,7 +111,7 @@ ZEND_DECLARE_MODULE_GLOBALS(reflection)
|
|||||||
|
|
||||||
/* Class constants */
|
/* Class constants */
|
||||||
#define REGISTER_REFLECTION_CLASS_CONST_LONG(class_name, const_name, value) \
|
#define REGISTER_REFLECTION_CLASS_CONST_LONG(class_name, const_name, value) \
|
||||||
zend_declare_class_constant_long(reflection_ ## class_name ## _ptr, const_name, sizeof(const_name)-1, (long)value TSRMLS_CC);
|
zend_declare_class_constant_long(reflection_ ## class_name ## _ptr, const_name, sizeof(const_name)-1, (zend_long)value TSRMLS_CC);
|
||||||
|
|
||||||
/* {{{ Smart string functions */
|
/* {{{ Smart string functions */
|
||||||
typedef struct _string {
|
typedef struct _string {
|
||||||
@ -668,7 +668,7 @@ static zend_op* _get_recv_op(zend_op_array *op_array, uint32_t offset)
|
|||||||
++offset;
|
++offset;
|
||||||
while (op < end) {
|
while (op < end) {
|
||||||
if ((op->opcode == ZEND_RECV || op->opcode == ZEND_RECV_INIT
|
if ((op->opcode == ZEND_RECV || op->opcode == ZEND_RECV_INIT
|
||||||
|| op->opcode == ZEND_RECV_VARIADIC) && op->op1.num == (long)offset)
|
|| op->opcode == ZEND_RECV_VARIADIC) && op->op1.num == (zend_long)offset)
|
||||||
{
|
{
|
||||||
return op;
|
return op;
|
||||||
}
|
}
|
||||||
|
@ -390,7 +390,7 @@ static void from_zval_write_uint32(const zval *arr_value, char *field, ser_conte
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sizeof(long) > sizeof(uint32_t) && (lval < 0 || lval > 0xFFFFFFFF)) {
|
if (sizeof(zend_long) > sizeof(uint32_t) && (lval < 0 || lval > 0xFFFFFFFF)) {
|
||||||
do_from_zval_err(ctx, "%s", "given PHP integer is out of bounds "
|
do_from_zval_err(ctx, "%s", "given PHP integer is out of bounds "
|
||||||
"for an unsigned 32-bit integer");
|
"for an unsigned 32-bit integer");
|
||||||
return;
|
return;
|
||||||
@ -468,13 +468,13 @@ static void from_zval_write_uid_t(const zval *arr_value, char *field, ser_contex
|
|||||||
|
|
||||||
/* uid_t can be signed or unsigned (generally unsigned) */
|
/* uid_t can be signed or unsigned (generally unsigned) */
|
||||||
if ((uid_t)-1 > (uid_t)0) {
|
if ((uid_t)-1 > (uid_t)0) {
|
||||||
if (sizeof(long) > sizeof(uid_t) && (lval < 0 || (uid_t)lval != lval)) {
|
if (sizeof(zend_long) > sizeof(uid_t) && (lval < 0 || (uid_t)lval != lval)) {
|
||||||
do_from_zval_err(ctx, "%s", "given PHP integer is out of bounds "
|
do_from_zval_err(ctx, "%s", "given PHP integer is out of bounds "
|
||||||
"for a uid_t value");
|
"for a uid_t value");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (sizeof(long) > sizeof(uid_t) && (uid_t)lval != lval) {
|
if (sizeof(zend_long) > sizeof(uid_t) && (uid_t)lval != lval) {
|
||||||
do_from_zval_err(ctx, "%s", "given PHP integer is out of bounds "
|
do_from_zval_err(ctx, "%s", "given PHP integer is out of bounds "
|
||||||
"for a uid_t value");
|
"for a uid_t value");
|
||||||
return;
|
return;
|
||||||
@ -490,49 +490,49 @@ void to_zval_read_int(const char *data, zval *zv, res_context *ctx)
|
|||||||
int ival;
|
int ival;
|
||||||
memcpy(&ival, data, sizeof(ival));
|
memcpy(&ival, data, sizeof(ival));
|
||||||
|
|
||||||
ZVAL_LONG(zv, (long)ival);
|
ZVAL_LONG(zv, (zend_long)ival);
|
||||||
}
|
}
|
||||||
static void to_zval_read_unsigned(const char *data, zval *zv, res_context *ctx)
|
static void to_zval_read_unsigned(const char *data, zval *zv, res_context *ctx)
|
||||||
{
|
{
|
||||||
unsigned ival;
|
unsigned ival;
|
||||||
memcpy(&ival, data, sizeof(ival));
|
memcpy(&ival, data, sizeof(ival));
|
||||||
|
|
||||||
ZVAL_LONG(zv, (long)ival);
|
ZVAL_LONG(zv, (zend_long)ival);
|
||||||
}
|
}
|
||||||
static void to_zval_read_net_uint16(const char *data, zval *zv, res_context *ctx)
|
static void to_zval_read_net_uint16(const char *data, zval *zv, res_context *ctx)
|
||||||
{
|
{
|
||||||
uint16_t ival;
|
uint16_t ival;
|
||||||
memcpy(&ival, data, sizeof(ival));
|
memcpy(&ival, data, sizeof(ival));
|
||||||
|
|
||||||
ZVAL_LONG(zv, (long)ntohs(ival));
|
ZVAL_LONG(zv, (zend_long)ntohs(ival));
|
||||||
}
|
}
|
||||||
static void to_zval_read_uint32(const char *data, zval *zv, res_context *ctx)
|
static void to_zval_read_uint32(const char *data, zval *zv, res_context *ctx)
|
||||||
{
|
{
|
||||||
uint32_t ival;
|
uint32_t ival;
|
||||||
memcpy(&ival, data, sizeof(ival));
|
memcpy(&ival, data, sizeof(ival));
|
||||||
|
|
||||||
ZVAL_LONG(zv, (long)ival);
|
ZVAL_LONG(zv, (zend_long)ival);
|
||||||
}
|
}
|
||||||
static void to_zval_read_sa_family(const char *data, zval *zv, res_context *ctx)
|
static void to_zval_read_sa_family(const char *data, zval *zv, res_context *ctx)
|
||||||
{
|
{
|
||||||
sa_family_t ival;
|
sa_family_t ival;
|
||||||
memcpy(&ival, data, sizeof(ival));
|
memcpy(&ival, data, sizeof(ival));
|
||||||
|
|
||||||
ZVAL_LONG(zv, (long)ival);
|
ZVAL_LONG(zv, (zend_long)ival);
|
||||||
}
|
}
|
||||||
static void to_zval_read_pid_t(const char *data, zval *zv, res_context *ctx)
|
static void to_zval_read_pid_t(const char *data, zval *zv, res_context *ctx)
|
||||||
{
|
{
|
||||||
pid_t ival;
|
pid_t ival;
|
||||||
memcpy(&ival, data, sizeof(ival));
|
memcpy(&ival, data, sizeof(ival));
|
||||||
|
|
||||||
ZVAL_LONG(zv, (long)ival);
|
ZVAL_LONG(zv, (zend_long)ival);
|
||||||
}
|
}
|
||||||
static void to_zval_read_uid_t(const char *data, zval *zv, res_context *ctx)
|
static void to_zval_read_uid_t(const char *data, zval *zv, res_context *ctx)
|
||||||
{
|
{
|
||||||
uid_t ival;
|
uid_t ival;
|
||||||
memcpy(&ival, data, sizeof(ival));
|
memcpy(&ival, data, sizeof(ival));
|
||||||
|
|
||||||
ZVAL_LONG(zv, (long)ival);
|
ZVAL_LONG(zv, (zend_long)ival);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CONVERSIONS for sockaddr */
|
/* CONVERSIONS for sockaddr */
|
||||||
|
@ -198,7 +198,7 @@ PHP_FUNCTION(socket_sendmsg)
|
|||||||
zend_llist_destroy(allocations);
|
zend_llist_destroy(allocations);
|
||||||
efree(allocations);
|
efree(allocations);
|
||||||
|
|
||||||
RETURN_LONG((long)res);
|
RETURN_LONG((zend_long)res);
|
||||||
} else {
|
} else {
|
||||||
PHP_SOCKET_ERROR(php_sock, "error in sendmsg", errno);
|
PHP_SOCKET_ERROR(php_sock, "error in sendmsg", errno);
|
||||||
RETURN_FALSE;
|
RETURN_FALSE;
|
||||||
@ -308,7 +308,7 @@ PHP_FUNCTION(socket_cmsg_space)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN_LONG((long)CMSG_SPACE(entry->size + n * entry->var_el_size));
|
RETURN_LONG((zend_long)CMSG_SPACE(entry->size + n * entry->var_el_size));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAVE_IPV6
|
#if HAVE_IPV6
|
||||||
|
@ -1856,7 +1856,7 @@ PHP_FUNCTION(socket_get_option)
|
|||||||
RETURN_FALSE;
|
RETURN_FALSE;
|
||||||
}
|
}
|
||||||
if (php_add4_to_if_index(&if_addr, php_sock, &if_index TSRMLS_CC) == SUCCESS) {
|
if (php_add4_to_if_index(&if_addr, php_sock, &if_index TSRMLS_CC) == SUCCESS) {
|
||||||
RETURN_LONG((long) if_index);
|
RETURN_LONG((zend_long) if_index);
|
||||||
} else {
|
} else {
|
||||||
RETURN_FALSE;
|
RETURN_FALSE;
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t
|
|||||||
strlcat(cookie, dt->val, len + 100);
|
strlcat(cookie, dt->val, len + 100);
|
||||||
zend_string_free(dt);
|
zend_string_free(dt);
|
||||||
|
|
||||||
snprintf(tsdelta, sizeof(tsdelta), "%li", (long) difftime(expires, time(NULL)));
|
snprintf(tsdelta, sizeof(tsdelta), ZEND_LONG_FMT, (zend_long) difftime(expires, time(NULL)));
|
||||||
strlcat(cookie, COOKIE_MAX_AGE, len + 100);
|
strlcat(cookie, COOKIE_MAX_AGE, len + 100);
|
||||||
strlcat(cookie, tsdelta, len + 100);
|
strlcat(cookie, tsdelta, len + 100);
|
||||||
}
|
}
|
||||||
|
@ -425,13 +425,13 @@ static unsigned int php_next_marker(php_stream * stream, int last_marker, int co
|
|||||||
* skip over a variable-length block; assumes proper length marker */
|
* skip over a variable-length block; assumes proper length marker */
|
||||||
static int php_skip_variable(php_stream * stream TSRMLS_DC)
|
static int php_skip_variable(php_stream * stream TSRMLS_DC)
|
||||||
{
|
{
|
||||||
off_t length = ((unsigned int)php_read2(stream TSRMLS_CC));
|
zend_off_t length = ((unsigned int)php_read2(stream TSRMLS_CC));
|
||||||
|
|
||||||
if (length < 2) {
|
if (length < 2) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
length = length - 2;
|
length = length - 2;
|
||||||
php_stream_seek(stream, (long)length, SEEK_CUR);
|
php_stream_seek(stream, (zend_long)length, SEEK_CUR);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
@ -453,7 +453,7 @@ static int php_read_APP(php_stream * stream, unsigned int marker, zval *info TSR
|
|||||||
|
|
||||||
buffer = emalloc(length);
|
buffer = emalloc(length);
|
||||||
|
|
||||||
if (php_stream_read(stream, buffer, (long) length) <= 0) {
|
if (php_stream_read(stream, buffer, (zend_long) length) <= 0) {
|
||||||
efree(buffer);
|
efree(buffer);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -83,9 +83,9 @@ static void lcg_seed(TSRMLS_D) /* {{{ */
|
|||||||
LCG(s1) = 1;
|
LCG(s1) = 1;
|
||||||
}
|
}
|
||||||
#ifdef ZTS
|
#ifdef ZTS
|
||||||
LCG(s2) = (long) tsrm_thread_id();
|
LCG(s2) = (zend_long) tsrm_thread_id();
|
||||||
#else
|
#else
|
||||||
LCG(s2) = (long) getpid();
|
LCG(s2) = (zend_long) getpid();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Add entropy to s2 by calling gettimeofday() again */
|
/* Add entropy to s2 by calling gettimeofday() again */
|
||||||
|
@ -87,7 +87,7 @@ PHP_FUNCTION(linkinfo)
|
|||||||
char *link;
|
char *link;
|
||||||
char *dirname;
|
char *dirname;
|
||||||
int link_len, dir_len;
|
int link_len, dir_len;
|
||||||
struct stat sb;
|
zend_stat_t sb;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &link, &link_len) == FAILURE) {
|
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &link, &link_len) == FAILURE) {
|
||||||
@ -110,7 +110,7 @@ PHP_FUNCTION(linkinfo)
|
|||||||
}
|
}
|
||||||
|
|
||||||
efree(dirname);
|
efree(dirname);
|
||||||
RETURN_LONG((long) sb.st_dev);
|
RETURN_LONG((zend_long) sb.st_dev);
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
|
@ -98,10 +98,10 @@ PHP_FUNCTION(linkinfo)
|
|||||||
ret = VCWD_STAT(link, &sb);
|
ret = VCWD_STAT(link, &sb);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
|
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
|
||||||
RETURN_LONG(-1L);
|
RETURN_LONG(Z_L(-1));
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN_LONG((long) sb.st_dev);
|
RETURN_LONG((zend_long) sb.st_dev);
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
|
@ -1396,11 +1396,11 @@ static PHP_FUNCTION(tidy_get_config)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TidyInteger:
|
case TidyInteger:
|
||||||
add_assoc_long(return_value, opt_name, (long)opt_value);
|
add_assoc_long(return_value, opt_name, (zend_long)opt_value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TidyBoolean:
|
case TidyBoolean:
|
||||||
add_assoc_bool(return_value, opt_name, (long)opt_value);
|
add_assoc_bool(return_value, opt_name, (zend_long)opt_value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1529,7 +1529,7 @@ static PHP_FUNCTION(tidy_getopt)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
case TidyInteger:
|
case TidyInteger:
|
||||||
RETURN_LONG((long)optval);
|
RETURN_LONG((zend_long)optval);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TidyBoolean:
|
case TidyBoolean:
|
||||||
|
@ -1439,7 +1439,7 @@ PHP_FUNCTION(xml_get_error_code)
|
|||||||
|
|
||||||
ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser);
|
ZEND_FETCH_RESOURCE(parser,xml_parser *, pind, -1, "XML Parser", le_xml_parser);
|
||||||
|
|
||||||
RETURN_LONG((long)XML_GetErrorCode(parser->parser));
|
RETURN_LONG((zend_long)XML_GetErrorCode(parser->parser));
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ PHP_MSHUTDOWN_FUNCTION(xmlreader);
|
|||||||
PHP_MINFO_FUNCTION(xmlreader);
|
PHP_MINFO_FUNCTION(xmlreader);
|
||||||
|
|
||||||
#define REGISTER_XMLREADER_CLASS_CONST_LONG(const_name, value) \
|
#define REGISTER_XMLREADER_CLASS_CONST_LONG(const_name, value) \
|
||||||
zend_declare_class_constant_long(xmlreader_class_entry, const_name, sizeof(const_name)-1, (long)value TSRMLS_CC);
|
zend_declare_class_constant_long(xmlreader_class_entry, const_name, sizeof(const_name)-1, (zend_long)value TSRMLS_CC);
|
||||||
|
|
||||||
#ifdef ZTS
|
#ifdef ZTS
|
||||||
#define XMLREADER_G(v) TSRMG(xmlreader_globals_id, zend_xmlreader_globals *, v)
|
#define XMLREADER_G(v) TSRMG(xmlreader_globals_id, zend_xmlreader_globals *, v)
|
||||||
|
@ -373,7 +373,7 @@ static int php_zip_parse_options(zval *options, zend_long *remove_all_path, char
|
|||||||
|
|
||||||
/* {{{ REGISTER_ZIP_CLASS_CONST_LONG */
|
/* {{{ REGISTER_ZIP_CLASS_CONST_LONG */
|
||||||
#define REGISTER_ZIP_CLASS_CONST_LONG(const_name, value) \
|
#define REGISTER_ZIP_CLASS_CONST_LONG(const_name, value) \
|
||||||
zend_declare_class_constant_long(zip_class_entry, const_name, sizeof(const_name)-1, (long)value TSRMLS_CC);
|
zend_declare_class_constant_long(zip_class_entry, const_name, sizeof(const_name)-1, (zend_long)value TSRMLS_CC);
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
/* {{{ ZIP_FROM_OBJECT */
|
/* {{{ ZIP_FROM_OBJECT */
|
||||||
@ -393,12 +393,12 @@ static int php_zip_parse_options(zval *options, zend_long *remove_all_path, char
|
|||||||
{ \
|
{ \
|
||||||
array_init(return_value); \
|
array_init(return_value); \
|
||||||
add_ascii_assoc_string(return_value, "name", (char *)(sb)->name); \
|
add_ascii_assoc_string(return_value, "name", (char *)(sb)->name); \
|
||||||
add_ascii_assoc_long(return_value, "index", (long) (sb)->index); \
|
add_ascii_assoc_long(return_value, "index", (zend_long) (sb)->index); \
|
||||||
add_ascii_assoc_long(return_value, "crc", (long) (sb)->crc); \
|
add_ascii_assoc_long(return_value, "crc", (zend_long) (sb)->crc); \
|
||||||
add_ascii_assoc_long(return_value, "size", (long) (sb)->size); \
|
add_ascii_assoc_long(return_value, "size", (zend_long) (sb)->size); \
|
||||||
add_ascii_assoc_long(return_value, "mtime", (long) (sb)->mtime); \
|
add_ascii_assoc_long(return_value, "mtime", (zend_long) (sb)->mtime); \
|
||||||
add_ascii_assoc_long(return_value, "comp_size", (long) (sb)->comp_size); \
|
add_ascii_assoc_long(return_value, "comp_size", (zend_long) (sb)->comp_size); \
|
||||||
add_ascii_assoc_long(return_value, "comp_method", (long) (sb)->comp_method); \
|
add_ascii_assoc_long(return_value, "comp_method", (zend_long) (sb)->comp_method); \
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
@ -1124,7 +1124,7 @@ static PHP_NAMED_FUNCTION(zif_zip_open)
|
|||||||
rsrc_int->za = zip_open(resolved_path, 0, &err);
|
rsrc_int->za = zip_open(resolved_path, 0, &err);
|
||||||
if (rsrc_int->za == NULL) {
|
if (rsrc_int->za == NULL) {
|
||||||
efree(rsrc_int);
|
efree(rsrc_int);
|
||||||
RETURN_LONG((long)err);
|
RETURN_LONG((zend_long)err);
|
||||||
}
|
}
|
||||||
|
|
||||||
rsrc_int->index_current = 0;
|
rsrc_int->index_current = 0;
|
||||||
|
@ -973,7 +973,7 @@ static inline php_output_handler_status_t php_output_handler_op(php_output_handl
|
|||||||
zval retval, ob_data, ob_mode;
|
zval retval, ob_data, ob_mode;
|
||||||
|
|
||||||
ZVAL_STRINGL(&ob_data, handler->buffer.data, handler->buffer.used);
|
ZVAL_STRINGL(&ob_data, handler->buffer.data, handler->buffer.used);
|
||||||
ZVAL_LONG(&ob_mode, (long) context->op);
|
ZVAL_LONG(&ob_mode, (zend_long) context->op);
|
||||||
zend_fcall_info_argn(&handler->func.user->fci TSRMLS_CC, 2, &ob_data, &ob_mode);
|
zend_fcall_info_argn(&handler->func.user->fci TSRMLS_CC, 2, &ob_data, &ob_mode);
|
||||||
|
|
||||||
#define PHP_OUTPUT_USER_SUCCESS(retval) ((Z_TYPE(retval) != IS_UNDEF) && !(Z_TYPE(retval) == IS_FALSE))
|
#define PHP_OUTPUT_USER_SUCCESS(retval) ((Z_TYPE(retval) != IS_UNDEF) && !(Z_TYPE(retval) == IS_FALSE))
|
||||||
|
@ -434,7 +434,7 @@ END_EXTERN_C()
|
|||||||
#else /* ! (CRAY || __arm) */
|
#else /* ! (CRAY || __arm) */
|
||||||
|
|
||||||
#define XtOffset(p_type, field) \
|
#define XtOffset(p_type, field) \
|
||||||
((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
|
((zend_long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
|
||||||
|
|
||||||
#endif /* !CRAY */
|
#endif /* !CRAY */
|
||||||
#endif /* ! XtOffset */
|
#endif /* ! XtOffset */
|
||||||
|
@ -987,7 +987,7 @@ static int php_userstreamop_set_option(php_stream *stream, int option, int value
|
|||||||
case PHP_STREAM_TRUNCATE_SET_SIZE: {
|
case PHP_STREAM_TRUNCATE_SET_SIZE: {
|
||||||
ptrdiff_t new_size = *(ptrdiff_t*) ptrparam;
|
ptrdiff_t new_size = *(ptrdiff_t*) ptrparam;
|
||||||
if (new_size >= 0 && new_size <= (ptrdiff_t)LONG_MAX) {
|
if (new_size >= 0 && new_size <= (ptrdiff_t)LONG_MAX) {
|
||||||
ZVAL_LONG(&args[0], (long)new_size);
|
ZVAL_LONG(&args[0], (zend_long)new_size);
|
||||||
call_result = call_user_function_ex(NULL,
|
call_result = call_user_function_ex(NULL,
|
||||||
Z_ISUNDEF(us->object)? NULL : &us->object,
|
Z_ISUNDEF(us->object)? NULL : &us->object,
|
||||||
&func_name,
|
&func_name,
|
||||||
|
@ -643,7 +643,7 @@ int fcgi_listen(const char *path, int backlog)
|
|||||||
if (namedPipe == INVALID_HANDLE_VALUE) {
|
if (namedPipe == INVALID_HANDLE_VALUE) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
listen_socket = _open_osfhandle((long)namedPipe, 0);
|
listen_socket = _open_osfhandle((intptr_t)namedPipe, 0);
|
||||||
if (!is_initialized) {
|
if (!is_initialized) {
|
||||||
fcgi_init();
|
fcgi_init();
|
||||||
}
|
}
|
||||||
@ -724,7 +724,7 @@ int fcgi_listen(const char *path, int backlog)
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (tcp) {
|
if (tcp) {
|
||||||
listen_socket = _open_osfhandle((long)listen_socket, 0);
|
listen_socket = _open_osfhandle((intptr_t)listen_socket, 0);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
fcgi_setup_signals();
|
fcgi_setup_signals();
|
||||||
|
Loading…
Reference in New Issue
Block a user