From 99580cd05171b82e3b460c96abdfbfafbcfd9d60 Mon Sep 17 00:00:00 2001 From: Cary R Date: Mon, 17 Feb 2025 09:36:27 -0800 Subject: [PATCH] Fix warnings that toupper() takes an int --- vpi/v2009_string.c | 2 +- vpi/vhdl_textio.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vpi/v2009_string.c b/vpi/v2009_string.c index 241e6f2e1..2ea4cad93 100644 --- a/vpi/v2009_string.c +++ b/vpi/v2009_string.c @@ -240,7 +240,7 @@ static PLI_INT32 atohex_calltf(ICARUS_VPI_CONST PLI_BYTE8*name) case 'd': case 'D': case 'e': case 'E': case 'f': case 'F': - res = (res * 16) + (toupper(*bufp) - 'A' + 10); + res = (res * 16) + (toupper((int)*bufp) - 'A' + 10); bufp += 1; break; case '_': diff --git a/vpi/vhdl_textio.c b/vpi/vhdl_textio.c index 57de2d091..87a283090 100644 --- a/vpi/vhdl_textio.c +++ b/vpi/vhdl_textio.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2021 CERN + * Copyright (c) 2015-2025 CERN * @author Maciej Suminski * * 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) /* VHDL stores X/Z values uppercase, so follow the rule */ for(size_t i = 0; i< strlen(val.value.str); ++i) - val.value.str[i] = toupper(val.value.str[i]); + val.value.str[i] = toupper((int)val.value.str[i]); res = snprintf(buf, STRING_BUF_SIZE, "%s%s", string, val.value.str); break;