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
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
-fpermissivemay help to highlight these spots.Andrea