Skip to content

Commit 99580cd

Browse files
committed
Fix warnings that toupper() takes an int
1 parent 6088a26 commit 99580cd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

vpi/v2009_string.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ static PLI_INT32 atohex_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
240240
case 'd': case 'D':
241241
case 'e': case 'E':
242242
case 'f': case 'F':
243-
res = (res * 16) + (toupper(*bufp) - 'A' + 10);
243+
res = (res * 16) + (toupper((int)*bufp) - 'A' + 10);
244244
bufp += 1;
245245
break;
246246
case '_':

vpi/vhdl_textio.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015-2021 CERN
2+
* Copyright (c) 2015-2025 CERN
33
* @author Maciej Suminski <maciej.suminski@cern.ch>
44
*
55
* This source code is free software; you can redistribute it
@@ -914,7 +914,7 @@ static PLI_INT32 ivlh_write_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
914914

915915
/* VHDL stores X/Z values uppercase, so follow the rule */
916916
for(size_t i = 0; i< strlen(val.value.str); ++i)
917-
val.value.str[i] = toupper(val.value.str[i]);
917+
val.value.str[i] = toupper((int)val.value.str[i]);
918918

919919
res = snprintf(buf, STRING_BUF_SIZE, "%s%s", string, val.value.str);
920920
break;

0 commit comments

Comments
 (0)