Skip to content

Commit

Permalink
Cast ispace()/isdigit() args to int to remove warning
Browse files Browse the repository at this point in the history
  • Loading branch information
caryr committed Feb 13, 2025
1 parent 0ca26c9 commit 1b72983
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions ivlpp/lexor.lex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%option prefix="yy"
%{
/*
* Copyright (c) 1999-2024 Stephen Williams ([email protected])
* Copyright (c) 1999-2025 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
Expand Down Expand Up @@ -1080,17 +1080,17 @@ static void def_add_arg(void)
to us to chop it up to name and value. */
if ( (val=strchr(arg,'=')) ) {
*val++ = 0;
while (*val && isspace(*val)) val += 1;
while (*val && isspace((int)*val)) val += 1;

val_length = strlen(val);
while (val_length>0 && isspace(val[val_length-1])) {
while (val_length>0 && isspace((int)val[val_length-1])) {
val_length -= 1;
val[val_length] = 0;
}

/* Strip white space from between arg and "=". */
length = strlen(arg);
while (length>0 && isspace(arg[length-1])) {
while (length>0 && isspace((int)arg[length-1])) {
length -= 1;
arg[length] = 0;
}
Expand Down
4 changes: 2 additions & 2 deletions vpi/v2009_string.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2021 Stephen Williams ([email protected])
* Copyright (c) 2012-2025 Stephen Williams ([email protected])
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
Expand Down Expand Up @@ -151,7 +151,7 @@ static PLI_INT32 atoi_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
vpi_get_value(arg, &value);
const char*bufp = value.value.str;
while (bufp && *bufp) {
if (isdigit(*bufp)) {
if (isdigit((int)*bufp)) {
res = (res * 10) + (*bufp - '0');
bufp += 1;
} else if (*bufp == '_') {
Expand Down

0 comments on commit 1b72983

Please sign in to comment.