[Addressed] Question about unused parameters

Bugs that have been investigated and resolved somehow.

Moderators: Developers, ZDoom.org Team

Question about unused parameters

Postby _mental_ » Sun Nov 05, 2017 3: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 allExpand view
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 allExpand view
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.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Question about unused parameters

Postby Graf Zahl » Sun Nov 05, 2017 4: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.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Question about unused parameters

Postby _mental_ » Sun Nov 05, 2017 5:16 am

So now doquery can be remove too, right?
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Question about unused parameters

Postby Graf Zahl » Sun Nov 05, 2017 5: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
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Question about unused parameters

Postby _mental_ » Sun Nov 05, 2017 8:26 am

OK, cleaned up FStateDefinitions in 2749518 and left GLPortal as is.
_mental_
 
 
 
Joined: 07 Aug 2011


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 1 guest