X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_cache_api.h;h=e6c0838c8cec6a62c2715b842588f1acf7194e50;hp=d75d432125a1ef4c98b433e7e9f012ad5ea590d9;hb=a0bca521b491711e43aef74fe19c23a8eb4d0777;hpb=e83a7438dc70ed96630887246a1d3aefcf155b1c diff --git a/php_http_cache_api.h b/php_http_cache_api.h index d75d432..e6c0838 100644 --- a/php_http_cache_api.h +++ b/php_http_cache_api.h @@ -74,8 +74,8 @@ static inline void *_http_etag_init(TSRMLS_D) switch (mode) { case HTTP_ETAG_CRC32: - ctx = emalloc(sizeof(unsigned int)); - *((unsigned int *) ctx) = ~0; + ctx = emalloc(sizeof(uint)); + *((uint *) ctx) = ~0; break; case HTTP_ETAG_SHA1: @@ -109,9 +109,9 @@ static inline void _http_etag_free(void **ctx_ptr TSRMLS_DC) switch (mode) { case HTTP_ETAG_CRC32: - if (*((unsigned int **) ctx_ptr)) { - efree(*((unsigned int **) ctx_ptr)); - *((unsigned int **) ctx_ptr) = NULL; + if (*((uint **) ctx_ptr)) { + efree(*((uint **) ctx_ptr)); + *((uint **) ctx_ptr) = NULL; } break; @@ -154,8 +154,8 @@ static inline char *_http_etag_finish(void **ctx_ptr TSRMLS_DC) switch (mode) { case HTTP_ETAG_CRC32: - **((unsigned int **) ctx_ptr) = ~**((unsigned int **) ctx_ptr); - etag = http_etag_digest(*((const unsigned char **) ctx_ptr), sizeof(unsigned int)); + **((uint **) ctx_ptr) = ~**((uint **) ctx_ptr); + etag = http_etag_digest(*((const unsigned char **) ctx_ptr), sizeof(uint)); break; case HTTP_ETAG_SHA1: @@ -196,12 +196,12 @@ static inline void _http_etag_update(void *ctx, const char *data_ptr, size_t dat { case HTTP_ETAG_CRC32: { - unsigned int i, c = *((unsigned int *) ctx); + uint i, c = *((uint *) ctx); for (i = 0; i < data_len; ++i) { c = CRC32(c, data_ptr[i]); } - *((unsigned int *)ctx) = c; + *((uint *)ctx) = c; } break;