From 8e67134b23894b6ec3660b2506010b605997bcdf Mon Sep 17 00:00:00 2001 From: Jan Kneschke Date: Sun, 5 Jun 2005 11:59:33 +0000 Subject: [PATCH] use size_t instead of unsigned int and char * instead of unsigned char * git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.3.x@369 152afb58-edef-0310-8abb-c4023f1b3aa9 --- src/crc32.c | 4 ++-- src/crc32.h | 4 +++- src/mod_compress.c | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/crc32.c b/src/crc32.c index 2b2053e1..bb908411 100644 --- a/src/crc32.c +++ b/src/crc32.c @@ -71,13 +71,13 @@ static const unsigned int crc_c[256] = { unsigned long -generate_crc32c(unsigned char *buffer, unsigned int length) +generate_crc32c(char *buffer, size_t length) { unsigned int i; unsigned long crc32 = ~0L; for (i = 0; i < length; i++){ - CRC32C(crc32, buffer[i]); + CRC32C(crc32, (unsigned char)buffer[i]); } return ~crc32; } diff --git a/src/crc32.h b/src/crc32.h index e5b1c2fd..f89ab0eb 100644 --- a/src/crc32.h +++ b/src/crc32.h @@ -1,6 +1,8 @@ #ifndef __crc32cr_table_h__ #define __crc32cr_table_h__ -unsigned long generate_crc32c(unsigned char *string, unsigned int length); +#include + +unsigned long generate_crc32c(char *string, size_t length); #endif diff --git a/src/mod_compress.c b/src/mod_compress.c index 9f5977d1..c75b7fba 100644 --- a/src/mod_compress.c +++ b/src/mod_compress.c @@ -147,7 +147,7 @@ SETDEFAULTS_FUNC(mod_compress_setdefaults) { } #ifdef USE_ZLIB -static int deflate_file_to_buffer_gzip(server *srv, connection *con, plugin_data *p, unsigned char *start, off_t st_size, time_t mtime) { +static int deflate_file_to_buffer_gzip(server *srv, connection *con, plugin_data *p, char *start, off_t st_size, time_t mtime) { unsigned char *c; unsigned long crc; z_stream z; @@ -168,7 +168,7 @@ static int deflate_file_to_buffer_gzip(server *srv, connection *con, plugin_data return -1; } - z.next_in = start; + z.next_in = (unsigned char *)start; z.avail_in = st_size; z.total_in = 0;