Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F101992873
D47191.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1000 B
Referenced Files
None
Subscribers
None
D47191.diff
View Options
diff --git a/usr.bin/mididump/mididump.c b/usr.bin/mididump/mididump.c
--- a/usr.bin/mididump/mididump.c
+++ b/usr.bin/mididump/mididump.c
@@ -28,6 +28,7 @@
* SUCH DAMAGE.
*/
+#include <sys/param.h>
#include <sys/soundcard.h>
#include <err.h>
@@ -39,7 +40,6 @@
#include <string.h>
#include <unistd.h>
-#define ARRLEN(x) (sizeof(x) / sizeof(x[0]))
#define NOTE2OCTAVE(n) (n / 12 - 1)
#define NOTE2FREQ(n) (440 * pow(2.0f, ((float)n - 69) / 12))
#define CHAN_MASK 0x0f
@@ -189,7 +189,7 @@
case 0x90 ... 0x9f:
b1 = read_byte(fd);
b2 = read_byte(fd);
- pn = ¬es[b1 % ARRLEN(notes)];
+ pn = ¬es[b1 % nitems(notes)];
snprintf(buf, sizeof(buf), "%s%d", pn->name,
NOTE2OCTAVE(b1));
if (pn->alt != NULL) {
@@ -211,7 +211,7 @@
case 0xb0 ... 0xbf:
b1 = read_byte(fd);
b2 = read_byte(fd);
- if (b1 > ARRLEN(ctls) - 1)
+ if (b1 > nitems(ctls) - 1)
break;
printf("Control/Mode change channel=%d, "
"control=%d (%s), value=%d",
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 7, 7:24 AM (17 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14277401
Default Alt Text
D47191.diff (1000 B)
Attached To
Mode
D47191: mididump(1): Use nitems()
Attached
Detach File
Event Timeline
Log In to Comment