From dca5b5ca2e3687f27ebf589fe3855966932840d8 Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 10 Aug 2007 17:17:42 +0000 Subject: avoid assignments in declarations --- string.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'string.c') diff --git a/string.c b/string.c index dc73266..a871b68 100644 --- a/string.c +++ b/string.c @@ -4,8 +4,9 @@ void* memset(void *dst, int c, uint n) { - char *d = (char*) dst; + char *d; + d = (char*)dst; while(n-- > 0) *d++ = c; @@ -15,12 +16,13 @@ memset(void *dst, int c, uint n) int memcmp(const void *v1, const void *v2, uint n) { - const uchar *s1 = (const uchar*) v1; - const uchar *s2 = (const uchar*) v2; - + const uchar *s1, *s2; + + s1 = v1; + s2 = v2; while(n-- > 0) { if(*s1 != *s2) - return (int) *s1 - (int) *s2; + return *s1 - *s2; s1++, s2++; } -- cgit v1.2.3