From 4efbfa3e8fcca46347fbeb3bdebf3ba69c14cc47 Mon Sep 17 00:00:00 2001 From: Cary R Date: Wed, 6 Jan 2021 22:38:48 -0800 Subject: [PATCH] Fix a couple more cppcheck warnings --- vpi/sys_readmem_lex.lex | 6 +++--- vvp/vpi_const.cc | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/vpi/sys_readmem_lex.lex b/vpi/sys_readmem_lex.lex index 9640d0c7a..10d543b4d 100644 --- a/vpi/sys_readmem_lex.lex +++ b/vpi/sys_readmem_lex.lex @@ -4,7 +4,7 @@ %{ /* - * Copyright (c) 1999-2017,2019 Stephen Williams (steve@icarus.com) + * Copyright (c) 1999-2021 Stephen Williams (steve@icarus.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 @@ -177,8 +177,8 @@ static void make_bin_value(void) cur = vecval; while ((width < word_max) && (end > beg)) { - int aval = 0; - int bval = 0; + PLI_UINT32 aval = 0; + PLI_UINT32 bval = 0; end -= 1; if (*end == '_') continue; diff --git a/vvp/vpi_const.cc b/vvp/vpi_const.cc index c3d2326f1..6eb540086 100644 --- a/vvp/vpi_const.cc +++ b/vvp/vpi_const.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2020 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2021 Stephen Williams (steve@icarus.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 @@ -333,6 +333,7 @@ vpiHandle vpip_make_string_param(char*name, char*text, inline __vpiBinaryConst::__vpiBinaryConst() +signed_flag(0), sized_flag(0) { } int __vpiBinaryConst::get_type_code(void) const @@ -404,9 +405,6 @@ vpiHandle vpip_make_binary_const(unsigned wid, const char*bits) { struct __vpiBinaryConst*obj = new __vpiBinaryConst; - obj->signed_flag = 0; - obj->sized_flag = 0; - const char*bp = bits; if (*bp == 's') { bp += 1;