fix GCC's -Wcalloc-transposed-args warning
GCC 14.1.0 warns about calls to `calloc()` with element size as the first argument. Link: https://gcc.gnu.org/onlinedocs/gcc-14.1.0/gcc/Warning-Options.html#index-Wcalloc-transposed-args Change-Id: I7d44a74a003ee6ec49d165f91727972478214587 Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8301 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
committed by
Antonio Borneo
parent
e4c0904731
commit
400cf213c0
@@ -1597,7 +1597,7 @@ static int angie_queue_scan(struct angie *device, struct jtag_command *cmd)
|
||||
|
||||
/* Allocate TDO buffer if required */
|
||||
if (type == SCAN_IN || type == SCAN_IO) {
|
||||
tdo_buffer_start = calloc(sizeof(uint8_t), scan_size_bytes);
|
||||
tdo_buffer_start = calloc(scan_size_bytes, sizeof(uint8_t));
|
||||
|
||||
if (!tdo_buffer_start)
|
||||
return ERROR_FAIL;
|
||||
|
||||
@@ -1473,7 +1473,7 @@ static int ulink_queue_scan(struct ulink *device, struct jtag_command *cmd)
|
||||
|
||||
/* Allocate TDO buffer if required */
|
||||
if ((type == SCAN_IN) || (type == SCAN_IO)) {
|
||||
tdo_buffer_start = calloc(sizeof(uint8_t), scan_size_bytes);
|
||||
tdo_buffer_start = calloc(scan_size_bytes, sizeof(uint8_t));
|
||||
|
||||
if (!tdo_buffer_start)
|
||||
return ERROR_FAIL;
|
||||
|
||||
Reference in New Issue
Block a user