summaryrefslogtreecommitdiff
path: root/src/core/wee-calc.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2020-03-23 07:23:08 +0100
committerSébastien Helleu <flashcode@flashtux.org>2020-03-23 07:23:08 +0100
commitfa931b46eb7737be619c9c6e02be1111c17f0f89 (patch)
treee87f392669485cb107d0ee6e669fa4d73488e3d2 /src/core/wee-calc.c
parente6723bb5a86d62d120bc1192c54f0674977ea388 (diff)
downloadweechat-fa931b46eb7737be619c9c6e02be1111c17f0f89.zip
core: fix compiler warnings on Cygwin
Diffstat (limited to 'src/core/wee-calc.c')
-rw-r--r--src/core/wee-calc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/wee-calc.c b/src/core/wee-calc.c
index cba170264..175cb9913 100644
--- a/src/core/wee-calc.c
+++ b/src/core/wee-calc.c
@@ -202,7 +202,7 @@ calc_format_result (double value, char *result, int max_size)
i = strlen (result) - 1;
while (i >= 0)
{
- if (!isdigit (result[i]) && (result[i] != '-'))
+ if (!isdigit ((unsigned char)result[i]) && (result[i] != '-'))
{
result[i] = '\0';
break;
@@ -282,7 +282,7 @@ calc_expression (const char *expr)
arraylist_add (list_ops, ptr_operator);
last_symbol = CALC_SYMBOL_PARENTHESIS_OPEN;
}
- else if (isdigit (expr[i]) || (expr[i] == '.')
+ else if (isdigit ((unsigned char)expr[i]) || (expr[i] == '.')
|| ((expr[i] == '-')
&& ((last_symbol == CALC_SYMBOL_NONE)
|| (last_symbol == CALC_SYMBOL_PARENTHESIS_OPEN)
@@ -296,7 +296,8 @@ calc_expression (const char *expr)
factor = -1;
i++;
}
- while (expr[i] && (isdigit (expr[i]) || (expr[i] == '.')))
+ while (expr[i]
+ && (isdigit ((unsigned char)expr[i]) || (expr[i] == '.')))
{
if (expr[i] == '.')
{
@@ -347,7 +348,7 @@ calc_expression (const char *expr)
i2 = i + 1;
while (expr[i2] && (expr[i2] != ' ') && (expr[i2] != '(')
&& (expr[i2] != ')') && (expr[i2] != '.')
- && (expr[i2] != '-') && !isdigit (expr[i2]))
+ && (expr[i2] != '-') && !isdigit ((unsigned char)expr[i2]))
{
i2++;
}