mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-07 06:43:00 +03:00
Use uintptr_t instead of performing pointer subtraction with a null pointer
Signed-off-by: Qihao Chencao <twose@qq.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
committed by
Adhemerval Zanella
parent
dab6344279
commit
cc4d6614b5
@@ -281,7 +281,7 @@ get_next_alias (FILE *stream, const char *match, struct aliasent *result,
|
||||
/* Adjust the pointer so it is aligned for
|
||||
storing pointers. */
|
||||
first_unused += __alignof__ (char *) - 1;
|
||||
first_unused -= ((first_unused - (char *) 0)
|
||||
first_unused -= (((uintptr_t) first_unused)
|
||||
% __alignof__ (char *));
|
||||
result->alias_members = (char **) first_unused;
|
||||
|
||||
|
@@ -239,7 +239,7 @@ parse_list (char **linep, char *eol, char *buf_end, int terminator_c,
|
||||
|
||||
/* Adjust the pointer so it is aligned for storing pointers. */
|
||||
eol += __alignof__ (char *) - 1;
|
||||
eol -= (eol - (char *) 0) % __alignof__ (char *);
|
||||
eol -= ((uintptr_t) eol) % __alignof__ (char *);
|
||||
/* We will start the storage here for the vector of pointers. */
|
||||
list = (char **) eol;
|
||||
|
||||
|
Reference in New Issue
Block a user