Question about unused parameters

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

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 Reply
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Question about unused parameters

Post by _mental_ »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Question about unused parameters

Post by Graf Zahl »

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.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Question about unused parameters

Post by _mental_ »

So now doquery can be remove too, right?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Question about unused parameters

Post by Graf Zahl »

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
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Question about unused parameters

Post by _mental_ »

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

Return to “Closed Bugs [GZDoom]”