Replace magic numbers for console bell types with defines.

This commit is contained in:
Ruslan Ermilov 2006-11-16 12:27:51 +00:00
parent 79ba24ca87
commit 5a66b66324
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=164333
2 changed files with 5 additions and 5 deletions

View File

@ -769,11 +769,11 @@ scioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
return 0;
case CONS_BELLTYPE: /* set bell type sound/visual */
if ((*(int *)data) & 0x01)
if ((*(int *)data) & CONS_VISUAL_BELL)
sc->flags |= SC_VISUAL_BELL;
else
sc->flags &= ~SC_VISUAL_BELL;
if ((*(int *)data) & 0x02)
if ((*(int *)data) & CONS_QUIET_BELL)
sc->flags |= SC_QUIET_BELL;
else
sc->flags &= ~SC_QUIET_BELL;

View File

@ -907,11 +907,11 @@ set_bell_values(char *opt)
bell = 0;
if (!strncmp(opt, "quiet.", 6)) {
bell = 2;
bell = CONS_QUIET_BELL;
opt += 6;
}
if (!strcmp(opt, "visual"))
bell |= 1;
bell |= CONS_VISUAL_BELL;
else if (!strcmp(opt, "normal"))
duration = 5, pitch = 800;
else if (!strcmp(opt, "off"))
@ -936,7 +936,7 @@ set_bell_values(char *opt)
}
ioctl(0, CONS_BELLTYPE, &bell);
if ((bell & ~2) == 0)
if (!(bell & CONS_VISUAL_BELL))
fprintf(stderr, "[=%d;%dB", pitch, duration);
}