You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: