httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pavel Novy <n...@feld.cvut.cz>
Subject Re: [PATCH] Apache 1.3.21-dev for NetWare builds (5)
Date Tue, 28 Aug 2001 11:11:02 GMT
Hi,

Greg Stein wrote:

>On Mon, Aug 27, 2001 at 04:08:25PM +0200, Pavel Novy wrote:
>
>>...
>>I agree this is an undesirable way for bitfields to be aligned, but this
>>agrees with MSVC, upon which we based the bitfield layout.  (In MSVC the
>>smallest we can make the struct is 4 bytes!)
>>
>>I think the way to work around this is to change the bitfield base type to
>>"unsigned char".  The type of the bitfield is used in determining how it is
>>aligned; thus, using a smaller type will require a smaller alignment.
>>...
>>--- util_uri.h.orig	Mon Feb 26 16:49:32 2001
>>+++ util_uri.h	Mon Aug 27 15:44:41 2001
>>@@ -106,10 +106,10 @@
>> 
>>     unsigned short port;	/* The port number, numeric, valid only if port_str != NULL
*/
>>     
>>-    unsigned is_initialized:1;
>>+    unsigned char is_initialized:1;
>> 
>>-    unsigned dns_looked_up:1;
>>-    unsigned dns_resolved:1;
>>+    unsigned char dns_looked_up:1;
>>+    unsigned char dns_resolved:1;
>> 
>> } uri_components;
>>
>
>
>Screw the bitfields. Just change all of them to plain old unsigned chars.
>(and apr_byte_t in APR). There is no reason to be miserly with bits here.
>
>Cheers,
>-g
>
I agree, but the proposed change was designed to not affect 
sizeof(uri_components) on other platforms then NetWare. It's not a good 
idea to invoke unwanted compatibility issues on those platforms. After 
change, the bitfield still occupies one byte (on Linux aligned to 2 
bytes, on NetWare to 1 byte).

Regards,
Pavel



Mime
View raw message