avoid nested variables

This commit is contained in:
christos 2005-05-29 22:12:26 +00:00
parent 9b1843d7c2
commit d675f4acb4
1 changed files with 11 additions and 11 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: spkr.c,v 1.17 2005/03/21 17:16:10 xtraeme Exp $ */
/* $NetBSD: spkr.c,v 1.18 2005/05/29 22:12:26 christos Exp $ */
/*
* Copyright (c) 1990 Eric S. Raymond (esr@snark.thyrsus.com)
@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: spkr.c,v 1.17 2005/03/21 17:16:10 xtraeme Exp $");
__KERNEL_RCSID(0, "$NetBSD: spkr.c,v 1.18 2005/05/29 22:12:26 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -93,11 +93,11 @@ static void playtone(int, int, int);
static void playstring(char *, int);
static
void tone(hz, ticks)
void tone(xhz, ticks)
/* emit tone of frequency hz for given number of ticks */
u_int hz, ticks;
u_int xhz, ticks;
{
pcppi_bell(ppicookie, hz, ticks, PCPPI_BELL_SLEEP);
pcppi_bell(ppicookie, xhz, ticks, PCPPI_BELL_SLEEP);
}
static void
@ -190,9 +190,9 @@ playinit()
}
static void
playtone(pitch, value, sustain)
playtone(pitch, val, sustain)
/* play tone of proper duration for current rhythm signature */
int pitch, value, sustain;
int pitch, val, sustain;
{
int sound, silence, snum = 1, sdenom = 1;
@ -204,12 +204,12 @@ playtone(pitch, value, sustain)
}
if (pitch == -1)
rest(whole * snum / (value * sdenom));
rest(whole * snum / (val * sdenom));
else
{
sound = (whole * snum) / (value * sdenom)
- (whole * (FILLTIME - fill)) / (value * FILLTIME);
silence = whole * (FILLTIME-fill) * snum / (FILLTIME * value * sdenom);
sound = (whole * snum) / (val * sdenom)
- (whole * (FILLTIME - fill)) / (val * FILLTIME);
silence = whole * (FILLTIME-fill) * snum / (FILLTIME * val * sdenom);
#ifdef SPKRDEBUG
printf("playtone: pitch %d for %d ticks, rest for %d ticks\n",