Question about unused parameters

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Question about unused parameters

Re: Question about unused parameters

by _mental_ » Sun Nov 05, 2017 7:26 am

OK, cleaned up FStateDefinitions in 2749518 and left GLPortal as is.

Re: Question about unused parameters

by Graf Zahl » Sun Nov 05, 2017 4:38 am

It's not used right now - but it may get used eventually. I'm not sure. The first one in ResolveGotoLabel can be safely changed, though

Re: Question about unused parameters

by _mental_ » Sun Nov 05, 2017 4:16 am

So now doquery can be remove too, right?

Re: Question about unused parameters

by Graf Zahl » Sun Nov 05, 2017 3:46 am

The first one looks like a leftover from early development when states were not accessed by labels but only by the explicit state pointers in AActor.
The second one was used, but not correctly, so when I changed that code I played it safe.

Question about unused parameters

by _mental_ » Sun Nov 05, 2017 2:54 am

I have a question about two compilation warnings reported by GCC 4.9 related to unused function parameters.

The first parameter seems to be redundant as I found no use for it inside the mentioned function and so can safely removed:

Code: Select all

src/p_states.cpp: In member function ‘FState* FStateDefinitions::ResolveGotoLabel(AActor*, PClassActor*, char*)’:
src/p_states.cpp:724:54: warning: parameter ‘actor’ set but not used [-Wunused-but-set-parameter]
 FState *FStateDefinitions::ResolveGotoLabel (AActor *actor, PClassActor *mytype, char *name)
                                                      ^
The second one is more suspicious. From my point of view doquery should be checked somewhere to decide on occlusion query usage:

Code: Select all

src/gl/scene/gl_portal.cpp: In member function ‘bool GLPortal::Start(bool, bool)’:
src/gl/scene/gl_portal.cpp:178:44: warning: parameter ‘doquery’ set but not used [-Wunused-but-set-parameter]
 bool GLPortal::Start(bool usestencil, bool doquery)
                                            ^
While the former is pretty old (I don't expect Randi will come and tell us about it) the latter is relatively new and I hope Graf can give some details about it.

Top