basic/strv: introduce STRV_IGNORE macro (#3601)

to hide casting of '-1' strings and make code cleaner.
This commit is contained in:
0xAX
2016-06-27 23:26:07 +02:00
committed by Martin Pitt
parent 2027927b10
commit f9d14060ae
2 changed files with 8 additions and 6 deletions
+3 -1
View File
@@ -69,8 +69,10 @@ bool strv_equal(char **a, char **b);
char **strv_new(const char *x, ...) _sentinel_;
char **strv_new_ap(const char *x, va_list ap);
#define STRV_IGNORE ((const char *) -1)
static inline const char* STRV_IFNOTNULL(const char *x) {
return x ? x : (const char *) -1;
return x ? x : STRV_IGNORE;
}
static inline bool strv_isempty(char * const *l) {