introduce a tobool(cond) abstraction¹ and switch bool to char if !stdbool.h
① currently: ((cond) ? true : false) but (!!(cond)) and casting to bool, the latter only if stdbool.h, would also work – which performs best on (and across) all supported systems?
This commit is contained in:
4
misc.c
4
misc.c
@@ -29,7 +29,7 @@
|
||||
#include <grp.h>
|
||||
#endif
|
||||
|
||||
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.152 2011/03/05 21:43:17 tg Exp $");
|
||||
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.153 2011/03/07 20:30:39 tg Exp $");
|
||||
|
||||
/* type bits for unsigned char */
|
||||
unsigned char chtypes[UCHAR_MAX + 1];
|
||||
@@ -433,7 +433,7 @@ parse_args(const char **argv,
|
||||
xstrcmp);
|
||||
}
|
||||
if (arrayset)
|
||||
go.optind += set_array(array, arrayset > 0 ? true : false,
|
||||
go.optind += set_array(array, tobool(arrayset > 0),
|
||||
argv + go.optind);
|
||||
|
||||
return (go.optind);
|
||||
|
Reference in New Issue
Block a user