From new-httpd-owner-new-httpd-archive=hyperreal.org@apache.org Wed Oct 28 02:14:49 1998 Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 11445 invoked by uid 6000); 28 Oct 1998 02:14:48 -0000 Received: (qmail 11436 invoked from network); 28 Oct 1998 02:14:46 -0000 Received: from out2.ibm.net (165.87.194.229) by taz.hyperreal.org with SMTP; 28 Oct 1998 02:14:46 -0000 Received: from raleigh.ibm.com (slip129-37-129-65.wa.us.ibm.net [129.37.129.65]) by out2.ibm.net (8.8.5/8.6.9) with ESMTP id CAA149400 for ; Wed, 28 Oct 1998 02:14:37 GMT Message-ID: <36367E7D.9E33D568@raleigh.ibm.com> Date: Tue, 27 Oct 1998 21:16:29 -0500 From: Bill Stoddard X-Mailer: Mozilla 4.06 [en] (WinNT; U) MIME-Version: 1.0 To: new-httpd@apache.org Subject: Type casting int to pointer and back again Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org 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