From owner-svn-src-head@freebsd.org Sat Dec 2 00:07:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB2B2DBB262; Sat, 2 Dec 2017 00:07:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFBE777AE6; Sat, 2 Dec 2017 00:07:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vB207KIF033864; Sat, 2 Dec 2017 00:07:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vB207KTY033860; Sat, 2 Dec 2017 00:07:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712020007.vB207KTY033860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 2 Dec 2017 00:07:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326445 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 326445 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Dec 2017 00:07:23 -0000 Author: imp Date: Sat Dec 2 00:07:19 2017 New Revision: 326445 URL: https://svnweb.freebsd.org/changeset/base/326445 Log: Fix random() and srandom() prototypes to match the standard. These prototypes were needlessly different from the standard. Fix them to be the same, and fix the surrounding code after the changes. Sponsored by: Netflix Modified: head/stand/libsa/libstand.3 head/stand/libsa/random.c head/stand/libsa/stand.h Modified: head/stand/libsa/libstand.3 ============================================================================== --- head/stand/libsa/libstand.3 Sat Dec 2 00:07:14 2017 (r326444) +++ head/stand/libsa/libstand.3 Sat Dec 2 00:07:19 2017 (r326445) @@ -169,10 +169,10 @@ may be used to prevent a variable being unset. .Xc .It Xo .Ft void -.Fn srandom "unsigned long seed" +.Fn srandom "unsigned int seed" .Xc .It Xo -.Ft "unsigned long" +.Ft "long" .Fn random void .Xc .It Xo Modified: head/stand/libsa/random.c ============================================================================== --- head/stand/libsa/random.c Sat Dec 2 00:07:14 2017 (r326444) +++ head/stand/libsa/random.c Sat Dec 2 00:07:19 2017 (r326445) @@ -34,12 +34,12 @@ __FBSDID("$FreeBSD$"); #include -static u_long randseed = 1; +static long randseed = 1; void -srandom(seed) - u_long seed; +srandom(unsigned int seed) { + randseed = seed; } @@ -48,8 +48,8 @@ srandom(seed) * and whatever else we might use it for. The result is uniform on * [0, 2^31 - 1]. */ -u_long -random() +long +random(void) { long x, hi, lo, t; Modified: head/stand/libsa/stand.h ============================================================================== --- head/stand/libsa/stand.h Sat Dec 2 00:07:14 2017 (r326444) +++ head/stand/libsa/stand.h Sat Dec 2 00:07:19 2017 (r326445) @@ -281,7 +281,7 @@ extern ssize_t read(int, void *, size_t); extern ssize_t write(int, void *, size_t); extern struct dirent *readdirfd(int); -extern void srandom(u_long seed); +extern void srandom(unsigned int); extern u_long random(void); /* imports from stdlib, locally modified */