My opinion is that one should not overuse bitfields, especially not for
a such low count usage as stateful helpers..
sateful_helper_reserve_t reserved;
Having the type as an enum is of great benefit when debugging, and
generates much better code than to have it as a bitfield.
Regards
Henrik
Guido Serassio wrote:
>
> Hi Henrik,
>
> After a full debugging day I have finally found the cause of NTLM
> malfunction on Windows.
>
> All seems to comes from some strange behaviour on bit fields in the
> _helper_stateful_server structure, may be a MS VC problem ?
>
> Debugging I have found that when flags.reserved is set to
> S_HELPER_DEFERRED, the real value reported by debugger is -2.
>
> I have tried to change the flags structure in the following manner, and now
> all works.
>
> struct _helper_stateful_flags {
> unsigned int alive:1;
> unsigned int busy:1;
> unsigned int closing:1;
> unsigned int shutdown:1;
> unsigned int reserved:2;
> // stateful_helper_reserve_t reserved:2;
> } flags;
>
> typedef enum {
> S_HELPER_FREE,
> S_HELPER_RESERVED,
> S_HELPER_DEFERRED
> } stateful_helper_reserve_t;
>
> What is Your opinion about ?
>
> Regards
>
> Guido
>
> -
> =======================================================
> Serassio Guido
> Via Albenga, 11/4 10134 - Torino - ITALY
> E-mail: guido.serassio@serassio.it
> WWW: http://www.serassio.it
Received on Thu Apr 25 2002 - 16:11:07 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:15:20 MST