Re: [Kicad-developers] warning: enum constant in boolean context in dialog_print_generic.cpp

2018-11-07 Thread Maciej Sumiński
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
> 




signature.asc
Description: OpenPGP digital signature
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


[Kicad-developers] warning: enum constant in boolean context in dialog_print_generic.cpp

2018-11-06 Thread Andrew Lutsenko
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
From b4ee7b53c30ef5ea273b1c77b40b5b79ea9f0ea6 Mon Sep 17 00:00:00 2001
From: qu1ck 
Date: Tue, 6 Nov 2018 21:14:01 -0800
Subject: [PATCH] Fix warning in dialog_print_generic.cpp

---
 common/dialogs/dialog_print_generic.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/dialogs/dialog_print_generic.cpp b/common/dialogs/dialog_print_generic.cpp
index affa2937a..d5313de82 100644
--- a/common/dialogs/dialog_print_generic.cpp
+++ b/common/dialogs/dialog_print_generic.cpp
@@ -243,7 +243,7 @@ void DIALOG_PRINT_GENERIC::onCloseButton( wxCommandEvent& event )
 if( IsModal() )
 EndModal( wxID_CANCEL );
 
-Close( wxID_CANCEL );
+Close();
 }
 
 
-- 
2.19.1.930.g4563a0d9d0-goog

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp