|
|
While there's no warnings for me in VS 2017, looks like there's three warnings VS 2019. Not sure what to do about it ...
It's common to cast a pointer (void *) to (fl_intptr_t ) and then to (int) or (long) . You can find this a lot in our code, particularly with userdata stuff. The correct (but ugly) solution would IMHO be:
void setlevel(Fl_Widget*, void *value) {setlevel(int(fl_intptr_t(value)));}
void choosefract(Fl_Widget*, void *value) {choosefract(int(fl_intptr_t(value)));}
void handlemenu(Fl_Widget*, void *value) {handlemenu(int(fl_intptr_t(value)));}
I believe (IIRC) in C code you have to use the IMHO even uglier code like handlemenu((int)(fl_intptr_t)value) but in C++ you have both choices - although the latter expresses the cast more clearly rather than looking like a function call. I think it's a matter of taste.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
[ Direct Link to Message ] | |
|
| |