git: 8bebcb26763a - stable/14 - speaker: Use standard C bool
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 30 Nov 2024 16:51:04 UTC
The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8bebcb26763a8d80c255b2c9367d510e98da17b4 commit 8bebcb26763a8d80c255b2c9367d510e98da17b4 Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2024-02-05 23:40:34 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2024-11-30 13:55:57 +0000 speaker: Use standard C bool Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D43717 (cherry picked from commit c83d83206a39c7c47139acac46885bea54ee4876) --- sys/dev/speaker/spkr.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/sys/dev/speaker/spkr.c b/sys/dev/speaker/spkr.c index b1bbfe95510c..2a48f8f3daa8 100644 --- a/sys/dev/speaker/spkr.c +++ b/sys/dev/speaker/spkr.c @@ -122,12 +122,6 @@ rest(int centisecs) * except possibly at physical block boundaries. */ -#ifndef __bool_true_false_are_defined -typedef int bool; -#endif -#define TRUE 1 -#define FALSE 0 - #define dtoi(c) ((c) - '0') static int octave; /* currently selected octave */ @@ -183,8 +177,8 @@ playinit(void) whole = (100 * SECS_PER_MIN * WHOLE_NOTE) / DFLT_TEMPO; fill = NORMAL; value = DFLT_VALUE; - octtrack = FALSE; - octprefix = TRUE; /* act as though there was an initial O(n) */ + octtrack = false; + octprefix = true; /* act as though there was an initial O(n) */ } /* @@ -281,7 +275,7 @@ playstring(char *cp, size_t slen) pitch -= OCTAVE_NOTES; } } - octprefix = FALSE; + octprefix = false; lastpitch = pitch; /* ...which may in turn be followed by an override time value */ @@ -310,29 +304,29 @@ playstring(char *cp, size_t slen) break; case 'O': if (cp[1] == 'N' || cp[1] == 'n') { - octprefix = octtrack = FALSE; + octprefix = octtrack = false; ++cp; slen--; } else if (cp[1] == 'L' || cp[1] == 'l') { - octtrack = TRUE; + octtrack = true; ++cp; slen--; } else { GETNUM(cp, octave); if (octave >= nitems(pitchtab) / OCTAVE_NOTES) octave = DFLT_OCTAVE; - octprefix = TRUE; + octprefix = true; } break; case '>': if (octave < nitems(pitchtab) / OCTAVE_NOTES - 1) octave++; - octprefix = TRUE; + octprefix = true; break; case '<': if (octave > 0) octave--; - octprefix = TRUE; + octprefix = true; break; case 'N': GETNUM(cp, pitch); @@ -397,7 +391,7 @@ playstring(char *cp, size_t slen) * endtone(), and rest() functions defined above. */ -static int spkr_active = FALSE; /* exclusion flag */ +static bool spkr_active = false; /* exclusion flag */ static char *spkr_inbuf; /* incoming buf */ static int @@ -415,7 +409,7 @@ spkropen(struct cdev *dev, int flags, int fmt, struct thread *td) #endif /* DEBUG */ playinit(); spkr_inbuf = malloc(DEV_BSIZE, M_SPKR, M_WAITOK); - spkr_active = TRUE; + spkr_active = true; return(0); } } @@ -456,7 +450,7 @@ spkrclose(struct cdev *dev, int flags, int fmt, struct thread *td) wakeup(&endtone); wakeup(&endrest); free(spkr_inbuf, M_SPKR); - spkr_active = FALSE; + spkr_active = false; return(0); }