Received: by mail.netbsd.org (Postfix, from userid 605) id 3CA1984DBF; Mon, 4 May 2020 01:37:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id BA5C884DB5 for ; Mon, 4 May 2020 01:37:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id cywOOgnbTHDa for ; Mon, 4 May 2020 01:37:55 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id 18C6D84CE9 for ; Mon, 4 May 2020 01:37:55 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 16630FB27; Mon, 4 May 2020 01:37:55 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1588556274236780" MIME-Version: 1.0 Date: Mon, 4 May 2020 01:37:54 +0000 From: "Alistair G. Crooks" Subject: CVS commit: pkgsrc/security/netpgpverify/files To: pkgsrc-changes@NetBSD.org Reply-To: agc@netbsd.org X-Mailer: log_accum Message-Id: <20200504013755.16630FB27@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1588556274236780 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: agc Date: Mon May 4 01:37:54 UTC 2020 Modified Files: pkgsrc/security/netpgpverify/files: sha2.c Log Message: bring over changes from src - cast return values To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 pkgsrc/security/netpgpverify/files/sha2.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1588556274236780 Content-Disposition: inline Content-Length: 1321 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/security/netpgpverify/files/sha2.c diff -u pkgsrc/security/netpgpverify/files/sha2.c:1.5 pkgsrc/security/netpgpverify/files/sha2.c:1.6 --- pkgsrc/security/netpgpverify/files/sha2.c:1.5 Wed Sep 2 17:15:09 2015 +++ pkgsrc/security/netpgpverify/files/sha2.c Mon May 4 01:37:54 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: sha2.c,v 1.5 2015/09/02 17:15:09 jperkin Exp $ */ +/* $NetBSD: sha2.c,v 1.6 2020/05/04 01:37:54 agc Exp $ */ /* $KAME: sha2.c,v 1.9 2003/07/20 00:28:38 itojun Exp $ */ /* @@ -48,7 +48,9 @@ # undef be32toh # undef be64toh +#ifndef __CAST #define __CAST(__dt, __st) ((__dt)(__st)) /* srsly? */ +#endif static __inline void be32encode(void *buf, uint32_t u) @@ -76,7 +78,7 @@ htobe32(uint32_t x) uint8_t p[4]; memcpy(p, &x, 4); - return ((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]); + return (((uint32_t)p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]); } static uint64_t @@ -86,8 +88,8 @@ htobe64(uint64_t x) uint32_t u, v; memcpy(p, &x, 8); - u = ((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]); - v = ((p[4] << 24) | (p[5] << 16) | (p[6] << 8) | p[7]); + u = (((uint32_t)p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]); + v = (((uint32_t)p[4] << 24) | (p[5] << 16) | (p[6] << 8) | p[7]); return ((((uint64_t)u) << 32) | v); } --_----------=_1588556274236780--