From 8009e79e3a7b10eea99bb8534ff96189ffa281b5 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 9 Nov 2005 12:48:45 +0000 Subject: [PATCH] - use %zu for size_t - update .cvsignore --- http_encoding_api.c | 10 +++++----- http_message_api.c | 4 ++-- http_send_api.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/http_encoding_api.c b/http_encoding_api.c index c16bc1a..eecbbab 100644 --- a/http_encoding_api.c +++ b/http_encoding_api.c @@ -72,7 +72,7 @@ PHP_HTTP_API const char *_http_encoding_dechunk(const char *encoded, size_t enco return encoded + encoded_len; } else { efree(*decoded); - http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Expected chunk size at pos %lu of %lu but got trash", (ulong) (n_ptr - encoded), (ulong) encoded_len); + http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Expected chunk size at pos %tu of %zu but got trash", n_ptr - encoded, encoded_len); return NULL; } } @@ -85,16 +85,16 @@ PHP_HTTP_API const char *_http_encoding_dechunk(const char *encoded, size_t enco /* there should be CRLF after the chunk size, but we'll ignore SP+ too */ if (*n_ptr && !eol_match(&n_ptr, &eol_len)) { if (eol_len == 2) { - http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Expected CRLF at pos %lu of %lu but got 0x%02X 0x%02X", (ulong) (n_ptr - encoded), (ulong) encoded_len, *n_ptr, *(n_ptr + 1)); + http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Expected CRLF at pos %tu of %zu but got 0x%02X 0x%02X", n_ptr - encoded, encoded_len, *n_ptr, *(n_ptr + 1)); } else { - http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Expected LF at pos %lu of %lu but got 0x%02X", (ulong) (n_ptr - encoded), (ulong) encoded_len, *n_ptr); + http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Expected LF at pos %tu of %zu but got 0x%02X", n_ptr - encoded, encoded_len, *n_ptr); } } n_ptr += eol_len; /* chunk size pretends more data than we actually got, so it's probably a truncated message */ if (chunk_len > (rest = encoded + encoded_len - n_ptr)) { - http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Truncated message: chunk size %lu exceeds remaining data size %lu at pos %lu of %lu", chunk_len, rest, (ulong) (n_ptr - encoded), (ulong) encoded_len); + http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Truncated message: chunk size %lu exceeds remaining data size %lu at pos %tu of %zu", chunk_len, rest, n_ptr - encoded, encoded_len); chunk_len = rest; } @@ -604,7 +604,7 @@ PHP_HTTP_API zend_bool _http_encoding_response_start(size_t content_length TSRML if (content_length) { char cl_header_str[128]; size_t cl_header_len; - cl_header_len = snprintf(cl_header_str, lenof(cl_header_str), "Content-Length: %lu", (ulong) content_length); + cl_header_len = snprintf(cl_header_str, lenof(cl_header_str), "Content-Length: %zu", content_length); http_send_header_string_ex(cl_header_str, cl_header_len, 1); } } else { diff --git a/http_message_api.c b/http_message_api.c index fdb0812..f749228 100644 --- a/http_message_api.c +++ b/http_message_api.c @@ -160,7 +160,7 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char char *tmp; int tmp_len; - tmp_len = (int) spprintf(&tmp, 0, "%lu", (ulong) decoded_len); + tmp_len = (int) spprintf(&tmp, 0, "%zu", decoded_len); MAKE_STD_ZVAL(len); ZVAL_STRINGL(len, tmp, tmp_len, 0); @@ -264,7 +264,7 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char char *tmp; int tmp_len; - tmp_len = (int) spprintf(&tmp, 0, "%lu", (ulong) decoded_len); + tmp_len = (int) spprintf(&tmp, 0, "%zu", decoded_len); MAKE_STD_ZVAL(len); ZVAL_STRINGL(len, tmp, tmp_len, 0); diff --git a/http_send_api.c b/http_send_api.c index badfaf7..dfd0643 100644 --- a/http_send_api.c +++ b/http_send_api.c @@ -338,7 +338,7 @@ PHP_HTTP_API STATUS _http_send_ex(const void *data_ptr, size_t data_size, http_s char range_header_str[256]; size_t range_header_len; - range_header_len = snprintf(range_header_str, lenof(range_header_str), "Content-Range: bytes %ld-%ld/%lu", Z_LVAL_PP(begin), Z_LVAL_PP(end), (ulong) data_size); + range_header_len = snprintf(range_header_str, lenof(range_header_str), "Content-Range: bytes %ld-%ld/%zu", Z_LVAL_PP(begin), Z_LVAL_PP(end), data_size); http_send_status_header_ex(206, range_header_str, range_header_len, 1); http_send_response_start(&s, Z_LVAL_PP(end)-Z_LVAL_PP(begin)+1); http_send_response_data_fetch(&s, data_ptr, data_size, data_mode, Z_LVAL_PP(begin), Z_LVAL_PP(end) + 1); -- 2.30.2