Thanks, Manolo, that's exactly what I found out yesterday, but I
couldn't post my results due to other work.
I agree that we can rename the variable to another name with underscore,
but while we're doing this I also suggest to use a better, more
descriptive name as the OP mentioned.
I tried to refactor the code yesterday, using the name 'flx' (which
stands for 'a pointer to an instance of Fl_X') and my code is almost
ready to commit. I used 'flx' also because this variable name was not
used anywhere else, hence it should be easy to change it to something
even better, it was just a proof of concept. I did, however, not (yet)
add the underscore.
My hopefully final proposal would be to change the variable name to
'flx_' (with trailing underscore) and I'm willing to continue this work.
Better proposals would be appreciated.
I compiled my changes successfully on Linux and Windows but I'd need
help for testing on MacOS (and, to make it all complete, on Android,
with the SDL and pico drivers, etc). I can post a diff or add a test
branch in my FLTK fork for everybody to test.
The next step (already included in my code) would be to "rename" the
method Fl_X::i() to Fl_X::flx() or a corresponding name as well. I think
we can easily do this but keep the old Fl_X::i() as deprecated in FLTK
1.4 for backwards compatibility and remove it in FLTK 1.5 or any later
Notes to the OP (Remy) and others:
(1) IMHO the Microsoft warning "declaration of 'i' hides class member
... 'Fl_Window::i'" is questionable or even wrong. How can a variable in
an outer scope (class Example) hide a private member in an inner scope
(Fl_Window) that is NOT VISIBLE in the outer scope (Example)? But, given
our CMP, that's not important and we should rename it anyway. Thanks for
(2) The other Fl_Window private class members and the "shadowing"
warnings are similar (minw, minh, maxw, maxh, dw, dh). Although the same
as in (1) applies I think we should rename them as well (adding the
(3) "warning C4244" is a known issue but benign and nobody found the
time to fix it. We could add some casts that would likely remove the
warnings but this would make the code longer and ugly. Anyway, it might
be done if someone could find the time to do it. Patches (valid for all
platforms!) always welcome...