Skip to content

Commit 24a07e8

Browse files
Fix svsim with gcc14 (#4121) (#4123)
(cherry picked from commit 25f70bd) Co-authored-by: qimingchu <cchuqiming@gmail.com>
1 parent b1fbf12 commit 24a07e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

svsim/src/main/resources/simulation-driver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ static uint8_t *scanHexBits(const char **scanCursor, const char *scanEnd,
436436
}
437437

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

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

644644
int byteCount = (port.bitWidth + 7) / 8;
645-
uint8_t *bytes = (uint8_t *)calloc(sizeof(uint8_t), byteCount);
645+
uint8_t *bytes = (uint8_t *)calloc( byteCount, sizeof(uint8_t));
646646
assert(bytes != NULL);
647647
(*port.getter)(bytes);
648648
sendBits(bytes, port.bitWidth, isSigned);
@@ -720,7 +720,7 @@ static void processCommand() {
720720

721721
sentinelPortByteCount = (sentinelPort.bitWidth + 7) / 8;
722722
sentinelPortValue =
723-
(uint8_t *)calloc(sizeof(uint8_t), sentinelPortByteCount);
723+
(uint8_t *)calloc(sentinelPortByteCount, sizeof(uint8_t));
724724
assert(sentinelPortValue != NULL);
725725
}
726726

0 commit comments

Comments
 (0)