Two compiler warning fixes.

This commit is contained in:
Martin Whitaker 2025-10-13 19:18:20 +01:00
parent 94dcd658c8
commit 884349caab
2 changed files with 5 additions and 3 deletions

View File

@ -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 * This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU * and/or modify it in source code form under the terms of the GNU
@ -19,6 +19,7 @@
# include <assert.h> # include <assert.h>
# include <ctype.h> # include <ctype.h>
# include <stdint.h>
# include <veriuser.h> # include <veriuser.h>
# include <vpi_user.h> # include <vpi_user.h>
# include "priv.h" # include "priv.h"
@ -52,7 +53,7 @@ PLI_INT32 tf_igetp(PLI_INT32 n, void *obj)
vpi_get_value(arg_h, &value); vpi_get_value(arg_h, &value);
/* The following may generate a compilation warning, but this /* The following may generate a compilation warning, but this
* functionality is required by some versions of the standard. */ * 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 { } else {
value.format = vpiIntVal; value.format = vpiIntVal;
vpi_get_value(arg_h, &value); vpi_get_value(arg_h, &value);

View File

@ -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 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; char* ptr;
assert(base <= 16); assert(base <= 16);