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
									
								
								edit.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								edit.c
									
									
									
									
									
								
							| @@ -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); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user