Fix clang 20 warnings

This commit is contained in:
Wilson Snyder 2025-03-27 19:01:25 -04:00
parent 40acac1c57
commit 5e69faff46
4 changed files with 12 additions and 14 deletions

View File

@ -85,7 +85,7 @@ public:
// To simplify our free list, we use a size large enough for all derived types
// We reserve word zero for the next pointer, as that's safer in case a
// dangling reference to the original remains around.
static constexpr size_t CHUNK_SIZE = 128;
static constexpr size_t CHUNK_SIZE = 256;
if (VL_UNCOVERABLE(size > CHUNK_SIZE))
VL_FATAL_MT(__FILE__, __LINE__, "", "increase CHUNK_SIZE");
if (VL_LIKELY(t_freeHeadp)) {

View File

@ -1260,14 +1260,12 @@ class ParamVisitor final : public VNVisitor {
if (const AstNodeDType* const typep = varp->childDTypep()) {
ifacerefp = VN_CAST(typep, IfaceRefDType);
if (!ifacerefp) {
if (const AstUnpackArrayDType* const unpackp
= VN_CAST(typep, UnpackArrayDType)) {
if (VN_IS(typep, UnpackArrayDType)) {
ifacerefp = VN_CAST(typep->getChildDTypep(), IfaceRefDType);
}
}
if (!ifacerefp) {
if (const AstBracketArrayDType* const unpackp
= VN_CAST(typep, BracketArrayDType)) {
if (VN_IS(typep, BracketArrayDType)) {
ifacerefp = VN_CAST(typep->subDTypep(), IfaceRefDType);
}
}

View File

@ -117,7 +117,7 @@ int test_vpiVectorVal(char* name, PLI_BYTE8* test_data, int index, const unsigne
const unsigned elem_size_words = (elem_size + 3) / sizeof(PLI_UINT32);
const unsigned vec_size = elem_size_words * size;
std::vector<s_vpi_vecval> test_data_vectors;
test_data_vectors.reserve(vec_size);
test_data_vectors.resize(vec_size);
unsigned test_data_index = 0;
for (unsigned i = 0; i < size; i++) {
unsigned count = 0;
@ -179,7 +179,7 @@ int test_vpiIntVal(char* name, PLI_BYTE8* test_data, int index, const unsigned l
// prepare index
int index_arr[1] = {index};
std::vector<PLI_INT32> test_data_integers;
test_data_integers.reserve(size);
test_data_integers.resize(size);
for (unsigned i = 0; i < size; i++) {
PLI_INT32& integer = test_data_integers[i];
integer = 0;
@ -230,7 +230,7 @@ int test_vpiShortIntVal(char* name, PLI_BYTE8* test_data, int index, const unsig
// prepare index
int index_arr[1] = {index};
std::vector<PLI_INT16> test_data_shortints;
test_data_shortints.reserve(size);
test_data_shortints.resize(size);
for (unsigned i = 0; i < size; i++) {
if (elem_size == 2) {
test_data_shortints[i] = test_data[i * 2] & 0xFF;
@ -282,7 +282,7 @@ int test_vpiLongIntVal(char* name, PLI_BYTE8* test_data, int index, const unsign
// prepare index
int index_arr[1] = {index};
std::vector<PLI_INT64> test_data_longints;
test_data_longints.reserve(size);
test_data_longints.resize(size);
for (unsigned i = 0; i < size; i++) {
PLI_INT64& longint = test_data_longints[i];
longint = 0;

View File

@ -36,7 +36,7 @@ int test_vpiRawFourStateVal(char* name, PLI_BYTE8* test_data, int index, const u
// prepare index and test data arrays
int index_arr[1] = {index};
std::vector<PLI_BYTE8> test_data_four_state;
test_data_four_state.reserve(size * elem_size * 2);
test_data_four_state.resize(size * elem_size * 2);
for (unsigned i = 0; i < size; i++) {
for (unsigned j = 0; j < elem_size; j++) {
test_data_four_state[(i * 2 * elem_size) + j] = test_data[(i * elem_size) + j];
@ -147,7 +147,7 @@ int test_vpiVectorVal(char* name, PLI_BYTE8* test_data, int index, const unsigne
const unsigned elem_size_words = (elem_size + 3) / sizeof(PLI_UINT32);
const unsigned vec_size = elem_size_words * size;
std::vector<s_vpi_vecval> test_data_vectors;
test_data_vectors.reserve(vec_size);
test_data_vectors.resize(vec_size);
unsigned test_data_index = 0;
for (unsigned i = 0; i < size; i++) {
unsigned count = 0;
@ -214,7 +214,7 @@ int test_vpiIntVal(char* name, PLI_BYTE8* test_data, int index, const unsigned n
// prepare index
int index_arr[1] = {index};
std::vector<PLI_INT32> test_data_integers;
test_data_integers.reserve(size);
test_data_integers.resize(size);
for (unsigned i = 0; i < size; i++) {
PLI_INT32& integer = test_data_integers[i];
integer = 0;
@ -268,7 +268,7 @@ int test_vpiShortIntVal(char* name, PLI_BYTE8* test_data, int index, const unsig
// prepare index
int index_arr[1] = {index};
std::vector<PLI_INT16> test_data_shortints;
test_data_shortints.reserve(size);
test_data_shortints.resize(size);
for (unsigned i = 0; i < size; i++) {
if (elem_size == 2) {
test_data_shortints[i] = test_data[i * 2] & 0xFF;
@ -323,7 +323,7 @@ int test_vpiLongIntVal(char* name, PLI_BYTE8* test_data, int index, const unsign
// prepare index
int index_arr[1] = {index};
std::vector<PLI_INT64> test_data_longints;
test_data_longints.reserve(size);
test_data_longints.resize(size);
for (unsigned i = 0; i < size; i++) {
PLI_INT64& longint = test_data_longints[i];
longint = 0;