Page MenuHomePhabricator

Merge #12928: qt: Initialize non-static class members that were previously neither initialized where defined nor in constructor
ClosedPublic

Authored by nakihito on Aug 22 2019, 17:02.

Details

Summary

3fdc5fe Make sure initialization occurs in the constructor (practicalswift)
1e7813e Remove redundant initializations from the constructor (practicalswift)
f131872 Initialize non-static class members where they are defined (practicalswift)
73bc1b7 Initialize editStatus and autoCompleter. Previously not initialized where defined or in constructor. (practicalswift)

Pull request description:

Initialize variables previously neither defined where defined nor in constructor:
* `editStatus`
* `autoCompleter`

Also; initialize non-static class members where they are defined in accordance with developer notes.

Tree-SHA512: 84f0cb87ec8394ed7641bfa0731be2ec72e6a920e00ae206ff89e2e7c960358f603c52878311b24601a33aa7cba6ea4f9a78a8ade88112dea0f41efb08e84e25

Backport of Core PR12928
https://github.com/bitcoin/bitcoin/pull/12928/

Test Plan
make check
test_runner.py
./bitcoin-qt

Diff Detail

Repository
rABC Bitcoin ABC
Branch
PR12928
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 7227
Build 12499: Bitcoin ABC Buildbot (legacy)
Build 12498: arc lint + arc unit

Event Timeline

Owners added a reviewer: Restricted Owners Package.Aug 22 2019, 17:02
Fabien requested changes to this revision.Aug 23 2019, 14:11

There's a typo in the PR number

src/qt/addresstablemodel.h
108

Style nit: const WalletModel *walletModel;

src/qt/rpcconsole.h
153

Dito

156

This one make me bug. It is not a pointer despite what the name implies (it's an index), and it should be size_t and not int; but it's out of scope here.

159

Dito

This revision now requires changes to proceed.Aug 23 2019, 14:11
src/qt/addresstablemodel.h
108

I think these are meant to be as they are. Rather than making the data pointed to unchangeable, it is making the address unchangeable. See: https://www.cprogramming.com/tutorial/const_correctness.html. The discussion and review of the change also specifically requests <type> *const <name>.

nakihito requested review of this revision.Sep 6 2019, 17:14
Fabien added inline comments.
src/qt/addresstablemodel.h
108

Yeah you're obviously right, my bad

This revision is now accepted and ready to land.Sep 9 2019, 09:24