Skip to content

kvec: remove need to pass type? #117

@damag

Description

@damag

Many of kvec.h function macros require passing the type being stored (kv_resize, kv_copy, kv_push, kv_pushp, kv_a) but this seems to not actually be needed. It's only used for two reasons:

  • To cast the pointer returned from realloc(), which is not actually needed in C where the preferred style is usually to not cast from a void pointer when assigning to a variable.
  • In sizeof(type) which could be changed to sizeof(*(v).a)

Has this not been changed simply to not break the current API?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions