Module Name:    src
Committed By:   joerg
Date:           Mon Nov 11 15:40:42 UTC 2019

Modified Files:
        src/usr.bin/audio/play: play.c

Log Message:
Spell the largest 32bit signed value as INT32_MAX. Explicitly cast to
float, because it is not precisely representable.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/usr.bin/audio/play/play.c

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

Modified files:

Index: src/usr.bin/audio/play/play.c
diff -u src/usr.bin/audio/play/play.c:1.59 src/usr.bin/audio/play/play.c:1.60
--- src/usr.bin/audio/play/play.c:1.59	Sat Nov  9 12:54:34 2019
+++ src/usr.bin/audio/play/play.c	Mon Nov 11 15:40:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: play.c,v 1.59 2019/11/09 12:54:34 mrg Exp $	*/
+/*	$NetBSD: play.c,v 1.60 2019/11/11 15:40:42 joerg Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000, 2001, 2002, 2010, 2015, 2019 Matthew R. Green
@@ -28,7 +28,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: play.c,v 1.59 2019/11/09 12:54:34 mrg Exp $");
+__RCSID("$NetBSD: play.c,v 1.60 2019/11/11 15:40:42 joerg Exp $");
 #endif
 
 #include <sys/param.h>
@@ -236,7 +236,7 @@ float32_to_linear32(void *inbuf, void *o
 			f = 1.0;
 
 		/* Convert -1.0 to +1.0 into a 32 bit signed value */
-		i = f * ((1u << 31) - 1);
+		i = f * (float)INT32_MAX;
 
 		memcpy(outbuf8, &i, sizeof i);
 

Reply via email to