From: Jim Meyering Date: Tue, 29 Mar 2005 19:01:34 +0000 (+0000) Subject: (ptr_align): Declare `ptr' parameter to be a X-Git-Tag: CPPI-1_12~1155 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=68bc3503b86cfaa3b1d827eac654eb463f60eca4;p=thirdparty%2Fcoreutils.git (ptr_align): Declare `ptr' parameter to be a `const' pointer, since this function never writes through it. --- diff --git a/src/system.h b/src/system.h index 9916696c5a..fb81525362 100644 --- a/src/system.h +++ b/src/system.h @@ -803,11 +803,11 @@ lcm (size_t u, size_t v) locations. */ static inline void * -ptr_align (void *ptr, size_t alignment) +ptr_align (void const *ptr, size_t alignment) { - char *p0 = ptr; - char *p1 = p0 + alignment - 1; - return p1 - (size_t) p1 % alignment; + char const *p0 = ptr; + char const *p1 = p0 + alignment - 1; + return (void *) (p1 - (size_t) p1 % alignment); } /* Verify a requirement at compile-time (unlike assert, which is runtime). */