]> granicus.if.org Git - apache/commitdiff
clean up some signed/unsigned discrepancies, hopefully with the absolute
authorJeff Trawick <trawick@apache.org>
Sat, 8 Dec 2001 13:05:56 +0000 (13:05 +0000)
committerJeff Trawick <trawick@apache.org>
Sat, 8 Dec 2001 13:05:56 +0000 (13:05 +0000)
minimum of casting; it wouldn't compile with AIX xlc otherwise (experience
says that Tru64 and HP-UX native compilers would be extremely unhappy too,
though I didn't try yet)

get rid of unused function deflate_insert_filter (trivial to put back
so no reason to #if 0)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92396 13f79535-47bb-0310-9956-ffa450edef68

modules/experimental/mod_deflate.c

index bea345e98730ecf05b9268a126dfd28bf64b3c1e..8e9be6c5c21c7a910ef26273639eb7ab64f070ea 100644 (file)
@@ -198,18 +198,13 @@ static const char *deflate_set_memlevel(cmd_parms * cmd, void *dummy,
     return NULL;
 }
 
-static void deflate_insert_filter(request_rec * r)
-{
-    ap_add_output_filter(deflateFilterName, NULL, r, r->connection);
-}
-
 /* magic header */
 static int deflate_magic[2] = { 0x1f, 0x8b };        
 
 typedef struct deflate_ctx_t
 {
     z_stream stream;
-    char buffer[FILTER_BUFSIZE];
+    unsigned char buffer[FILTER_BUFSIZE];
     unsigned long crc;
     apr_bucket_brigade *bb;
 } deflate_ctx;
@@ -321,7 +316,7 @@ static apr_status_t deflate_out_filter(ap_filter_t *f,
                 deflate_len = FILTER_BUFSIZE - ctx->stream.avail_out;
 
                 if (deflate_len != 0) {
-                    b = apr_bucket_heap_create(ctx->buffer, deflate_len, 1);
+                    b = apr_bucket_heap_create((char *)ctx->buffer, deflate_len, 1);
                     APR_BRIGADE_INSERT_TAIL(ctx->bb, b);
                     ctx->stream.next_out = ctx->buffer;
                     ctx->stream.avail_out = FILTER_BUFSIZE;
@@ -399,7 +394,8 @@ static apr_status_t deflate_out_filter(ap_filter_t *f,
         ctx->crc = crc32(ctx->crc, (const Bytef *)data, len);
 
         /* write */
-        ctx->stream.next_in = (char *)data;
+        ctx->stream.next_in = (unsigned char *)data; /* we just lost const-ness,
+                                              but we'll just have to trust zlib */
         ctx->stream.avail_in = len;
         ctx->stream.next_out = ctx->buffer;
         ctx->stream.avail_out = FILTER_BUFSIZE;
@@ -410,7 +406,7 @@ static apr_status_t deflate_out_filter(ap_filter_t *f,
                 ctx->stream.next_out = ctx->buffer;
                 len = FILTER_BUFSIZE - ctx->stream.avail_out;
 
-                b = apr_bucket_heap_create(ctx->buffer, len, 1);
+                b = apr_bucket_heap_create((char *)ctx->buffer, len, 1);
                 APR_BRIGADE_INSERT_TAIL(ctx->bb, b);
                 ctx->stream.avail_out = FILTER_BUFSIZE;
             }