Skip to content

Portable pointer size #89

@andrea-marchini

Description

@andrea-marchini

Hi,

cool project, thanks for sharing! I suggest to use a portable pointer size, e.g.:
#define vpu_align(ptr, align) (((unsigned int) ptr+(align)-1)/(align)*(align))
could be:
#define vpu_align(ptr, align) (((uintptr_t) ptr+(align)-1)/(align)*(align))
Because size of pointers depends on platforms, and uintptr_t is an unsigned integer type with the size of the pointer, independently from the platform. Using gcc flag -fpermissive may help to highlight these spots.

Andrea

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