pingus-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pingus-CVS] CVS: Games/Pingus/src/gui gui_manager.cxx,1.9,1.10


From: Ingo Ruhnke
Subject: Re: [Pingus-CVS] CVS: Games/Pingus/src/gui gui_manager.cxx,1.9,1.10
Date: 15 Aug 2002 16:10:18 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

address@hidden writes:

>  GUIManager::add (Component* c, bool delete_component) 
>  { 
>    components.push_back(c); 
> +  if(delete_component);
>  }

I find these empty 'if's rather ugly. We should probally replace them
with something like:

#define UNUSED_ARGUMENT (x) (void)(x)

#define UNUSED_ARGUMENT (x) if(x);else;

#ifdef GCC
#define UNUSED_ARGUMENT (x) __attribute__ ((unused)) x
#endif

or what ever the compiler likes most.

The last one could be used like:

void foobar (float x, int UNUSED_ARGUMENT (y))... 

while the other ones would be placed in the function body:

void foobar (float x, int y) {
        UNUSED_ARGUMENT (y);
        ...
}

Not sure if windows provides something simalar to the __attribute__
thing of GCC.

-- 
WWW:      http://pingus.seul.org/~grumbel/ 
Games:    http://pingus.seul.org/~grumbel/gamedesigns/
JabberID: address@hidden 
ICQ:      59461927




reply via email to

[Prev in Thread] Current Thread [Next in Thread]