Module Name: src
Committed By: christos
Date: Thu Sep 26 01:37:53 UTC 2019
Modified Files:
src/sys/compat/ossaudio: ossaudio.c
Log Message:
- "source" is u_long in the kernel (and int in userland). Cast -1 to u_long.
- make "s" unsigned since blocksize is too.
To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/compat/ossaudio/ossaudio.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/compat/ossaudio/ossaudio.c
diff -u src/sys/compat/ossaudio/ossaudio.c:1.75 src/sys/compat/ossaudio/ossaudio.c:1.76
--- src/sys/compat/ossaudio/ossaudio.c:1.75 Fri Aug 23 08:42:14 2019
+++ src/sys/compat/ossaudio/ossaudio.c Wed Sep 25 21:37:52 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ossaudio.c,v 1.75 2019/08/23 12:42:14 maxv Exp $ */
+/* $NetBSD: ossaudio.c,v 1.76 2019/09/26 01:37:52 christos Exp $ */
/*-
* Copyright (c) 1997, 2008 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ossaudio.c,v 1.75 2019/08/23 12:42:14 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ossaudio.c,v 1.76 2019/09/26 01:37:52 christos Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@@ -1087,7 +1087,7 @@ oss_ioctl_mixer(struct lwp *lwp, const s
}
break;
case OSS_SOUND_MIXER_READ_RECSRC:
- if (di->source == -1) {
+ if (di->source == (u_long)-1) {
DPRINTF(("%s: OSS_SOUND_MIXER_READ_RECSRC bad source\n",
__func__));
error = EINVAL;
@@ -1132,7 +1132,7 @@ oss_ioctl_mixer(struct lwp *lwp, const s
break;
case OSS_SOUND_MIXER_WRITE_RECSRC:
case OSS_SOUND_MIXER_WRITE_R_RECSRC:
- if (di->source == -1) {
+ if (di->source == (u_long)-1) {
DPRINTF(("%s: OSS_SOUND_MIXER_WRITE_RECSRC bad "
"source\n", __func__));
error = EINVAL;
@@ -1492,11 +1492,11 @@ static void
setblocksize(file_t *fp, struct audio_info *info)
{
struct audio_info set;
- int s;
+ u_int s;
- if (info->blocksize & (info->blocksize-1)) {
+ if (info->blocksize & (info->blocksize - 1)) {
for(s = 32; s < info->blocksize; s <<= 1)
- ;
+ continue;
AUDIO_INITINFO(&set);
set.blocksize = s;
fp->f_ops->fo_ioctl(fp, AUDIO_SETINFO, &set);