summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2025-03-31 17:08:33 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2025-04-03 10:31:04 +0900
commit25d19211da8c977935f2c318edae916252e7c7d8 (patch)
tree23f3ba78e084e62616fd770f1d4170b8b2e3d065
parentf6f9c53e6ddfacab6db4a47e27240a464be247e9 (diff)
downloadabakus-r14.1.4.tar.gz
abakus-r14.1.4.zip
Replace TRUE/FALSE with boolean values true/falser14.1.4
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit fa5d65de6ba63d58e8bd39272ddb11856c226287)
-rw-r--r--src/hmath.cpp6
-rw-r--r--src/number.c7
2 files changed, 7 insertions, 6 deletions
diff --git a/src/hmath.cpp b/src/hmath.cpp
index 26181a2..864533c 100644
--- a/src/hmath.cpp
+++ b/src/hmath.cpp
@@ -130,13 +130,13 @@ static bc_num h_str2num( const char* str, int scale = HMATH_MAX_PREC )
int digits, strscale;
const char *ptr;
char *nptr;
- char zero_int;
+ bool zero_int;
/* Check for valid number and count digits. */
ptr = str;
digits = 0;
strscale = 0;
- zero_int = FALSE;
+ zero_int = false;
if ( (*ptr == '+') || (*ptr == '-')) ptr++; /* Sign */
while (*ptr == '0') ptr++; /* Skip leading zeros. */
while (isdigit((int)*ptr)) ptr++, digits++; /* digits */
@@ -149,7 +149,7 @@ static bc_num h_str2num( const char* str, int scale = HMATH_MAX_PREC )
strscale = MIN(strscale, scale);
if (digits == 0)
{
- zero_int = TRUE;
+ zero_int = true;
digits = 1;
}
diff --git a/src/number.c b/src/number.c
index 33601bb..a1f80e2 100644
--- a/src/number.c
+++ b/src/number.c
@@ -35,6 +35,7 @@
#include <assert.h>
#include <stdlib.h>
#include <string.h>
+#include <stdbool.h>
#include <ctype.h>/* Prototypes needed for external utility routines. */
#define bc_rt_warn rt_warn
@@ -1713,7 +1714,7 @@ bc_str2num (num, str, scale)
{
int digits, strscale;
char *ptr, *nptr;
- char zero_int;
+ bool zero_int;
/* Prepare num. */
bc_free_num (num);
@@ -1722,7 +1723,7 @@ bc_str2num (num, str, scale)
ptr = str;
digits = 0;
strscale = 0;
- zero_int = FALSE;
+ zero_int = false;
if ( (*ptr == '+') || (*ptr == '-')) ptr++; /* Sign */
while (*ptr == '0') ptr++; /* Skip leading zeros. */
while (isdigit((int)*ptr)) ptr++, digits++; /* digits */
@@ -1738,7 +1739,7 @@ bc_str2num (num, str, scale)
strscale = MIN(strscale, scale);
if (digits == 0)
{
- zero_int = TRUE;
+ zero_int = true;
digits = 1;
}
*num = bc_new_num (digits, strscale);