Browse Source

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
svn/tags/lighttpd-1.3.14
Jan Kneschke 17 years ago
parent
commit
8e67134b23
  1. 4
      src/crc32.c
  2. 4
      src/crc32.h
  3. 4
      src/mod_compress.c

4
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;
}

4
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 <sys/types.h>
unsigned long generate_crc32c(char *string, size_t length);
#endif

4
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;

Loading…
Cancel
Save