You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Victor J. Orlikowski" <v....@gte.net> on 2000/07/12 18:01:52 UTC
[PATCH] Various buckets corrections.
Slight boogs that (rightly) confuse xlC on AIX.
Index: src/lib/apr/buckets/ap_buf.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/lib/apr/buckets/ap_buf.c,v
retrieving revision 1.3
diff -u -r1.3 ap_buf.c
--- ap_buf.c 2000/07/11 21:33:35 1.3
+++ ap_buf.c 2000/07/12 15:45:08
@@ -300,7 +300,7 @@
b->tail = b->tail->next;
b->tail->bucket = r;
}
- va_end(v);
+ va_end(va);
return n;
}
Index: src/lib/apr/buckets/ap_rmem_buf.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/lib/apr/buckets/ap_rmem_buf.c,v
retrieving revision 1.1
diff -u -r1.1 ap_rmem_buf.c
--- ap_rmem_buf.c 2000/07/11 21:33:35 1.1
+++ ap_rmem_buf.c 2000/07/12 15:45:08
@@ -77,7 +77,7 @@
APR_EXPORT(int) ap_rmem_get_len(ap_bucket_rmem *b)
{
- return b->end - b->start;
+ return (char *)b->end - (char *)b->start;
}
/*
@@ -102,7 +102,7 @@
* much memory, but that can wait for the second pass.
*/
b->start = buf;
- b->end = b->start + nbyte;
+ b->end = (char *)b->start + nbyte;
*bytes_written = nbyte;
return APR_SUCCESS;
}
Index: src/lib/apr/buckets/ap_rwmem_buf.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/lib/apr/buckets/ap_rwmem_buf.c,v
retrieving revision 1.2
diff -u -r1.2 ap_rwmem_buf.c
--- ap_rwmem_buf.c 2000/07/11 17:28:18 1.2
+++ ap_rwmem_buf.c 2000/07/12 15:45:08
@@ -87,13 +87,13 @@
APR_EXPORT(int) ap_rwmem_get_len(ap_bucket_rwmem *b)
{
- return b->end - b->start;
+ return (char *)b->end - (char *)b->start;
}
/*
* save nbyte bytes to the bucket.
- * Only returns fewer than nbyte if an error ocurred.
- * Returns -1 if no bytes were written before the error ocurred.
+ * Only returns fewer than nbyte if an error occurred.
+ * Returns -1 if no bytes were written before the error occurred.
* It is worth noting that if an error occurs, the buffer is in an unknown
* state.
*/
@@ -114,7 +114,7 @@
* leaving that for a later pass. The basics are presented below, but this
* is horribly broken.
*/
- amt = b->alloc_len - (b->end - b->start);
+ amt = b->alloc_len - ((char *)b->end - (char *)b->start);
total = 0;
if (nbyte > amt) {
/* loop through and write to the disk */
@@ -122,7 +122,7 @@
}
/* now we know that nbyte < b->alloc_len */
memcpy(b->end, buf, nbyte);
- b->end += nbyte;
+ b->end = (char *)b->end + nbyte;
*bytes_written = total + nbyte;
return APR_SUCCESS;
}
Index: src/lib/apr/include/apr_buf.h
===================================================================
RCS file: /cvs/apache/apache-2.0/src/lib/apr/include/apr_buf.h,v
retrieving revision 1.4
diff -u -r1.4 apr_buf.h
--- apr_buf.h 2000/07/11 22:54:16 1.4
+++ apr_buf.h 2000/07/12 15:45:09
@@ -73,7 +73,7 @@
AP_BUCKET_mmap,
AP_BUCKET_filename,
AP_BUCKET_cached_entity,
- AP_BUCKET_URI,
+ AP_BUCKET_URI
} ap_bucket_color_e;
typedef struct ap_bucket ap_bucket;
--
Victor J. Orlikowski v.j.orlikowski@gte.net
vjo@raleigh.ibm.com
vjo@us.ibm.com
Re: [PATCH] Various buckets corrections.
Posted by rb...@covalent.net.
Cool. I'll be committing as soon as I have a clean tree. I have a few
more corrections in this code that I don't want to commit just
yet. Expect this to be committed within a half hour.
Ryan
On Wed, 12 Jul 2000, Victor J. Orlikowski wrote:
> Slight boogs that (rightly) confuse xlC on AIX.
>
> Index: src/lib/apr/buckets/ap_buf.c
> ===================================================================
> RCS file: /cvs/apache/apache-2.0/src/lib/apr/buckets/ap_buf.c,v
> retrieving revision 1.3
> diff -u -r1.3 ap_buf.c
> --- ap_buf.c 2000/07/11 21:33:35 1.3
> +++ ap_buf.c 2000/07/12 15:45:08
> @@ -300,7 +300,7 @@
> b->tail = b->tail->next;
> b->tail->bucket = r;
> }
> - va_end(v);
> + va_end(va);
>
> return n;
> }
> Index: src/lib/apr/buckets/ap_rmem_buf.c
> ===================================================================
> RCS file: /cvs/apache/apache-2.0/src/lib/apr/buckets/ap_rmem_buf.c,v
> retrieving revision 1.1
> diff -u -r1.1 ap_rmem_buf.c
> --- ap_rmem_buf.c 2000/07/11 21:33:35 1.1
> +++ ap_rmem_buf.c 2000/07/12 15:45:08
> @@ -77,7 +77,7 @@
>
> APR_EXPORT(int) ap_rmem_get_len(ap_bucket_rmem *b)
> {
> - return b->end - b->start;
> + return (char *)b->end - (char *)b->start;
> }
>
> /*
> @@ -102,7 +102,7 @@
> * much memory, but that can wait for the second pass.
> */
> b->start = buf;
> - b->end = b->start + nbyte;
> + b->end = (char *)b->start + nbyte;
> *bytes_written = nbyte;
> return APR_SUCCESS;
> }
> Index: src/lib/apr/buckets/ap_rwmem_buf.c
> ===================================================================
> RCS file: /cvs/apache/apache-2.0/src/lib/apr/buckets/ap_rwmem_buf.c,v
> retrieving revision 1.2
> diff -u -r1.2 ap_rwmem_buf.c
> --- ap_rwmem_buf.c 2000/07/11 17:28:18 1.2
> +++ ap_rwmem_buf.c 2000/07/12 15:45:08
> @@ -87,13 +87,13 @@
>
> APR_EXPORT(int) ap_rwmem_get_len(ap_bucket_rwmem *b)
> {
> - return b->end - b->start;
> + return (char *)b->end - (char *)b->start;
> }
>
> /*
> * save nbyte bytes to the bucket.
> - * Only returns fewer than nbyte if an error ocurred.
> - * Returns -1 if no bytes were written before the error ocurred.
> + * Only returns fewer than nbyte if an error occurred.
> + * Returns -1 if no bytes were written before the error occurred.
> * It is worth noting that if an error occurs, the buffer is in an unknown
> * state.
> */
> @@ -114,7 +114,7 @@
> * leaving that for a later pass. The basics are presented below, but this
> * is horribly broken.
> */
> - amt = b->alloc_len - (b->end - b->start);
> + amt = b->alloc_len - ((char *)b->end - (char *)b->start);
> total = 0;
> if (nbyte > amt) {
> /* loop through and write to the disk */
> @@ -122,7 +122,7 @@
> }
> /* now we know that nbyte < b->alloc_len */
> memcpy(b->end, buf, nbyte);
> - b->end += nbyte;
> + b->end = (char *)b->end + nbyte;
> *bytes_written = total + nbyte;
> return APR_SUCCESS;
> }
> Index: src/lib/apr/include/apr_buf.h
> ===================================================================
> RCS file: /cvs/apache/apache-2.0/src/lib/apr/include/apr_buf.h,v
> retrieving revision 1.4
> diff -u -r1.4 apr_buf.h
> --- apr_buf.h 2000/07/11 22:54:16 1.4
> +++ apr_buf.h 2000/07/12 15:45:09
> @@ -73,7 +73,7 @@
> AP_BUCKET_mmap,
> AP_BUCKET_filename,
> AP_BUCKET_cached_entity,
> - AP_BUCKET_URI,
> + AP_BUCKET_URI
> } ap_bucket_color_e;
>
> typedef struct ap_bucket ap_bucket;
>
> --
> Victor J. Orlikowski v.j.orlikowski@gte.net
> vjo@raleigh.ibm.com
> vjo@us.ibm.com
>
_______________________________________________________________________________
Ryan Bloom rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------