char *strndup(const char *s, size_t n)
{
size_t len = strnlen(s, n);
- char *new = (char *) malloc(len + 1);
+ char *new = malloc(len + 1);
if (new == NULL)
return NULL;
{
struct versaloon_want_pos_t *new_pos = NULL;
- new_pos = (struct versaloon_want_pos_t *)malloc(sizeof(*new_pos));
+ new_pos = malloc(sizeof(*new_pos));
if (NULL == new_pos) {
LOG_ERROR(ERRMSG_NOT_ENOUGH_MEMORY);
return ERRCODE_NOT_ENOUGH_MEMORY;
const char tmp_thread_name[] = "Current Execution";
const char tmp_thread_extra_info[] = "No RTOS thread";
- rtos->thread_details = (struct thread_detail *) malloc(
+ rtos->thread_details = malloc(
sizeof(struct thread_detail));
rtos->thread_details->threadid = 1;
rtos->thread_details->exists = true;
rtos->thread_details->display_str = NULL;
- rtos->thread_details->extra_info_str = (char *) malloc(
+ rtos->thread_details->extra_info_str = malloc(
sizeof(tmp_thread_extra_info));
strcpy(rtos->thread_details->extra_info_str, tmp_thread_extra_info);
- rtos->thread_details->thread_name_str = (char *) malloc(
+ rtos->thread_details->thread_name_str = malloc(
sizeof(tmp_thread_name));
strcpy(rtos->thread_details->thread_name_str, tmp_thread_name);
}
/* create space for new thread details */
- rtos->thread_details = (struct thread_detail *) malloc(
+ rtos->thread_details = malloc(
sizeof(struct thread_detail) * tasks_found);
if (!rtos->thread_details) {
LOG_ERROR("Could not allocate space for thread details");
if (tmp_str[0] == '\x00')
strcpy(tmp_str, "No Name");
- curr_thrd_details->thread_name_str = (char *)malloc(
+ curr_thrd_details->thread_name_str = malloc(
strlen(tmp_str) + 1);
strcpy(curr_thrd_details->thread_name_str, tmp_str);
else
state_desc = "Unknown state";
- curr_thrd_details->extra_info_str = (char *)malloc(strlen(
+ curr_thrd_details->extra_info_str = malloc(strlen(
state_desc)+1);
strcpy(curr_thrd_details->extra_info_str, state_desc);
static int ChibiOS_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])
{
unsigned int i;
- *symbol_list = (symbol_table_elem_t *) malloc(
+ *symbol_list = malloc(
sizeof(symbol_table_elem_t) * ARRAY_SIZE(ChibiOS_symbol_list));
for (i = 0; i < ARRAY_SIZE(ChibiOS_symbol_list); i++)
char tmp_str[] = "Current Execution";
thread_list_size++;
tasks_found++;
- rtos->thread_details = (struct thread_detail *) malloc(
+ rtos->thread_details = malloc(
sizeof(struct thread_detail) * thread_list_size);
if (!rtos->thread_details) {
LOG_ERROR("Error allocating memory for %d threads", thread_list_size);
rtos->thread_details->exists = true;
rtos->thread_details->display_str = NULL;
rtos->thread_details->extra_info_str = NULL;
- rtos->thread_details->thread_name_str = (char *) malloc(sizeof(tmp_str));
+ rtos->thread_details->thread_name_str = malloc(sizeof(tmp_str));
strcpy(rtos->thread_details->thread_name_str, tmp_str);
if (thread_list_size == 1) {
}
} else {
/* create space for new thread details */
- rtos->thread_details = (struct thread_detail *) malloc(
+ rtos->thread_details = malloc(
sizeof(struct thread_detail) * thread_list_size);
if (!rtos->thread_details) {
LOG_ERROR("Error allocating memory for %d threads", thread_list_size);
}
symbol_address_t *list_of_lists =
- (symbol_address_t *)malloc(sizeof(symbol_address_t) *
+ malloc(sizeof(symbol_address_t) *
(max_used_priority+1 + 5));
if (!list_of_lists) {
LOG_ERROR("Error allocating memory for %" PRId64 " priorities", max_used_priority);
strcpy(tmp_str, "No Name");
rtos->thread_details[tasks_found].thread_name_str =
- (char *)malloc(strlen(tmp_str)+1);
+ malloc(strlen(tmp_str)+1);
strcpy(rtos->thread_details[tasks_found].thread_name_str, tmp_str);
rtos->thread_details[tasks_found].display_str = NULL;
rtos->thread_details[tasks_found].exists = true;
if (rtos->thread_details[tasks_found].threadid == rtos->current_thread) {
char running_str[] = "Running";
- rtos->thread_details[tasks_found].extra_info_str = (char *) malloc(
+ rtos->thread_details[tasks_found].extra_info_str = malloc(
sizeof(running_str));
strcpy(rtos->thread_details[tasks_found].extra_info_str,
running_str);
static int FreeRTOS_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])
{
unsigned int i;
- *symbol_list = (symbol_table_elem_t *) malloc(
+ *symbol_list = malloc(
sizeof(symbol_table_elem_t) * ARRAY_SIZE(FreeRTOS_symbol_list));
for (i = 0; i < ARRAY_SIZE(FreeRTOS_symbol_list); i++)
if (tmp_str[0] == '\x00')
strcpy(tmp_str, "No Name");
- *info = (char *)malloc(strlen(tmp_str)+1);
+ *info = malloc(strlen(tmp_str)+1);
strcpy(*info, tmp_str);
return 0;
}
char tmp_str[] = "Current Execution";
thread_list_size++;
tasks_found++;
- rtos->thread_details = (struct thread_detail *) malloc(
+ rtos->thread_details = malloc(
sizeof(struct thread_detail) * thread_list_size);
rtos->thread_details->threadid = 1;
rtos->thread_details->exists = true;
rtos->thread_details->display_str = NULL;
rtos->thread_details->extra_info_str = NULL;
- rtos->thread_details->thread_name_str = (char *) malloc(sizeof(tmp_str));
+ rtos->thread_details->thread_name_str = malloc(sizeof(tmp_str));
strcpy(rtos->thread_details->thread_name_str, tmp_str);
if (thread_list_size == 0) {
}
} else {
/* create space for new thread details */
- rtos->thread_details = (struct thread_detail *) malloc(
+ rtos->thread_details = malloc(
sizeof(struct thread_detail) * thread_list_size);
}
strcpy(tmp_str, "No Name");
rtos->thread_details[tasks_found].thread_name_str =
- (char *)malloc(strlen(tmp_str)+1);
+ malloc(strlen(tmp_str)+1);
strcpy(rtos->thread_details[tasks_found].thread_name_str, tmp_str);
/* Read the thread status */
else
state_desc = "Unknown state";
- rtos->thread_details[tasks_found].extra_info_str = (char *)malloc(strlen(
+ rtos->thread_details[tasks_found].extra_info_str = malloc(strlen(
state_desc)+1);
strcpy(rtos->thread_details[tasks_found].extra_info_str, state_desc);
static int ThreadX_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])
{
unsigned int i;
- *symbol_list = (symbol_table_elem_t *) malloc(
+ *symbol_list = malloc(
sizeof(symbol_table_elem_t) * ARRAY_SIZE(ThreadX_symbol_list));
for (i = 0; i < ARRAY_SIZE(ThreadX_symbol_list); i++)
if (tmp_str[0] == '\x00')
strcpy(tmp_str, "No Name");
- detail->thread_name_str = (char *)malloc(strlen(tmp_str)+1);
+ detail->thread_name_str = malloc(strlen(tmp_str)+1);
/* Read the thread status */
int64_t thread_status = 0;
else
state_desc = "Unknown state";
- detail->extra_info_str = (char *)malloc(strlen(state_desc)+1);
+ detail->extra_info_str = malloc(strlen(state_desc)+1);
detail->exists = true;
char tmp_str[] = "Current Execution";
thread_list_size++;
tasks_found++;
- rtos->thread_details = (struct thread_detail *) malloc(
+ rtos->thread_details = malloc(
sizeof(struct thread_detail) * thread_list_size);
rtos->thread_details->threadid = 1;
rtos->thread_details->exists = true;
rtos->thread_details->display_str = NULL;
rtos->thread_details->extra_info_str = NULL;
- rtos->thread_details->thread_name_str = (char *) malloc(sizeof(tmp_str));
+ rtos->thread_details->thread_name_str = malloc(sizeof(tmp_str));
strcpy(rtos->thread_details->thread_name_str, tmp_str);
if (thread_list_size == 0) {
}
} else {
/* create space for new thread details */
- rtos->thread_details = (struct thread_detail *) malloc(
+ rtos->thread_details = malloc(
sizeof(struct thread_detail) * thread_list_size);
}
strcpy(tmp_str, "No Name");
rtos->thread_details[tasks_found].thread_name_str =
- (char *)malloc(strlen(tmp_str)+1);
+ malloc(strlen(tmp_str)+1);
strcpy(rtos->thread_details[tasks_found].thread_name_str, tmp_str);
/* Read the thread status */
else
state_desc = "Unknown state";
- rtos->thread_details[tasks_found].extra_info_str = (char *)malloc(strlen(
+ rtos->thread_details[tasks_found].extra_info_str = malloc(strlen(
state_desc)+1);
strcpy(rtos->thread_details[tasks_found].extra_info_str, state_desc);
static int eCos_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])
{
unsigned int i;
- *symbol_list = (symbol_table_elem_t *) malloc(
+ *symbol_list = malloc(
sizeof(symbol_table_elem_t) * ARRAY_SIZE(eCos_symbol_list));
for (i = 0; i < ARRAY_SIZE(eCos_symbol_list); i++)
(uint8_t *) &priority);
if (retval != ERROR_OK)
return retval;
- details->extra_info_str = (char *) malloc(EMBKERNEL_MAX_THREAD_NAME_STR_SIZE);
+ details->extra_info_str = malloc(EMBKERNEL_MAX_THREAD_NAME_STR_SIZE);
if (task == rtos->current_thread) {
snprintf(details->extra_info_str, EMBKERNEL_MAX_THREAD_NAME_STR_SIZE, "Pri=%u, Running",
(unsigned int) priority);
}
/* create space for new thread details */
- rtos->thread_details = (struct thread_detail *) malloc(sizeof(struct thread_detail) * thread_list_size);
+ rtos->thread_details = malloc(sizeof(struct thread_detail) * thread_list_size);
if (!rtos->thread_details) {
LOG_ERROR("Error allocating memory for %d threads", thread_list_size);
return ERROR_FAIL;
static int embKernel_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])
{
unsigned int i;
- *symbol_list = (symbol_table_elem_t *) malloc(sizeof(symbol_table_elem_t) * ARRAY_SIZE(embKernel_symbol_list));
+ *symbol_list = malloc(sizeof(symbol_table_elem_t) * ARRAY_SIZE(embKernel_symbol_list));
for (i = 0; i < ARRAY_SIZE(embKernel_symbol_list); i++)
(*symbol_list)[i].symbol_name = embKernel_symbol_list[i];
} else {
struct threads *temp = linux_os->thread_list;
- *hex_reg_list = (char *)calloc(1, 500 * sizeof(char));
+ *hex_reg_list = calloc(1, 500 * sizeof(char));
hex_string = *hex_reg_list;
for (i = 0; i < 16; i++)
if (retval != ERROR_OK)
return ERROR_TARGET_FAILURE;
- char *out_str = (char *)calloc(1, 350 * sizeof(int64_t));
+ char *out_str = calloc(1, 350 * sizeof(int64_t));
char *tmp_str = out_str;
tmp_str += sprintf(tmp_str, "m");
struct threads *temp = linux_os->thread_list;
if (found == 1) {
/*LOG_INFO("INTO GDB THREAD UPDATE FOUNDING START TASK");*/
- char *out_strr = (char *)calloc(1, 350 * sizeof(int64_t));
+ char *out_strr = calloc(1, 350 * sizeof(int64_t));
char *tmp_strr = out_strr;
tmp_strr += sprintf(tmp_strr, "m");
/*LOG_INFO("CHAR MALLOC & M DONE");*/
char *pid_current = "*PID: ";
char *name = "NAME: ";
int str_size = strlen(pid) + strlen(name);
- char *tmp_str = (char *)calloc(1, str_size + 50);
+ char *tmp_str = calloc(1, str_size + 50);
char *tmp_str_ptr = tmp_str;
/* discriminate current task */
tmp_str_ptr += sprintf(tmp_str_ptr, "%s", " | ");
sprintf(tmp_str_ptr, "%s", name);
sprintf(tmp_str_ptr, "%s", temp->name);
- char *hex_str = (char *)calloc(1, strlen(tmp_str) * 2 + 1);
+ char *hex_str = calloc(1, strlen(tmp_str) * 2 + 1);
int pkt_len = hexify(hex_str, tmp_str, 0, strlen(tmp_str) * 2 + 1);
gdb_put_packet(connection, hex_str, pkt_len);
free(hex_str);
if (detail->extra_info_str != NULL)
str_size += strlen(detail->extra_info_str);
- char *tmp_str = (char *) malloc(str_size + 7);
+ char *tmp_str = malloc(str_size + 7);
char *tmp_str_ptr = tmp_str;
if (detail->display_str != NULL)
assert(strlen(tmp_str) ==
(size_t) (tmp_str_ptr - tmp_str));
- char *hex_str = (char *) malloc(strlen(tmp_str) * 2 + 1);
+ char *hex_str = malloc(strlen(tmp_str) * 2 + 1);
int pkt_len = hexify(hex_str, tmp_str, 0, strlen(tmp_str) * 2 + 1);
gdb_put_packet(connection, hex_str, pkt_len);
gdb_put_packet(connection, "l", 1);
} else {
/*thread id are 16 char +1 for ',' */
- char *out_str = (char *) malloc(17 * target->rtos->thread_count + 1);
+ char *out_str = malloc(17 * target->rtos->thread_count + 1);
char *tmp_str = out_str;
for (i = 0; i < target->rtos->thread_count; i++) {
tmp_str += sprintf(tmp_str, "%c%016" PRIx64, i == 0 ? 'm' : ',',
return -5;
}
/* Read the stack */
- uint8_t *stack_data = (uint8_t *) malloc(stacking->stack_registers_size);
+ uint8_t *stack_data = malloc(stacking->stack_registers_size);
uint32_t address = stack_ptr;
if (stacking->stack_growth_direction == 1)
#endif
for (i = 0; i < stacking->num_output_registers; i++)
list_size += stacking->register_offsets[i].width_bits/8;
- *hex_reg_list = (char *)malloc(list_size*2 + 1);
+ *hex_reg_list = malloc(list_size*2 + 1);
tmp_str_ptr = *hex_reg_list;
new_stack_ptr = stack_ptr - stacking->stack_growth_direction *
stacking->stack_registers_size;
/* in case current command cannot be committed, and next command is a bit scan command */
/* here is 32K bits for this big scan command, it should be enough */
/* buffer will be reallocated if buffer size is not enough */
- svf_tdi_buffer = (uint8_t *)malloc(2 * SVF_MAX_BUFFER_SIZE_TO_COMMIT);
+ svf_tdi_buffer = malloc(2 * SVF_MAX_BUFFER_SIZE_TO_COMMIT);
if (NULL == svf_tdi_buffer) {
LOG_ERROR("not enough memory");
ret = ERROR_FAIL;
goto free_all;
}
- svf_tdo_buffer = (uint8_t *)malloc(2 * SVF_MAX_BUFFER_SIZE_TO_COMMIT);
+ svf_tdo_buffer = malloc(2 * SVF_MAX_BUFFER_SIZE_TO_COMMIT);
if (NULL == svf_tdo_buffer) {
LOG_ERROR("not enough memory");
ret = ERROR_FAIL;
goto free_all;
}
- svf_mask_buffer = (uint8_t *)malloc(2 * SVF_MAX_BUFFER_SIZE_TO_COMMIT);
+ svf_mask_buffer = malloc(2 * SVF_MAX_BUFFER_SIZE_TO_COMMIT);
if (NULL == svf_mask_buffer) {
LOG_ERROR("not enough memory");
ret = ERROR_FAIL;
if (*lineptr == NULL) {
*n = MIN_CHUNK;
- *lineptr = (char *)malloc(*n);
+ *lineptr = malloc(*n);
if (!*lineptr)
return -1;
}
free(*arr);
*arr = NULL;
}
- *arr = (uint8_t *)malloc(new_byte_len);
+ *arr = malloc(new_byte_len);
if (NULL == *arr) {
LOG_ERROR("not enough memory");
return ERROR_FAIL;
uint8_t *buffer_tmp;
/* reallocate buffer */
- buffer_tmp = (uint8_t *)malloc(svf_buffer_index + ((i + 7) >> 3));
+ buffer_tmp = malloc(svf_buffer_index + ((i + 7) >> 3));
if (NULL == buffer_tmp) {
LOG_ERROR("not enough memory");
return ERROR_FAIL;
free(svf_tdi_buffer);
svf_tdi_buffer = buffer_tmp;
- buffer_tmp = (uint8_t *)malloc(svf_buffer_index + ((i + 7) >> 3));
+ buffer_tmp = malloc(svf_buffer_index + ((i + 7) >> 3));
if (NULL == buffer_tmp) {
LOG_ERROR("not enough memory");
return ERROR_FAIL;
free(svf_tdo_buffer);
svf_tdo_buffer = buffer_tmp;
- buffer_tmp = (uint8_t *)malloc(svf_buffer_index + ((i + 7) >> 3));
+ buffer_tmp = malloc(svf_buffer_index + ((i + 7) >> 3));
if (NULL == buffer_tmp) {
LOG_ERROR("not enough memory");
return ERROR_FAIL;
uint8_t *buffer_tmp;
/* reallocate buffer */
- buffer_tmp = (uint8_t *)malloc(svf_buffer_index + ((i + 7) >> 3));
+ buffer_tmp = malloc(svf_buffer_index + ((i + 7) >> 3));
if (NULL == buffer_tmp) {
LOG_ERROR("not enough memory");
return ERROR_FAIL;
free(svf_tdi_buffer);
svf_tdi_buffer = buffer_tmp;
- buffer_tmp = (uint8_t *)malloc(svf_buffer_index + ((i + 7) >> 3));
+ buffer_tmp = malloc(svf_buffer_index + ((i + 7) >> 3));
if (NULL == buffer_tmp) {
LOG_ERROR("not enough memory");
return ERROR_FAIL;
free(svf_tdo_buffer);
svf_tdo_buffer = buffer_tmp;
- buffer_tmp = (uint8_t *)malloc(svf_buffer_index + ((i + 7) >> 3));
+ buffer_tmp = malloc(svf_buffer_index + ((i + 7) >> 3));
if (NULL == buffer_tmp) {
LOG_ERROR("not enough memory");
return ERROR_FAIL;
}
if (num_of_argu > 2) {
/* STATE pathstate1 ... stable_state */
- path = (tap_state_t *)malloc((num_of_argu - 1) * sizeof(tap_state_t));
+ path = malloc((num_of_argu - 1) * sizeof(tap_state_t));
if (NULL == path) {
LOG_ERROR("not enough memory");
return ERROR_FAIL;
unsigned readiesNum = count;
unsigned bytes = sizeof(*Readies)*readiesNum;
- Readies = (uint8_t *) malloc(bytes);
+ Readies = malloc(bytes);
if (Readies == NULL) {
LOG_ERROR("Out of memory allocating %u bytes", bytes);
return ERROR_FAIL;
switch (syscall_id) {
case NDS32_SYSCALL_EXIT:
- fileio_info->identifier = (char *)malloc(5);
+ fileio_info->identifier = malloc(5);
sprintf(fileio_info->identifier, "exit");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
break;
case NDS32_SYSCALL_OPEN:
{
uint8_t filename[256];
- fileio_info->identifier = (char *)malloc(5);
+ fileio_info->identifier = malloc(5);
sprintf(fileio_info->identifier, "open");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
/* reserve fileio_info->param_2 for length of path */
}
break;
case NDS32_SYSCALL_CLOSE:
- fileio_info->identifier = (char *)malloc(6);
+ fileio_info->identifier = malloc(6);
sprintf(fileio_info->identifier, "close");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
break;
case NDS32_SYSCALL_READ:
- fileio_info->identifier = (char *)malloc(5);
+ fileio_info->identifier = malloc(5);
sprintf(fileio_info->identifier, "read");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
nds32_get_mapped_reg(nds32, R1, &(fileio_info->param_2));
nds32_get_mapped_reg(nds32, R2, &(fileio_info->param_3));
break;
case NDS32_SYSCALL_WRITE:
- fileio_info->identifier = (char *)malloc(6);
+ fileio_info->identifier = malloc(6);
sprintf(fileio_info->identifier, "write");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
nds32_get_mapped_reg(nds32, R1, &(fileio_info->param_2));
nds32_get_mapped_reg(nds32, R2, &(fileio_info->param_3));
break;
case NDS32_SYSCALL_LSEEK:
- fileio_info->identifier = (char *)malloc(6);
+ fileio_info->identifier = malloc(6);
sprintf(fileio_info->identifier, "lseek");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
nds32_get_mapped_reg(nds32, R1, &(fileio_info->param_2));
case NDS32_SYSCALL_UNLINK:
{
uint8_t filename[256];
- fileio_info->identifier = (char *)malloc(7);
+ fileio_info->identifier = malloc(7);
sprintf(fileio_info->identifier, "unlink");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
/* reserve fileio_info->param_2 for length of path */
case NDS32_SYSCALL_RENAME:
{
uint8_t filename[256];
- fileio_info->identifier = (char *)malloc(7);
+ fileio_info->identifier = malloc(7);
sprintf(fileio_info->identifier, "rename");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
/* reserve fileio_info->param_2 for length of old path */
}
break;
case NDS32_SYSCALL_FSTAT:
- fileio_info->identifier = (char *)malloc(6);
+ fileio_info->identifier = malloc(6);
sprintf(fileio_info->identifier, "fstat");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
nds32_get_mapped_reg(nds32, R1, &(fileio_info->param_2));
case NDS32_SYSCALL_STAT:
{
uint8_t filename[256];
- fileio_info->identifier = (char *)malloc(5);
+ fileio_info->identifier = malloc(5);
sprintf(fileio_info->identifier, "stat");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
/* reserve fileio_info->param_2 for length of old path */
}
break;
case NDS32_SYSCALL_GETTIMEOFDAY:
- fileio_info->identifier = (char *)malloc(13);
+ fileio_info->identifier = malloc(13);
sprintf(fileio_info->identifier, "gettimeofday");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
nds32_get_mapped_reg(nds32, R1, &(fileio_info->param_2));
break;
case NDS32_SYSCALL_ISATTY:
- fileio_info->identifier = (char *)malloc(7);
+ fileio_info->identifier = malloc(7);
sprintf(fileio_info->identifier, "isatty");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
break;
case NDS32_SYSCALL_SYSTEM:
{
uint8_t command[256];
- fileio_info->identifier = (char *)malloc(7);
+ fileio_info->identifier = malloc(7);
sprintf(fileio_info->identifier, "system");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
/* reserve fileio_info->param_2 for length of old path */
}
break;
case NDS32_SYSCALL_ERRNO:
- fileio_info->identifier = (char *)malloc(6);
+ fileio_info->identifier = malloc(6);
sprintf(fileio_info->identifier, "errno");
nds32_set_mapped_reg(nds32, R0, nds32->virtual_hosting_errno);
break;
default:
- fileio_info->identifier = (char *)malloc(8);
+ fileio_info->identifier = malloc(8);
sprintf(fileio_info->identifier, "unknown");
break;
}
if (diffs == 0)
LOG_ERROR("checksum mismatch - attempting binary compare");
- data = (uint8_t *)malloc(buf_cnt);
+ data = malloc(buf_cnt);
/* Can we use 32bit word accesses? */
int size = 1;
target->target_number = new_target_number();
/* allocate memory for each unique target type */
- target->type = (struct target_type *)calloc(1, sizeof(struct target_type));
+ target->type = calloc(1, sizeof(struct target_type));
memcpy(target->type, target_types[x], sizeof(struct target_type));
image_size = 0x0;
retval = ERROR_OK;
fastload_num = image.num_sections;
- fastload = (struct FastLoad *)malloc(sizeof(struct FastLoad)*image.num_sections);
+ fastload = malloc(sizeof(struct FastLoad)*image.num_sections);
if (fastload == NULL) {
command_print(CMD_CTX, "out of memory");
image_close(&image);
return ERROR_COMMAND_SYNTAX_ERROR;
/* our return vector must be NULL terminated */
- argv = (char **) calloc(n + 1, sizeof(char *));
+ argv = calloc(n + 1, sizeof(char *));
if (argv == NULL)
return ERROR_FAIL;