Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Jul 2013 16:27:11 +0000 (UTC)
From:      Andre Oppermann <andre@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r253214 - head/sys/crypto/siphash
Message-ID:  <201307111627.r6BGRBUa037942@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andre
Date: Thu Jul 11 16:27:11 2013
New Revision: 253214
URL: http://svnweb.freebsd.org/changeset/base/253214

Log:
  Fix const propagation issues to make GCC happy.
  
  Submitted by:	Michael Butler <imb@protected-networks.net>

Modified:
  head/sys/crypto/siphash/siphash.c

Modified: head/sys/crypto/siphash/siphash.c
==============================================================================
--- head/sys/crypto/siphash/siphash.c	Thu Jul 11 15:55:57 2013	(r253213)
+++ head/sys/crypto/siphash/siphash.c	Thu Jul 11 16:27:11 2013	(r253214)
@@ -119,7 +119,8 @@ SipBuf(SIPHASH_CTX *ctx, const uint8_t *
 void
 SipHash_Update(SIPHASH_CTX *ctx, const void *src, size_t len)
 {
-	uint64_t m, *p;
+	uint64_t m;
+	const uint64_t *p;
 	const uint8_t *s;
 	size_t rem;
 
@@ -144,13 +145,13 @@ SipHash_Update(SIPHASH_CTX *ctx, const v
 
 	/* Optimze for 64bit aligned/unaligned access. */
 	if (((uintptr_t)s & 0x7) == 0) {
-		for (p = (uint64_t *)s; len > 0; len--, p++) {
+		for (p = (const uint64_t *)s; len > 0; len--, p++) {
 			m = le64toh(*p);
 			ctx->v[3] ^= m;
 			SipRounds(ctx, 0);
 			ctx->v[0] ^= m;
 		}
-		s = (uint8_t *)p;
+		s = (const uint8_t *)p;
 	} else {
 		for (; len > 0; len--, s += 8) {
 			m = le64dec(s);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307111627.r6BGRBUa037942>