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/26 22:56:54 UTC

[PATCH] Compiler clean-up

xlC (rightly) complains that void *'s may not have things assumed about
them, and forces the cast to char *.

Index: src/lib/apr/network_io/unix/sendrecv.c
===================================================================
RCS file: /cvs/apache/apache-2.0/src/lib/apr/network_io/unix/sendrecv.c,v
retrieving revision 1.27
diff -u -r1.27 sendrecv.c
--- sendrecv.c 2000/06/23 17:14:38 1.27
+++ sendrecv.c 2000/06/26 20:47:35
@@ -485,7 +485,7 @@
 #endif
             ptr = 0;
             for (i = 0; i < hdtr->numheaders; i++) {
-                memcpy(hbuf + ptr, hdtr->headers[i].iov_base,
+                memcpy((char *)hbuf + ptr, hdtr->headers[i].iov_base,
                        hdtr->headers[i].iov_len);
                 ptr += hdtr->headers[i].iov_len;
             }
@@ -511,7 +511,7 @@
 #endif
             ptr = 0;
             for (i = 0; i < hdtr->numtrailers; i++) {
-                memcpy(tbuf + ptr, hdtr->trailers[i].iov_base,
+                memcpy((char *)tbuf + ptr, hdtr->trailers[i].iov_base,
                        hdtr->trailers[i].iov_len);
                 ptr += hdtr->trailers[i].iov_len;
             }



Re: [PATCH] Compiler clean-up

Posted by Greg Stein <gs...@lyra.org>.
I've applied this plus the other compiler error patch.

Cheers,
-g

On Mon, Jun 26, 2000 at 04:56:54PM -0400, Victor J. Orlikowski wrote:
> xlC (rightly) complains that void *'s may not have things assumed about
> them, and forces the cast to char *.
> 
> Index: src/lib/apr/network_io/unix/sendrecv.c
> ===================================================================
> RCS file: /cvs/apache/apache-2.0/src/lib/apr/network_io/unix/sendrecv.c,v
> retrieving revision 1.27
> diff -u -r1.27 sendrecv.c
> --- sendrecv.c 2000/06/23 17:14:38 1.27
> +++ sendrecv.c 2000/06/26 20:47:35
> @@ -485,7 +485,7 @@
>  #endif
>              ptr = 0;
>              for (i = 0; i < hdtr->numheaders; i++) {
> -                memcpy(hbuf + ptr, hdtr->headers[i].iov_base,
> +                memcpy((char *)hbuf + ptr, hdtr->headers[i].iov_base,
>                         hdtr->headers[i].iov_len);
>                  ptr += hdtr->headers[i].iov_len;
>              }
> @@ -511,7 +511,7 @@
>  #endif
>              ptr = 0;
>              for (i = 0; i < hdtr->numtrailers; i++) {
> -                memcpy(tbuf + ptr, hdtr->trailers[i].iov_base,
> +                memcpy((char *)tbuf + ptr, hdtr->trailers[i].iov_base,
>                         hdtr->trailers[i].iov_len);
>                  ptr += hdtr->trailers[i].iov_len;
>              }
> 

-- 
Greg Stein, http://www.lyra.org/