-
Notifications
You must be signed in to change notification settings - Fork 36.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not shadow member variables #8109
Conversation
ConceptACK.
|
Concept ACK for both |
Using varIn is more consistent with the rest of the codebase, I think, but no strong opinion either way. |
Meh, doing x(x) where x is an argument as well as a member variable is valid c++. |
@laanwj Sure, but...? It is valid C++ but can hide problems. But I do not have a problem when we say we do not need/want |
@paveljanik Yes, sorry, with the context (#8105) this makes sense. You should mention that. Out-of-context this seemed like just a bit of playing with coding style. |
No problem, my fault. I'll add a link to the first comment here. |
utACK 06363466052bfac13849e65c76333e8d3a1fdf27 |
Thinking more about it, we should use the style used "around" the code... |
I slightly prefer Is this enough to allow enabling the |
We use shadowing in many files. You can see a preview/WIP here: This is not doable (or at least reviewable) in one PR IMO. |
Whoa. That is kind of scary much, looks like a lot more work than I estimated it as. To be honest I don't know how to handle a code change on that scale sanely. But as the changes are all similar, I do still think it's less overhead to review in one go, than having 100 pulls that change this for one class at a time. |
I can group pieces together in say 5 PRs. But still, this is not completely solved yet or some changes are too intrusive. And this is not needed to fix immediately. Thus I'd prefer separate PRs (with the help from others/part maintainers). And yes, I too don't know how to handle a code change on that scale sanely. But what I know exactly is I do not want to do that in one PR ;-) |
For something like this it'd be ideal to be able to do it mechanically and deterministically. Otherwise, I agree, the best possibly is probably separate commits for separate parts of the code (GUI, RPC, etc). |
This can't be done automatically, because there could be BUGS in the code, initialize shadowing, shadowing local variables etc. In some cases, the fix can be removed line... |
BUGS! |
0636346
to
4bf69f3
Compare
While investigating the groups of related changes, I have found one more related to HTTP interface thus I added it here. |
4bf69f3
to
c9cf1b9
Compare
Sure, though I think fixing BUGS should be separate from the pure refactoring step, which may make these BUGS apparent. |
c9cf1b9 gives the same binaries as c9cf1b9~1, so I am assuming there are no BUGS added nor any BUGS removed. utACK c9cf1b9 |
utACK c9cf1b9de9346540cd8730e9a4111eaafb51ecd8 |
c9cf1b9
to
ff8d279
Compare
Rebased. |
utACK ff8d279 (gives same binaries, so likely no BUGS) |
ff8d279 Do not shadow member variables (Pavel Janík)
ff8d279 Do not shadow member variables (Pavel Janík)
ff8d279 Do not shadow member variables (Pavel Janík)
ff8d279 Do not shadow member variables (Pavel Janík)
I'm working on enabling
-Wshadow
in our builds (#8105).This is a test. Do we prefer changes like this? Or different name changes (like
req
->reqIn
instead of_req
)? Both styles are used in the source...