From: miles@lsi.nec.co.jp (Miles Bader)
To: Linus Torvalds <torvalds@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] v850: Get rid of lvalue-casts in memset.c to make gcc happy
Date: Mon, 5 Jul 2004 18:32:10 +0900 (JST) [thread overview]
Message-ID: <20040705093210.C27E5492@mctpc71> (raw)
Signed-off-by: Miles Bader <miles@gnu.org>
arch/v850/lib/memset.c | 25 ++++++++++++++++---------
1 files changed, 16 insertions(+), 9 deletions(-)
diff -ruN -X../cludes linux-2.6.7-uc0/arch/v850/lib/memset.c linux-2.6.7-uc0-v850-20040705/arch/v850/lib/memset.c
--- linux-2.6.7-uc0/arch/v850/lib/memset.c 2002-11-05 11:25:22.000000000 +0900
+++ linux-2.6.7-uc0-v850-20040705/arch/v850/lib/memset.c 2004-07-05 18:20:43.000000000 +0900
@@ -1,8 +1,8 @@
/*
* arch/v850/lib/memset.c -- Memory initialization
*
- * Copyright (C) 2001,02 NEC Corporation
- * Copyright (C) 2001,02 Miles Bader <miles@gnu.org>
+ * Copyright (C) 2001,02,04 NEC Corporation
+ * Copyright (C) 2001,02,04 Miles Bader <miles@gnu.org>
*
* This file is subject to the terms and conditions of the GNU General
* Public License. See the file COPYING in the main directory of this
@@ -26,11 +26,13 @@
/* copy initial unaligned bytes. */
if ((long)ptr & 1) {
- *((char *)ptr)++ = val;
+ *(char *)ptr = val;
+ ptr = (void *)((char *)ptr + 1);
count--;
}
if (count > 2 && ((long)ptr & 2)) {
- *((short *)ptr)++ = val;
+ *(short *)ptr = val;
+ ptr = (void *)((short *)ptr + 1);
count -= 2;
}
@@ -46,15 +48,20 @@
count %= 32;
/* long copying loop. */
- for (loop = count / 4; loop; loop--)
- *((long *)ptr)++ = val;
+ for (loop = count / 4; loop; loop--) {
+ *(long *)ptr = val;
+ ptr = (void *)((long *)ptr + 1);
+ }
count %= 4;
/* finish up with any trailing bytes. */
- if (count & 2)
- *((short *)ptr)++ = val;
- if (count & 1)
+ if (count & 2) {
+ *(short *)ptr = val;
+ ptr = (void *)((short *)ptr + 1);
+ }
+ if (count & 1) {
*(char *)ptr = val;
+ }
}
return dst;
reply other threads:[~2004-07-05 9:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040705093210.C27E5492@mctpc71 \
--to=miles@lsi.nec.co.jp \
--cc=linux-kernel@vger.kernel.org \
--cc=miles@gnu.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.