From b63ab83256868db44eecedde319a4c2a27a5a10f Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 26 Aug 2014 13:20:21 +0200 Subject: [PATCH] several signature and data type fixes --- Zend/zend.h | 2 +- Zend/zend_alloc.c | 4 ++-- Zend/zend_exceptions.c | 8 ++++---- Zend/zend_exceptions.h | 6 +++--- ext/com_dotnet/com_handlers.c | 2 +- ext/fileinfo/libmagic/file.h | 3 +-- main/main.c | 2 +- main/streams/userspace.c | 4 ++-- win32/sendmail.c | 4 ++-- 9 files changed, 17 insertions(+), 18 deletions(-) diff --git a/Zend/zend.h b/Zend/zend.h index c667b6c45a..42a59b7bd5 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -537,7 +537,7 @@ typedef struct _zend_utility_functions { size_t (*printf_function)(const char *format, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2); size_t (*write_function)(const char *str, size_t str_length); FILE *(*fopen_function)(const char *filename, char **opened_path TSRMLS_DC); - void (*message_handler)(long message, const void *data TSRMLS_DC); + void (*message_handler)(zend_long message, const void *data TSRMLS_DC); void (*block_interruptions)(void); void (*unblock_interruptions)(void); int (*get_configuration_directive)(const char *name, uint name_length, zval *contents); diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index cace802579..b3430c4f5d 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -670,7 +670,7 @@ static inline unsigned int zend_mm_high_bit(size_t _size) __asm__("bsrl %1,%0\n\t" : "=r" (n) : "rm" (_size) : "cc"); return n; #elif defined(__GNUC__) && defined(__x86_64__) - unsigned long n; + zend_ulong n; __asm__("bsr %1,%0\n\t" : "=r" (n) : "rm" (_size) : "cc"); return (unsigned int)n; @@ -698,7 +698,7 @@ static inline unsigned int zend_mm_low_bit(size_t _size) __asm__("bsfl %1,%0\n\t" : "=r" (n) : "rm" (_size) : "cc"); return n; #elif defined(__GNUC__) && defined(__x86_64__) - unsigned long n; + zend_ulong n; __asm__("bsf %1,%0\n\t" : "=r" (n) : "rm" (_size) : "cc"); return (unsigned int)n; diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index d8e183edf5..c246b18726 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -513,7 +513,7 @@ static void _build_trace_string(zval *frame, zend_ulong index, zend_string **str { char *s_tmp; int len; - long line; + zend_long line; HashTable *ht; zval *file, *tmp; zend_string *str = *str_ptr; @@ -800,7 +800,7 @@ ZEND_API zend_class_entry *zend_get_error_exception(TSRMLS_D) /* {{{ */ } /* }}} */ -ZEND_API zend_object *zend_throw_exception(zend_class_entry *exception_ce, const char *message, long code TSRMLS_DC) /* {{{ */ +ZEND_API zend_object *zend_throw_exception(zend_class_entry *exception_ce, const char *message, zend_long code TSRMLS_DC) /* {{{ */ { zval ex; @@ -827,7 +827,7 @@ ZEND_API zend_object *zend_throw_exception(zend_class_entry *exception_ce, const } /* }}} */ -ZEND_API zend_object *zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, const char *format, ...) /* {{{ */ +ZEND_API zend_object *zend_throw_exception_ex(zend_class_entry *exception_ce, zend_long code TSRMLS_DC, const char *format, ...) /* {{{ */ { va_list arg; char *message; @@ -842,7 +842,7 @@ ZEND_API zend_object *zend_throw_exception_ex(zend_class_entry *exception_ce, lo } /* }}} */ -ZEND_API zend_object *zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, long code, int severity TSRMLS_DC) /* {{{ */ +ZEND_API zend_object *zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, zend_long code, int severity TSRMLS_DC) /* {{{ */ { zval ex; zend_object *obj = zend_throw_exception(exception_ce, message, code TSRMLS_CC); diff --git a/Zend/zend_exceptions.h b/Zend/zend_exceptions.h index a799786751..0c13b66281 100644 --- a/Zend/zend_exceptions.h +++ b/Zend/zend_exceptions.h @@ -40,12 +40,12 @@ ZEND_API void zend_register_default_classes(TSRMLS_D); /* exception_ce NULL or zend_exception_get_default() or a derived class * message NULL or the message of the exception */ -ZEND_API zend_object *zend_throw_exception(zend_class_entry *exception_ce, const char *message, long code TSRMLS_DC); -ZEND_API zend_object *zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, const char *format, ...); +ZEND_API zend_object *zend_throw_exception(zend_class_entry *exception_ce, const char *message, zend_long code TSRMLS_DC); +ZEND_API zend_object *zend_throw_exception_ex(zend_class_entry *exception_ce, zend_long code TSRMLS_DC, const char *format, ...); ZEND_API void zend_throw_exception_object(zval *exception TSRMLS_DC); ZEND_API void zend_clear_exception(TSRMLS_D); -ZEND_API zend_object *zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, long code, int severity TSRMLS_DC); +ZEND_API zend_object *zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, zend_long code, int severity TSRMLS_DC); extern ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC); diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c index b67fb1e713..3dec630721 100644 --- a/ext/com_dotnet/com_handlers.c +++ b/ext/com_dotnet/com_handlers.c @@ -525,7 +525,7 @@ static int com_object_cast(zval *readobj, zval *writeobj, int type TSRMLS_DC) return zend_std_cast_object_tostring(readobj, writeobj, type TSRMLS_CC); } -static int com_object_count(zval *object, long *count TSRMLS_DC) +static int com_object_count(zval *object, zend_long *count TSRMLS_DC) { php_com_dotnet_object *obj; LONG ubound = 0, lbound = 0; diff --git a/ext/fileinfo/libmagic/file.h b/ext/fileinfo/libmagic/file.h index 9a61d2ce49..0a5c19c54c 100644 --- a/ext/fileinfo/libmagic/file.h +++ b/ext/fileinfo/libmagic/file.h @@ -407,7 +407,6 @@ struct magic_set { /* Type for Unicode characters */ typedef unsigned long unichar; -struct stat; #define FILE_T_LOCAL 1 #define FILE_T_WINDOWS 2 protected const char *file_fmttime(uint64_t, int, char *); @@ -415,7 +414,7 @@ protected struct magic_set *file_ms_alloc(int); protected void file_ms_free(struct magic_set *); protected int file_buffer(struct magic_set *, php_stream *, const char *, const void *, size_t); -protected int file_fsmagic(struct magic_set *, const char *, struct stat *, php_stream *); +protected int file_fsmagic(struct magic_set *, const char *, zend_stat_t *, php_stream *); protected int file_pipe2file(struct magic_set *, int, const void *, size_t); protected int file_replace(struct magic_set *, const char *, const char *); protected int file_printf(struct magic_set *, const char *, ...); diff --git a/main/main.c b/main/main.c index 9b5c41079c..9338fee8d2 100644 --- a/main/main.c +++ b/main/main.c @@ -1454,7 +1454,7 @@ static int php_get_configuration_directive_for_zend(const char *name, uint name_ /* {{{ php_message_handler_for_zend */ -static void php_message_handler_for_zend(long message, const void *data TSRMLS_DC) +static void php_message_handler_for_zend(zend_long message, const void *data TSRMLS_DC) { switch (message) { case ZMSG_FAILED_INCLUDE_FOPEN: diff --git a/main/streams/userspace.c b/main/streams/userspace.c index aac7769eb8..61c28c4cea 100644 --- a/main/streams/userspace.c +++ b/main/streams/userspace.c @@ -751,7 +751,7 @@ static int php_userstreamop_flush(php_stream *stream TSRMLS_DC) return call_result; } -static int php_userstreamop_seek(php_stream *stream, off_t offset, int whence, off_t *newoffs TSRMLS_DC) +static int php_userstreamop_seek(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs TSRMLS_DC) { zval func_name; zval retval; @@ -1454,7 +1454,7 @@ static int php_userstreamop_closedir(php_stream *stream, int close_handle TSRMLS return 0; } -static int php_userstreamop_rewinddir(php_stream *stream, off_t offset, int whence, off_t *newoffs TSRMLS_DC) +static int php_userstreamop_rewinddir(php_stream *stream, zend_off_t offset, int whence, zend_off_t *newoffs TSRMLS_DC) { zval func_name; zval retval; diff --git a/win32/sendmail.c b/win32/sendmail.c index 3d61d8b6b4..5fe33331cd 100644 --- a/win32/sendmail.c +++ b/win32/sendmail.c @@ -360,8 +360,8 @@ PHPAPI char *GetSMErrorText(int index) } } -PHPAPI zend_string *php_str_to_str(char *haystack, int length, char *needle, - int needle_len, char *str, int str_len); +PHPAPI zend_string *php_str_to_str(char *haystack, size_t length, char *needle, + size_t needle_len, char *str, size_t str_len); /********************************************************************* -- 2.50.1