You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dean Gaudet <dg...@arctic.org> on 1997/10/21 06:53:05 UTC
[PATCH] mod_speling 64-bit issues (was Re: Build of apache_19971016130014)
Yeah these (long) casts are how it's worked around elsewhere, but this is
kind of ugly for mod_speling. Try this patch instead.
Dean
On Thu, 16 Oct 1997, Martin Kraemer wrote:
> I'm just curious and didn't look at how the other modules deal with
> an int->pointer casting problem.. Does the appended patch remove the
> warnings for mod_speling?
>
> Martin
>
> On Thu, Oct 16, 1997 at 03:58:59PM -0500, Ben Hyde wrote:
> > mod_speling.c: In function `set_speling':
> > mod_speling.c:94: warning: cast to pointer from integer of different size
> > mod_speling.c: In function `check_speling':
> > mod_speling.c:186: warning: cast from pointer to integer of different size
Index: mod_speling.c
===================================================================
RCS file: /export/home/cvs/apachen/src/modules/standard/mod_speling.c,v
retrieving revision 1.6
diff -u -r1.6 mod_speling.c
--- mod_speling.c 1997/10/20 13:28:02 1.6
+++ mod_speling.c 1997/10/21 04:51:33
@@ -91,11 +91,12 @@
{
void *server_conf = cmd->server->module_config;
- set_module_config(server_conf, &speling_module, (void *) arg);
+ /* any non-NULL pointer means speling is enabled */
+ set_module_config(server_conf, &speling_module, arg ? (void *)&speling_module : NULL);
return NULL;
}
-command_rec speling_cmds[] =
+static command_rec speling_cmds[] =
{
{"CheckSpelling", set_speling, NULL, RSRC_CONF, FLAG,
"whether or not to fix miscapitalized/misspelled requests"},
@@ -183,7 +184,7 @@
struct DIR_TYPE *dir_entry;
array_header *candidates = NULL;
- if (!(int) get_module_config(server_conf, &speling_module))
+ if (!get_module_config(server_conf, &speling_module))
return DECLINED;
/* We only want to worry about GETs */
Re: [PATCH] mod_speling 64-bit issues (was Re: Build of apache_19971016130014)
Posted by Martin Kraemer <Ma...@mch.sni.de>.
+1. That's cleaner than casting.
Martin
--
| S I E M E N S | <Ma...@mch.sni.de> | Siemens Nixdorf
| ------------- | Voice: +49-89-636-46021 | Informationssysteme AG
| N I X D O R F | FAX: +49-89-636-44994 | 81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request