diff --git a/libveriuser/getp.c b/libveriuser/getp.c index c98b0d177..e315eead6 100644 --- a/libveriuser/getp.c +++ b/libveriuser/getp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2020 Michael Ruff (mruff at chiaro.com) + * Copyright (c) 2002-2025 Michael Ruff (mruff at chiaro.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -19,6 +19,7 @@ # include # include +# include # include # include # include "priv.h" @@ -52,7 +53,7 @@ PLI_INT32 tf_igetp(PLI_INT32 n, void *obj) vpi_get_value(arg_h, &value); /* The following may generate a compilation warning, but this * functionality is required by some versions of the standard. */ - rtn = (int) value.value.str; /* Oh my */ + rtn = (int)(intptr_t)value.value.str; /* Oh my */ } else { value.format = vpiIntVal; vpi_get_value(arg_h, &value); diff --git a/vpi/v2009_string.c b/vpi/v2009_string.c index 71741da43..22721e2ad 100644 --- a/vpi/v2009_string.c +++ b/vpi/v2009_string.c @@ -270,7 +270,8 @@ static PLI_INT32 atohex_calltf(ICARUS_VPI_CONST PLI_BYTE8*name) */ static void value_to_text_base(char*text, long val, long base) { - static const char digit_map[16] __attribute__ ((nonstring)) = "0123456789abcdef"; + static const char digit_map[16] = { '0','1','2','3','4','5','6','7', + '8','9','a','b','c','d','e','f' }; char* ptr; assert(base <= 16);