From: Jan-E Date: Thu, 24 Oct 2019 10:46:50 +0000 (+0200) Subject: PHP 7.4: ulong->unsigned long, uint->uint32_t X-Git-Tag: RELEASE_3_2_3~2^2~1 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=82923890d9ce44a0642ac2f5ea0cb343aaf50fe3;p=m6w6%2Fext-http PHP 7.4: ulong->unsigned long, uint->uint32_t --- diff --git a/src/php_http_client_curl.c b/src/php_http_client_curl.c index 45515fa..94cdf47 100644 --- a/src/php_http_client_curl.c +++ b/src/php_http_client_curl.c @@ -46,7 +46,7 @@ typedef struct php_http_client_curl_handler { php_http_buffer_t ranges; struct { - uint count; + uint32_t count; double delay; } retry; diff --git a/src/php_http_curl.c b/src/php_http_curl.c index 5c026a6..63bc104 100644 --- a/src/php_http_curl.c +++ b/src/php_http_curl.c @@ -43,9 +43,9 @@ static void php_http_openssl_thread_lock(int mode, int n, const char * file, int } } -static ulong php_http_openssl_thread_id(void) +static unsigned long php_http_openssl_thread_id(void) { - return (ulong) tsrm_thread_id(); + return (unsigned long) tsrm_thread_id(); } #endif #if PHP_HTTP_NEED_GNUTLS_TSL diff --git a/src/php_http_encoding.c b/src/php_http_encoding.c index 4e25de3..3e57e29 100644 --- a/src/php_http_encoding.c +++ b/src/php_http_encoding.c @@ -36,7 +36,7 @@ const char *php_http_encoding_dechunk(const char *encoded, size_t encoded_len, c *decoded = ecalloc(1, encoded_len + 1); while ((encoded + encoded_len - e_ptr) > 0) { - ulong chunk_len = 0, rest; + unsigned long chunk_len = 0, rest; chunk_len = strtoul(e_ptr, &n_ptr, 16); @@ -237,7 +237,7 @@ void php_http_encoding_stream_free(php_http_encoding_stream_t **s) struct dechunk_ctx { php_http_buffer_t buffer; - ulong hexlen; + unsigned long hexlen; unsigned zeroed:1; }; diff --git a/src/php_http_etag.c b/src/php_http_etag.c index 1430cfa..048af87 100644 --- a/src/php_http_etag.c +++ b/src/php_http_etag.c @@ -26,8 +26,8 @@ php_http_etag_t *php_http_etag_init(const char *mode) php_http_etag_t *e; if (mode && (!strcasecmp(mode, "crc32b"))) { - ctx = emalloc(sizeof(uint)); - *((uint *) ctx) = ~0; + ctx = emalloc(sizeof(uint32_t)); + *((uint32_t *) ctx) = ~0; } else if (mode && !strcasecmp(mode, "sha1")) { PHP_SHA1Init(ctx = emalloc(sizeof(PHP_SHA1_CTX))); } else if (mode && !strcasecmp(mode, "md5")) { @@ -57,7 +57,7 @@ char *php_http_etag_finish(php_http_etag_t *e) char *etag = NULL; if (!strcasecmp(e->mode, "crc32b")) { - uint e_ctx; + uint32_t e_ctx; memcpy(&e_ctx, e->ctx, 4); e_ctx = ntohl(~e_ctx); etag = php_http_etag_digest((unsigned char *) &e_ctx, 4); @@ -88,11 +88,11 @@ char *php_http_etag_finish(php_http_etag_t *e) size_t php_http_etag_update(php_http_etag_t *e, const char *data_ptr, size_t data_len) { if (!strcasecmp(e->mode, "crc32b")) { - uint i, c = *((uint *) e->ctx); + uint32_t i, c = *((uint32_t *) e->ctx); for (i = 0; i < data_len; ++i) { CRC32(c, data_ptr[i]); } - *((uint *) e->ctx) = c; + *((uint32_t *) e->ctx) = c; } else if ((!strcasecmp(e->mode, "sha1"))) { PHP_SHA1Update(e->ctx, (const unsigned char *) data_ptr, data_len); } else if ((!strcasecmp(e->mode, "md5"))) { diff --git a/src/php_http_filter.c b/src/php_http_filter.c index 95ff560..52d2b03 100644 --- a/src/php_http_filter.c +++ b/src/php_http_filter.c @@ -72,7 +72,7 @@ PHP_MINIT_FUNCTION(http_filter) typedef struct _http_chunked_decode_filter_buffer_t { php_http_buffer_t buffer; - ulong hexlen; + unsigned long hexlen; } PHP_HTTP_FILTER_BUFFER(chunked_decode); typedef php_http_encoding_stream_t PHP_HTTP_FILTER_BUFFER(stream); diff --git a/src/php_http_message_parser.c b/src/php_http_message_parser.c index 49a6013..517806d 100644 --- a/src/php_http_message_parser.c +++ b/src/php_http_message_parser.c @@ -323,7 +323,7 @@ php_http_message_parser_state_t php_http_message_parser_parse(php_http_message_p } if (content_range) { - ulong total = 0, start = 0, end = 0; + unsigned long total = 0, start = 0, end = 0; if (!strncasecmp(content_range->val, "bytes", lenof("bytes")) && ( content_range->val[lenof("bytes")] == ':' diff --git a/src/php_http_options.c b/src/php_http_options.c index 4cb6ed3..65a27af 100644 --- a/src/php_http_options.c +++ b/src/php_http_options.c @@ -74,7 +74,7 @@ void php_http_options_free(php_http_options_t **registry) } } -php_http_option_t *php_http_option_register(php_http_options_t *registry, const char *name_str, size_t name_len, ulong option, zend_uchar type) +php_http_option_t *php_http_option_register(php_http_options_t *registry, const char *name_str, size_t name_len, unsigned long option, zend_uchar type) { php_http_option_t opt; diff --git a/src/php_http_options.h b/src/php_http_options.h index 4fff611..fd72ebd 100644 --- a/src/php_http_options.h +++ b/src/php_http_options.h @@ -32,7 +32,7 @@ struct php_http_option { php_http_options_t suboptions; zend_string *name; - ulong option; + unsigned long option; zend_uchar type; unsigned flags; zval defval; @@ -46,7 +46,7 @@ PHP_HTTP_API ZEND_RESULT_CODE php_http_options_apply(php_http_options_t *registr PHP_HTTP_API void php_http_options_dtor(php_http_options_t *registry); PHP_HTTP_API void php_http_options_free(php_http_options_t **registry); -PHP_HTTP_API php_http_option_t *php_http_option_register(php_http_options_t *registry, const char *name_str, size_t name_len, ulong option, zend_uchar type); +PHP_HTTP_API php_http_option_t *php_http_option_register(php_http_options_t *registry, const char *name_str, size_t name_len, unsigned long option, zend_uchar type); PHP_HTTP_API zval *php_http_option_get(php_http_option_t *opt, HashTable *options, void *userdata); #endif /* PHP_HTTP_OPTIONS_H */ diff --git a/src/php_http_querystring.c b/src/php_http_querystring.c index bd3afe5..391bccf 100644 --- a/src/php_http_querystring.c +++ b/src/php_http_querystring.c @@ -63,7 +63,7 @@ static inline void php_http_querystring_str(zval *instance, zval *return_value) } } -static inline void php_http_querystring_get(zval *instance, int type, char *name, uint name_len, zval *defval, zend_bool del, zval *return_value) +static inline void php_http_querystring_get(zval *instance, int type, char *name, uint32_t name_len, zval *defval, zend_bool del, zval *return_value) { zval *arrval, qarray_tmp, *qarray = zend_read_property(php_http_querystring_class_entry, instance, ZEND_STRL("queryArray"), 0, &qarray_tmp);