Skip to content

Commit

Permalink
Fix svsim with gcc14 (#4121) (#4122)
Browse files Browse the repository at this point in the history
(cherry picked from commit 25f70bd)

Co-authored-by: qimingchu <[email protected]>
  • Loading branch information
mergify[bot] and Emin017 authored May 31, 2024
1 parent 7bff096 commit a01b972
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 a01b972

Please sign in to comment.