Module Name:    src
Committed By:   christos
Date:           Mon Sep 23 18:17:03 UTC 2019

Modified Files:
        src/lib/libc/gen: arc4random.c

Log Message:
lint is not smart enough to figure out that ilog2() is constant.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libc/gen/arc4random.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/gen/arc4random.c
diff -u src/lib/libc/gen/arc4random.c:1.31 src/lib/libc/gen/arc4random.c:1.32
--- src/lib/libc/gen/arc4random.c:1.31	Fri Mar 25 18:13:23 2016
+++ src/lib/libc/gen/arc4random.c	Mon Sep 23 14:17:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: arc4random.c,v 1.31 2016/03/25 22:13:23 riastradh Exp $	*/
+/*	$NetBSD: arc4random.c,v 1.32 2019/09/23 18:17:03 christos Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: arc4random.c,v 1.31 2016/03/25 22:13:23 riastradh Exp $");
+__RCSID("$NetBSD: arc4random.c,v 1.32 2019/09/23 18:17:03 christos Exp $");
 
 #include "namespace.h"
 #include "reentrant.h"
@@ -355,9 +355,10 @@ crypto_onetimestream(const void *seed, v
 	 *	log_2 (o 2^(8 i)) = log_2 o + log_2 2^(8 i)
 	 *	  = log_2 o + 8 i.
 	 */
-	__CTASSERT(CHAR_BIT * sizeof n <=
-	    (/*LINTED*/ilog2(crypto_core_OUTPUTBYTES) +
-		8*crypto_core_INPUTBYTES));
+#ifndef __lint__
+	__CTASSERT(CHAR_BIT * sizeof n <= (ilog2(crypto_core_OUTPUTBYTES) +
+		8 * crypto_core_INPUTBYTES));
+#endif
 
 	p8 = buf;
 	p32 = (uint8_t *)roundup2((uintptr_t)p8, 4);

Reply via email to