← Back to team overview

kicad-developers team mailing list archive

Re: warning: enum constant in boolean context in dialog_print_generic.cpp

 

Hi Andrew,

Good catch, thank you! I have just pushed your patch to the master branch.

Regards,
Orson

On 11/7/18 6:16 AM, Andrew Lutsenko wrote:
> Hi Orson and KiCad devs,
> 
> During rebuilding current nightly I noticed this warning and decided to
> look into it.
> 
> /usr/local/google/home/alutsenko/src/kicad/common/dialogs/dialog_print_generic.cpp:
> In member function ‘virtual void
> DIALOG_PRINT_GENERIC::onCloseButton(wxCommandEvent&)’:
> /usr/local/google/home/alutsenko/src/kicad/common/dialogs/dialog_print_generic.cpp:246:24:
> warning: enum constant in boolean context [-Wint-in-bool-context]
>      Close( wxID_CANCEL );
>                         ^
> wxWindow::Close takes a boolean as an argument and wxID_CANCEL being not
> zero means this will be interpreted as force close. I don't think this was
> the intended behavior here.
> 
> Please take a look at my simple patch that fixes this warning and (I think)
> a latent bug.
> 
> Regards,
> Andrew Lutsenko
> 


Attachment: signature.asc
Description: OpenPGP digital signature


References