From 06523c4f449484469df30aa05bf99eaa60a67e04 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 26 Apr 2009 19:36:53 +0000 Subject: [PATCH] (get_mapping): Avoid casts to avoid warnings. --- nscd/nscd_helper.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nscd/nscd_helper.c b/nscd/nscd_helper.c index 7db5d09845..cd3fa24196 100644 --- a/nscd/nscd_helper.c +++ b/nscd/nscd_helper.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998-2007, 2008 Free Software Foundation, Inc. +/* Copyright (C) 1998-2007, 2008, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1998. @@ -318,7 +318,7 @@ get_mapping (request_type type, const char *key, /* This access is well-aligned since BUF is correctly aligned for an int and CMSG_DATA preserves this alignment. */ - *(int *) CMSG_DATA (cmsg) = -1; + memset (CMSG_DATA (cmsg), '\xff', sizeof (int)); msg.msg_controllen = cmsg->cmsg_len; @@ -335,7 +335,8 @@ get_mapping (request_type type, const char *key, != CMSG_LEN (sizeof (int))), 0)) goto out_close2; - mapfd = *(int *) CMSG_DATA (cmsg); + int *ip = (void *) CMSG_DATA (cmsg); + mapfd = *ip; if (__builtin_expect (n != keylen && n != keylen + sizeof (mapsize), 0)) goto out_close; -- 2.11.4.GIT