httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Stoddard <redd...@ibm.net>
Subject Type casting int to pointer and back again
Date Wed, 28 Oct 1998 02:16:29 GMT
The cmd_data field in command_rec (http_config.c) is declared as a
void*.   In all cases I am aware of, cmd_data is used as an int (see
DirectoryMatch directive in http_core.c, for example).  This is making
getting a clean port to AS/400 a real pain in the butt because ints and
pointers have different sizes and the compiler does not allow casting an
int to a pointer (casting a pointer to an int is okay).  Regardless of
the AS/400 problems,  using pointers and ints interchangeably is not
good form and we should change it, IMO.

One solution would be to change the void * to an int. This solution is
more restrictive (only have an int to play with, not a struct) and would
break any third party modules that use cmd_data as a pointer. A  better
solution might be to keep cmd_data as a void* and make changes to
http_core to use the field as a pointer (to ints). Thoughts?

Bill Stoddard
stoddard@raleigh.ibm.com




Mime
View raw message