diff options
author | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-11-24 15:15:43 -0200 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-11-24 15:15:43 -0200 |
commit | 26ce0b163d9cf44ec1bc1d1bd460887aa5b405a7 (patch) | |
tree | 5063cb22f76ece5925f2bbfa6713f978715b770a /src/smi.h | |
parent | 2057d7ae05ef269f75a4d53fe5c4914a10856cb1 (diff) |
Use a single debug macro for leaving functions.
The LEAVE() macro, when debug is disabled, now is defined as:
<hash>define LEAVE(...) return __VA_ARGS__
This avoids the requirement of a return statement after the LEAVE()
macro call, what can be confusing.
Diffstat (limited to 'src/smi.h')
-rw-r--r-- | src/smi.h | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -291,20 +291,17 @@ extern int smi_indent; # define VERBLEV 1 # define ENTER() xf86ErrorFVerb(VERBLEV, "%*c %s\n",\ smi_indent++, '>', __FUNCTION__) -# define LEAVE() xf86ErrorFVerb(VERBLEV, "%*c %s\n",\ - --smi_indent, '<', __FUNCTION__) -# define RETURN(value) \ +# define LEAVE(value) \ do { \ xf86ErrorFVerb(VERBLEV, "%*c %s\n", \ --smi_indent, '<', __FUNCTION__); \ - return (value); \ + return __VA_ARGS__; \ } while (0) # define DEBUG(...) xf86ErrorFVerb(VERBLEV, __VA_ARGS__) #else # define VERBLEV 4 # define ENTER() /**/ -# define LEAVE() /**/ -# define RETURN(value) return (value) +# define LEAVE(...) return __VA_ARGS__ # define DEBUG(...) /**/ #endif |