comparison th_printf1.c @ 735:31bc1ed07cf5

Renaming BOOL->bool and TRUE/FALSE to true/false, and using stdbool.h if available.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 07 Dec 2022 12:14:39 +0200
parents 29e44a58bc73
children c9a6fe116453
comparison
equal deleted inserted replaced
734:2ae1045f6c18 735:31bc1ed07cf5
6 * Please read file 'COPYING' for information on license and distribution. 6 * Please read file 'COPYING' for information on license and distribution.
7 */ 7 */
8 8
9 9
10 int TH_VPRINTF_INTFMT_NAME (char *buf, const int len, int *pos, 10 int TH_VPRINTF_INTFMT_NAME (char *buf, const int len, int *pos,
11 TH_VPRINTF_INTFMT_TYPE_S pval, const int f_radix, const BOOL f_upcase, 11 TH_VPRINTF_INTFMT_TYPE_S pval, const int f_radix, const bool f_upcase,
12 const BOOL f_unsig, BOOL *f_neg) 12 const bool f_unsig, bool *f_neg)
13 #ifdef TH_VPRINTF_INTFMT_HEADER 13 #ifdef TH_VPRINTF_INTFMT_HEADER
14 ; 14 ;
15 #else 15 #else
16 { 16 {
17 if (f_radix > 16) 17 if (f_radix > 16)
18 return EOF; 18 return EOF;
19 19
20 // Check for negative value 20 // Check for negative value
21 if (!f_unsig && pval < 0) 21 if (!f_unsig && pval < 0)
22 { 22 {
23 *f_neg = TRUE; 23 *f_neg = true;
24 pval = -pval; 24 pval = -pval;
25 } 25 }
26 else 26 else
27 *f_neg = FALSE; 27 *f_neg = false;
28 28
29 // Render the value to a string in buf (reversed) 29 // Render the value to a string in buf (reversed)
30 TH_VPRINTF_INTFMT_TYPE_U val = pval; 30 TH_VPRINTF_INTFMT_TYPE_U val = pval;
31 31
32 // Special case for value of 0. This would seem like a 32 // Special case for value of 0. This would seem like a