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" <vj...@raleigh.ibm.com> on 2000/06/19 20:24:22 UTC
[PATCH] Compiler warning clean-up....
Index: src/ap/ap_cache.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/ap/ap_cache.c,v
retrieving revision 1.3
diff -u -r1.3 ap_cache.c
--- ap_cache.c 2000/06/12 23:55:11 1.3
+++ ap_cache.c 2000/06/19 18:24:50
@@ -132,11 +132,11 @@
BUFF *place;
char buffer[HUGE_STRING_LEN];
ap_status_t ret = APR_SUCCESS;
- int nbytes, i;
+ ap_size_t nbytes, i, o;
if((ret = ap_cache_el_data(el, &place)) != APR_SUCCESS) return ret;
while(ap_bread(data, buffer, HUGE_STRING_LEN, &nbytes) == APR_SUCCESS
&& nbytes) {
- int o = 0;
+ o = 0;
while(nbytes)
{
ap_bwrite(place, buffer + o, nbytes, &i);
Re: [PATCH] Compiler warning clean-up....
Posted by Jeff Trawick <tr...@ibm.net>.
> Date: Mon, 19 Jun 2000 19:08:42 -0400 (EDT)
> From: "Victor J. Orlikowski" <vj...@raleigh.ibm.com>
>
> Nope. According to include/buff.h
> API_EXPORT(ap_status_t) ap_bread_core(BUFF *fb, void *buf, ap_size_t
> nbyte, ap_ssize_t *bytes_read);
Sorry about the typo.
> So ap_size_t is correct unless the parameters to ap_bread and ap_bwrite
> need changing....
My point (which was obliterated by the typo) was to ponder why the
base type of the third and forth parameters is different. I would
have expected ap_ssize_t and ap_ssize_t * or ap_size_t and ap_size_t *
for these parms. It now follows the convention of read() and write(),
but then read() and write() have to be able to store a negative value
in their ssize_t return value, whereas ap_bread() and ap_bwrite()
don't have to be able to store a negative value in their ap_ssize_t
return parameter....
Can anybody explain the difference?
--
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
http://www.geocities.com/SiliconValley/Park/9289/
Born in Roswell... married an alien...
Re: [PATCH] Compiler warning clean-up....
Posted by "Victor J. Orlikowski" <vj...@raleigh.ibm.com>.
Nope. According to include/buff.h
API_EXPORT(ap_status_t) ap_bread_core(BUFF *fb, void *buf, ap_size_t
nbyte, ap_ssize_t *bytes_read);
So ap_size_t is correct unless the parameters to ap_bread and ap_bwrite
need changing....
Victor
Re: [PATCH] Compiler warning clean-up....
Posted by Jeff Trawick <tr...@ibm.net>.
> Date: Mon, 19 Jun 2000 14:24:22 -0400 (EDT)
> From: "Victor J. Orlikowski" <vj...@raleigh.ibm.com>
>
> Index: src/ap/ap_cache.c
> ===================================================================
> RCS file: /cvs/apache/apache-2.0/src/ap/ap_cache.c,v
> retrieving revision 1.3
> diff -u -r1.3 ap_cache.c
> --- ap_cache.c 2000/06/12 23:55:11 1.3
> +++ ap_cache.c 2000/06/19 18:24:50
> @@ -132,11 +132,11 @@
> BUFF *place;
> char buffer[HUGE_STRING_LEN];
> ap_status_t ret = APR_SUCCESS;
> - int nbytes, i;
> + ap_size_t nbytes, i, o;
ap_ssize_t right? but this brings up the question of why the parms to
ap_bread() and ap_bwrite x,y,ap_ssize_t,ap_ssize_t *..
>
> if((ret = ap_cache_el_data(el, &place)) != APR_SUCCESS) return ret;
> while(ap_bread(data, buffer, HUGE_STRING_LEN, &nbytes) == APR_SUCCESS
> && nbytes) {
> - int o = 0;
> + o = 0;
> while(nbytes)
> {
> ap_bwrite(place, buffer + o, nbytes, &i);
--
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
http://www.geocities.com/SiliconValley/Park/9289/
Born in Roswell... married an alien...