| 3060 | } |
| 3061 | |
| 3062 | staticfn char * |
| 3063 | trapnote(struct trap *trap, boolean noprefix) |
| 3064 | { |
| 3065 | static const char *const tnnames[] = { |
| 3066 | "C note", "D flat", "D note", "E flat", |
| 3067 | "E note", "F note", "F sharp", "G note", |
| 3068 | "G sharp", "A note", "B flat", "B note", |
| 3069 | }; |
| 3070 | static char tnbuf[12]; /* result buffer */ |
| 3071 | const char *tn; |
| 3072 | |
| 3073 | tnbuf[0] = '\0'; |
| 3074 | tn = tnnames[trap->tnote]; |
| 3075 | if (!noprefix) |
| 3076 | (void) just_an(tnbuf, tn); |
| 3077 | return strcat(tnbuf, tn); |
| 3078 | } |
| 3079 | |
| 3080 | /* choose a note not used by any trap on current level, |
| 3081 | ignoring ttmp; if all are in use, pick a random one */ |
no test coverage detected