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:
tg
2011-03-07 20:30:41 +00:00
parent 009d4c7b75
commit 5f8075fc82
8 changed files with 31 additions and 24 deletions

4
edit.c
View File

@ -25,7 +25,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.204 2011/02/09 13:08:16 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.205 2011/03/07 20:30:35 tg Exp $");
/*
* in later versions we might use libtermcap for this, but since external
@ -2444,7 +2444,7 @@ x_bind(const char *a1, const char *a2,
return (1);
}
#ifndef MKSH_SMALL
hastilde = *m1;
hastilde = tobool(*m1);
#endif
afree(m2, ATEMP);