httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: cvs commit: apache-1.3/src/modules/experimental mod_mmap_static.c
Date Sun, 05 Apr 1998 21:32:44 GMT
This is bogus.  This is a redundant cast not required by ANSI C.  It's
required by C++.  Maybe some compilers complain, but they're broken in my
opinion...

My guess (I haven't read Ben Hyde's build report in detail yet) is that
it's a prototype problem, and the bsearch on that system takes a char *
and returns a char *.  Which of course isn't ANSI either :)

Dean

On 4 Apr 1998 rse@hyperreal.org wrote:

> rse         98/04/04 04:48:09
> 
>   Modified:    src/modules/experimental mod_mmap_static.c
>   Log:
>   Fix two GCC warnings "assignment from incompatible pointer type", because
>   bsearch is "void *", it is ok to cast it to the correct type of the variable
>   we assign its return value to.
>   
>   Revision  Changes    Path
>   1.6       +2 -2      apache-1.3/src/modules/experimental/mod_mmap_static.c
>   
>   Index: mod_mmap_static.c
>   ===================================================================
>   RCS file: /export/home/cvs/apache-1.3/src/modules/experimental/mod_mmap_static.c,v
>   retrieving revision 1.5
>   retrieving revision 1.6
>   diff -u -r1.5 -r1.6
>   --- mod_mmap_static.c	1998/03/31 12:52:58	1.5
>   +++ mod_mmap_static.c	1998/04/04 12:48:08	1.6
>   @@ -287,7 +287,7 @@
>        }
>        sconf = get_module_config(r->server->module_config, &mmap_static_module);
>        tmp.filename = r->filename;
>   -    match = bsearch(&tmp, sconf->files->elts, sconf->files->nelts,
>   +    match = (a_file *)bsearch(&tmp, sconf->files->elts, sconf->files->nelts,
>    	sizeof(a_file), file_compare);
>        if (match == NULL) {
>    	return DECLINED;
>   @@ -318,7 +318,7 @@
>        tmp.finfo.st_dev = r->finfo.st_dev;
>        tmp.finfo.st_ino = r->finfo.st_ino;
>        ptmp = &tmp;
>   -    pmatch = bsearch(&ptmp, sconf->inode_sorted->elts,
>   +    pmatch = (a_file **)bsearch(&ptmp, sconf->inode_sorted->elts,
>    	sconf->inode_sorted->nelts, sizeof(a_file *), inode_compare);
>        if (pmatch == NULL) {
>    	return DECLINED;
>   
>   
>   
> 


Mime
View raw message