Skip to content

Commit

Permalink
Fix svsim with gcc14 (#4121)
Browse files Browse the repository at this point in the history
  • Loading branch information
Emin017 authored May 31, 2024
1 parent 99aa9f1 commit 25f70bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions svsim/src/main/resources/simulation-driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ static uint8_t *scanHexBits(const char **scanCursor, const char *scanEnd,
}

int byteCount = (bitCount + 7) / 8;
uint8_t *bytes = (uint8_t *)calloc(sizeof(uint8_t), byteCount);
uint8_t *bytes = (uint8_t *)calloc(byteCount, sizeof(uint8_t));
assert(bytes != NULL);

const char *firstCharacterOfValue = *scanCursor;
Expand Down Expand Up @@ -642,7 +642,7 @@ static void processCommand() {
resolveGettablePort(id, &port, "resolving port for GET_BITS command");

int byteCount = (port.bitWidth + 7) / 8;
uint8_t *bytes = (uint8_t *)calloc(sizeof(uint8_t), byteCount);
uint8_t *bytes = (uint8_t *)calloc( byteCount, sizeof(uint8_t));
assert(bytes != NULL);
(*port.getter)(bytes);
sendBits(bytes, port.bitWidth, isSigned);
Expand Down Expand Up @@ -720,7 +720,7 @@ static void processCommand() {

sentinelPortByteCount = (sentinelPort.bitWidth + 7) / 8;
sentinelPortValue =
(uint8_t *)calloc(sizeof(uint8_t), sentinelPortByteCount);
(uint8_t *)calloc(sentinelPortByteCount, sizeof(uint8_t));
assert(sentinelPortValue != NULL);
}

Expand Down

0 comments on commit 25f70bd

Please sign in to comment.