Click here to Skip to main content
15,912,475 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: thanks Pin
sam_psycho28-Jan-09 17:10
sam_psycho28-Jan-09 17:10 
AnswerRe: thanks Pin
CPallini28-Jan-09 21:04
mveCPallini28-Jan-09 21:04 
JokeRe: thanks Pin
Hamid_RT29-Jan-09 0:48
Hamid_RT29-Jan-09 0:48 
JokeRe: thanks Pin
CPallini29-Jan-09 2:17
mveCPallini29-Jan-09 2:17 
Questionthanks Pin
arad.moradi28-Jan-09 10:19
arad.moradi28-Jan-09 10:19 
AnswerRe: thanks Pin
jeron128-Jan-09 11:11
jeron128-Jan-09 11:11 
AnswerRe: thanks Pin
David Crow28-Jan-09 16:46
David Crow28-Jan-09 16:46 
QuestionManaging unused function/method parameters... Pin
Maximilien28-Jan-09 5:57
Maximilien28-Jan-09 5:57 
(feels like a "Stack Overflow" question)

In my quest to put all warnings as errors and clean up the code,
How do you manage and deal with unused parameters in functions and methods ?

There are times when we could refactor the method to completely remove the parameter if it's never used (for example in legacy code)

Other instances, for example handler for windows messages where the parameters are not used :
LRESULT MyHandler( WPARAM wParam, LPARAM lParam );


do you keep the parameters and put them in comments

LRESULT MyHandler( WPARAM /*wParam*/, LPARAM /*lParam*/ );


or remove the parameters :

LRESULT MyHandler( WPARAM , LPARAM );


or use a macro to mark the parameters as unused ?
#ifdef _DEBUG
#define UNUSED(x)
#else
#define UNUSED(x) x
#endif

LRESULT MyClass::MyHandler( WPARAM wParam, LPARAM lParam )
{
  UNUSED( wParam );
  UNUSED( lParam );
}


or simply ignore the warning in the projets's settings ?

Thanks.

Max.

This signature was proudly tested on animals.

AnswerRe: Managing unused function/method parameters... Pin
Stuart Dootson28-Jan-09 7:13
professionalStuart Dootson28-Jan-09 7:13 
AnswerRe: Managing unused function/method parameters... Pin
C Change28-Jan-09 9:40
C Change28-Jan-09 9:40 
AnswerRe: Managing unused function/method parameters... Pin
David Crow28-Jan-09 16:47
David Crow28-Jan-09 16:47 
AnswerRe: Managing unused function/method parameters... Pin
SandipG 28-Jan-09 20:02
SandipG 28-Jan-09 20:02 
QuestionHow to view COLORREF Array into Static Box? Pin
Khathar28-Jan-09 2:46
Khathar28-Jan-09 2:46 
AnswerRe: How to view COLORREF Array into Static Box? Pin
Nishad S28-Jan-09 3:13
Nishad S28-Jan-09 3:13 
QuestionEM_EXSTSEL & EM_SETCHARFORMAT problem ??? Pin
ForNow28-Jan-09 2:40
ForNow28-Jan-09 2:40 
AnswerRe: EM_EXSTSEL & EM_SETCHARFORMAT problem ??? Pin
Code-o-mat28-Jan-09 4:24
Code-o-mat28-Jan-09 4:24 
AnswerRe: EM_EXSTSEL & EM_SETCHARFORMAT problem ??? Pin
Stuart Dootson28-Jan-09 4:30
professionalStuart Dootson28-Jan-09 4:30 
GeneralRe: EM_EXSTSEL & EM_SETCHARFORMAT problem ??? Pin
ForNow28-Jan-09 6:24
ForNow28-Jan-09 6:24 
QuestionTCHAR to const char*? Pin
sam_psycho28-Jan-09 1:47
sam_psycho28-Jan-09 1:47 
QuestionRe: TCHAR to const char*? Pin
«_Superman_»28-Jan-09 2:00
professional«_Superman_»28-Jan-09 2:00 
AnswerRe: TCHAR to const char*? Pin
sam_psycho28-Jan-09 2:08
sam_psycho28-Jan-09 2:08 
GeneralRe: TCHAR to const char*? Pin
Malli_S28-Jan-09 2:21
Malli_S28-Jan-09 2:21 
AnswerRe: TCHAR to const char*? Pin
CPallini28-Jan-09 2:21
mveCPallini28-Jan-09 2:21 
AnswerRe: TCHAR to const char*? Pin
Cedric Moonen28-Jan-09 2:40
Cedric Moonen28-Jan-09 2:40 
QuestionDisplay Format Text into a control Pin
manoharbalu28-Jan-09 0:43
manoharbalu28-Jan-09 0:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.