Module Name: src
Committed By: martin
Date: Thu Aug 3 08:05:16 UTC 2023
Modified Files:
src/sys/dev [netbsd-8]: spkr.c
Log Message:
Apply addition patch to fix the build, requested by riastradh
in ticket #1868:
sys/dev/spkr.c (apply patch)
Pacify -Wsign-compare.
To generate a diff of this commit:
cvs rdiff -u -r1.7.2.1 -r1.7.2.2 src/sys/dev/spkr.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/spkr.c
diff -u src/sys/dev/spkr.c:1.7.2.1 src/sys/dev/spkr.c:1.7.2.2
--- src/sys/dev/spkr.c:1.7.2.1 Tue Aug 1 13:05:57 2023
+++ src/sys/dev/spkr.c Thu Aug 3 08:05:16 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: spkr.c,v 1.7.2.1 2023/08/01 13:05:57 martin Exp $ */
+/* $NetBSD: spkr.c,v 1.7.2.2 2023/08/03 08:05:16 martin Exp $ */
/*
* Copyright (c) 1990 Eric S. Raymond ([email protected])
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spkr.c,v 1.7.2.1 2023/08/01 13:05:57 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spkr.c,v 1.7.2.2 2023/08/03 08:05:16 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -164,7 +164,7 @@ playtone(struct spkr_softc *sc, int pitc
* snum / (val * sdenom));
return;
}
- KASSERTMSG(pitch < __arraycount(pitchtab), "pitch=%d", pitch);
+ KASSERTMSG((size_t)pitch < __arraycount(pitchtab), "pitch=%d", pitch);
int fac = sc->sc_whole * (FILLTIME - sc->sc_fill);
int fval = FILLTIME * val;
@@ -300,7 +300,7 @@ playstring(struct spkr_softc *sc, const
case 'N':
GETNUM(cp, pitch);
KASSERTMSG(pitch >= 0, "pitch=%d", pitch);
- if (pitch >= __arraycount(pitchtab))
+ if ((size_t)pitch >= __arraycount(pitchtab))
break;
for (sustain = 0; slen > 0 && cp[1] == '.'; cp++) {
slen--;