Skip to content

Commit 1b72983

Browse files
committed
Cast ispace()/isdigit() args to int to remove warning
1 parent 0ca26c9 commit 1b72983

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

ivlpp/lexor.lex

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
%option prefix="yy"
22
%{
33
/*
4-
* Copyright (c) 1999-2024 Stephen Williams (steve@icarus.com)
4+
* Copyright (c) 1999-2025 Stephen Williams (steve@icarus.com)
55
*
66
* This source code is free software; you can redistribute it
77
* and/or modify it in source code form under the terms of the GNU
@@ -1080,17 +1080,17 @@ static void def_add_arg(void)
10801080
to us to chop it up to name and value. */
10811081
if ( (val=strchr(arg,'=')) ) {
10821082
*val++ = 0;
1083-
while (*val && isspace(*val)) val += 1;
1083+
while (*val && isspace((int)*val)) val += 1;
10841084

10851085
val_length = strlen(val);
1086-
while (val_length>0 && isspace(val[val_length-1])) {
1086+
while (val_length>0 && isspace((int)val[val_length-1])) {
10871087
val_length -= 1;
10881088
val[val_length] = 0;
10891089
}
10901090

10911091
/* Strip white space from between arg and "=". */
10921092
length = strlen(arg);
1093-
while (length>0 && isspace(arg[length-1])) {
1093+
while (length>0 && isspace((int)arg[length-1])) {
10941094
length -= 1;
10951095
arg[length] = 0;
10961096
}

vpi/v2009_string.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012-2021 Stephen Williams (steve@icarus.com)
2+
* Copyright (c) 2012-2025 Stephen Williams (steve@icarus.com)
33
*
44
* This source code is free software; you can redistribute it
55
* and/or modify it in source code form under the terms of the GNU
@@ -151,7 +151,7 @@ static PLI_INT32 atoi_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
151151
vpi_get_value(arg, &value);
152152
const char*bufp = value.value.str;
153153
while (bufp && *bufp) {
154-
if (isdigit(*bufp)) {
154+
if (isdigit((int)*bufp)) {
155155
res = (res * 10) + (*bufp - '0');
156156
bufp += 1;
157157
} else if (*bufp == '_') {

0 commit comments

Comments
 (0)