From a56f1ca1ed63b93eb61fd5319f47347b3eb1e364 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sat, 17 Aug 2013 12:18:22 -0400 Subject: Cleanup MV/MD macros a little. When using variadic macros there's no need for IF_MD2/IF_MV2 to deal with function parameters. IF_MD/IF_MV are enough. Throw in IF_MD_DRV/ID_MV_VOL that return the parameter if MD/MV, or 0 if not. Change-Id: I7605e6039f3be19cb47110c84dcb3c5516f2c3eb --- firmware/export/mv.h | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'firmware/export/mv.h') diff --git a/firmware/export/mv.h b/firmware/export/mv.h index b1d16a7267..b1c8a83008 100644 --- a/firmware/export/mv.h +++ b/firmware/export/mv.h @@ -27,27 +27,28 @@ /* FixMe: These macros are a bit nasty and perhaps misplaced here. We'll get rid of them once decided on how to proceed with multivolume. */ -/* Drives are things like a disk, a card, a flash chip. They can have volumes on them */ +/* Drives are things like a disk, a card, a flash chip. They can have volumes + on them */ #ifdef HAVE_MULTIDRIVE -#define IF_MD(x) x /* optional drive parameter */ -#define IF_MD2(x,y) x,y /* same, for a list of arguments */ -#define IF_MD_NONVOID(x) x /* for prototype with sole volume parameter */ +#define IF_MD(x...) x /* valist contents or empty */ +#define IF_MD_NONVOID(x...) x /* valist contents or 'void' */ +#define IF_MD_DRV(d) d /* drive argument or '0' */ #else /* empty definitions if no multi-drive */ -#define IF_MD(x) -#define IF_MD2(x,y) -#define IF_MD_NONVOID(x) void +#define IF_MD(x...) +#define IF_MD_NONVOID(x...) void +#define IF_MD_DRV(d) 0 #endif /* Volumes mean things that have filesystems on them, like partitions */ #ifdef HAVE_MULTIVOLUME -#define IF_MV(x) x /* optional volume parameter */ -#define IF_MV2(x,y) x,y /* same, for a list of arguments */ -#define IF_MV_NONVOID(x) x /* for prototype with sole volume parameter */ +#define IF_MV(x...) x /* valist contents or empty */ +#define IF_MV_NONVOID(x...) x /* valist contents or 'void' */ +#define IF_MV_VOL(v) v /* volume argument or '0' */ #else /* empty definitions if no multi-volume */ -#define IF_MV(x) -#define IF_MV2(x,y) -#define IF_MV_NONVOID(x) void +#define IF_MV(x...) +#define IF_MV_NONVOID(x...) void +#define IF_MV_VOL(v) 0 #endif -#endif +#endif /* __MV_H__ */ -- cgit v1.2.3