From b3cc01b02bd728a8b10e362b6f23566cbd451003 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 26 Nov 2002 18:11:51 +0000 Subject: [PATCH] * libc/string/memset.c (memset): Move initialization of 'd' earlier in function. --- newlib/ChangeLog | 5 +++++ newlib/libc/string/memset.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index bc0eec6c5..c0f55f3b4 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,8 @@ +2002-11-26 Christopher Faylor + + * libc/string/memset.c (memset): Move initialization of 'd' earlier in + function. + 2002-11-25 Christopher Faylor * libc/string/memset.c (memset): Minor optimization: Use new 'd' diff --git a/newlib/libc/string/memset.c b/newlib/libc/string/memset.c index 41b7d03ba..6f98cac62 100644 --- a/newlib/libc/string/memset.c +++ b/newlib/libc/string/memset.c @@ -59,13 +59,13 @@ _DEFUN (memset, (m, c, n), int i; unsigned long buffer; unsigned long *aligned_addr; + unsigned int d = c & 0xff; if (!TOO_SMALL (n) && !UNALIGNED (m)) { /* If we get this far, we know that n is large and m is word-aligned. */ /* To avoid sign extention, copy C to an unsigned variable. */ - unsigned int d = c & 0xff; aligned_addr = (unsigned long*)m;