Skip to content

Conversation

paveljanik
Copy link
Contributor

As requested by @laanwj in #8105, Qt shadowing changes all-in-one.

Maintainers allowed to edit.

@laanwj
Copy link
Member

laanwj commented Sep 22, 2016

Awesome, will check.

@paveljanik
Copy link
Contributor Author

Please note that many places could be rewritten to use member initializers. And on many places, the diff can be shortened by rewriting initialization process, simplifying this-> stuff and co. But this was not the goal here...

@laanwj
Copy link
Member

laanwj commented Sep 22, 2016

Right, the goal is easy review and checking, as well as being able to enable those warnings by default after this.

Copy link
Member

@laanwj laanwj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Binaries match

f1916a25418f7a2dac48f142fb56466e6c2d68197f8f1787b68317c1ec62d281  /tmp/compare/bitcoind.26b370a
dff7a8d163c1543fe4044b1bc2e70af1d4fa3d3bc2b8b9ded0635b312c7d1534  /tmp/compare/bitcoind.26b370a.stripped
f1916a25418f7a2dac48f142fb56466e6c2d68197f8f1787b68317c1ec62d281  /tmp/compare/bitcoind.eec927e
dff7a8d163c1543fe4044b1bc2e70af1d4fa3d3bc2b8b9ded0635b312c7d1534  /tmp/compare/bitcoind.eec927e.stripped

@laanwj
Copy link
Member

laanwj commented Sep 22, 2016

Eh, oops I checked the bitcoind binary while this relates to bitcoin-qt, need to recheck.
Ignore the above approval for now (I don't think I can delete it).

@laanwj
Copy link
Member

laanwj commented Sep 22, 2016

My binary comparator finds differences in the following functions:

0000000000000000 <WalletModel::WalletModel(PlatformStyle const*, CWallet*, OptionsModel*, QObject*)>:
0000000000000000 <WalletView::WalletView(PlatformStyle const*, QWidget*)>:
0000000000000000 <BitcoinGUI::BitcoinGUI(PlatformStyle const*, NetworkStyle const*, QWidget*)>:
0000000000000000 <EditAddressDialog::EditAddressDialog(EditAddressDialog::Mode, QWidget*)>:
0000000000000000 <AskPassphraseDialog::AskPassphraseDialog(AskPassphraseDialog::Mode, QWidget*)>:
0000000000000000 <AddressTableModel::AddressTableModel(CWallet*, WalletModel*)>:
0000000000000000 <SignVerifyMessageDialog::SignVerifyMessageDialog(PlatformStyle const*, QWidget*)>:
0000000000000000 <AddressBookPage::AddressBookPage(PlatformStyle const*, AddressBookPage::Mode, AddressBookPage::Tabs, QWidget*)>:
0000000000000000 <PlatformStyle::PlatformStyle(QString const&, bool, bool, bool)>:
0000000000000000 <SendCoinsEntry::SendCoinsEntry(PlatformStyle const*, QWidget*)>:
0000000000000000 <RPCConsole::RPCConsole(PlatformStyle const*, QWidget*)>:

These are just the constructors, even empty ones. I don't see why, it may have something to do with Qt's moc generating different metadata?

ut/code review ACK 46b15bb

Edit: new commit removes two functions from the list

@maflcko
Copy link
Member

maflcko commented Sep 22, 2016

Would be interesting to know why the binaries don't match for qt. Encountered the same here: #8658 (comment)

@paveljanik
Copy link
Contributor Author

The difference cause by this PR is probably different from the difference caused by #8658.

In this PR, the change in 46b15bb illustrates the reason. Technically it does the same, but compiler has two places where to get the value used (member variable initialized from the argument or the argument itself).

@laanwj
Copy link
Member

laanwj commented Sep 22, 2016

@MarcoFalke yes we figured it out on IRC: it has to do with name binding, using the argument versus member variable it was assigned to. For example this seems to make the differences in AddressBookPage::AddressBookPage go away: http://www.hastebin.com/jixoyufuxu.patch .

But that's kind of ugly. So in this case I prefer slightly different executables to larger source code patch that makes the code uglier. If it was consensus code it'd be different.

@laanwj laanwj force-pushed the 20160922_Wshadow_qt branch from 46b15bb to f839350 Compare September 23, 2016 10:43
@laanwj
Copy link
Member

laanwj commented Sep 23, 2016

Squashed the squashme commit.

@laanwj laanwj merged commit f839350 into bitcoin:master Sep 23, 2016
laanwj added a commit that referenced this pull request Sep 23, 2016
f839350 Do not shadow in src/qt (Pavel Janík)
codablock pushed a commit to codablock/dash that referenced this pull request Jan 11, 2018
f839350 Do not shadow in src/qt (Pavel Janík)
andvgal pushed a commit to energicryptocurrency/gen2-energi that referenced this pull request Jan 6, 2019
f839350 Do not shadow in src/qt (Pavel Janík)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants