On 5/12/21 5:36 PM, Yann Ylavic wrote:
> On Wed, May 12, 2021 at 4:35 PM Ruediger Pluem <[email protected]> wrote:
>>
>> On 5/12/21 12:10 PM, [email protected] wrote:
>>>
>>> +static const char * proxyws_fallback_to_proxy_http(cmd_parms *cmd, void 
>>> *conf, int arg)
>>> +{
>>> +    proxyws_dir_conf *dconf = conf;
>>> +    dconf->fallback_to_proxy_http = !!arg;
>>
>> Why !!? Shouldn't just arg be enough?
> 
> That's because fallback_to_proxy_http is a bit (i.e. unsigned int :1),
> and !!arg is guaranteed to be 0 or 1 (I could have used arg != 0 too).
> For instance dconf->fallback_to_proxy_http = 2 wouldn't work as
> expected, maybe arg is always 0 or 1 but some compilers warn with
> -Woverflow here anyway.

Thanks for explaining. Maybe a short comment in the code about this would save 
some head scratching for future code readers :-)

Regards

RĂ¼diger

Reply via email to