Skip to content

Unnecessary malloc casts #7

Description

@johnramsden

malloc (and realloc) return void pointers and do not require casts.

buffers=(struct embedding_buffer**)malloc(NR_TABLES*sizeof(struct embedding_buffer*));

buffers[total_buffers]=(struct embedding_buffer*)malloc(sizeof(struct embedding_buffer));

buffers[total_buffers+j]=(struct embedding_buffer*)malloc(sizeof(struct embedding_buffer));

buffers=(struct embedding_buffer**)realloc(buffers, buff_arr_len*(sizeof(struct embedding_buffer*)));

buffers[total_buffers]->data=(int32_t*)malloc(ALIGN((last_row-first_row+1)*nr_cols*sizeof(int32_t),8));

tables[i].buffers=(struct embedding_buffer**)malloc(tables[i].nr_buffers*sizeof(struct embedding_buffer*));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions