Module Name: src
Committed By: jakllsch
Date: Mon Jan 30 14:55:17 UTC 2017
Modified Files:
src/usr.sbin/bta2dpd/cosdata-gen: cosdata.c
src/usr.sbin/bta2dpd/sbc_crc-gen: sbc_crc.c
Log Message:
Improve portability baseline of bta2dpd's cosdata-gen and sbc_crc-gen hostprogs.
XXX why are these being generated at build time?
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/bta2dpd/cosdata-gen/cosdata.c
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/bta2dpd/sbc_crc-gen/sbc_crc.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/bta2dpd/cosdata-gen/cosdata.c
diff -u src/usr.sbin/bta2dpd/cosdata-gen/cosdata.c:1.1 src/usr.sbin/bta2dpd/cosdata-gen/cosdata.c:1.2
--- src/usr.sbin/bta2dpd/cosdata-gen/cosdata.c:1.1 Sat Jan 28 16:55:54 2017
+++ src/usr.sbin/bta2dpd/cosdata-gen/cosdata.c Mon Jan 30 14:55:17 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: cosdata.c,v 1.1 2017/01/28 16:55:54 nat Exp $ */
+/* $NetBSD: cosdata.c,v 1.2 2017/01/30 14:55:17 jakllsch Exp $ */
/*-
* Copyright (c) 2015 - 2016 Nathanial Sloss <[email protected]>
@@ -89,7 +89,7 @@ main (void)
printf("#define COEFFSMULTI\t%d\n\n", vali);
printf("static const int32_t sbc_coeffs8[] = {\n ");
- for (k = 0;k < (int)__arraycount(sbc8_coeffs);k++) {
+ for (k = 0;k < (int)(sizeof(sbc8_coeffs)/sizeof(sbc8_coeffs[0]));k++) {
if (count % 8 == 0 && count != 0)
printf("\n ");
val = (float)(sbc8_coeffs[k] * COEFFS_MULTI);
@@ -101,7 +101,7 @@ main (void)
count = 0;
printf("static const int32_t sbc_coeffs4[] = {\n ");
- for (k = 0;k < (int)__arraycount(sbc4_coeffs);k++) {
+ for (k = 0;k < (int)(sizeof(sbc4_coeffs)/sizeof(sbc4_coeffs[0]));k++) {
if (count % 8 == 0 && count != 0)
printf("\n ");
val = (float)(sbc4_coeffs[k] * COEFFS_MULTI);
Index: src/usr.sbin/bta2dpd/sbc_crc-gen/sbc_crc.c
diff -u src/usr.sbin/bta2dpd/sbc_crc-gen/sbc_crc.c:1.1 src/usr.sbin/bta2dpd/sbc_crc-gen/sbc_crc.c:1.2
--- src/usr.sbin/bta2dpd/sbc_crc-gen/sbc_crc.c:1.1 Sat Jan 28 16:55:54 2017
+++ src/usr.sbin/bta2dpd/sbc_crc-gen/sbc_crc.c Mon Jan 30 14:55:17 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sbc_crc.c,v 1.1 2017/01/28 16:55:54 nat Exp $ */
+/* $NetBSD: sbc_crc.c,v 1.2 2017/01/30 14:55:17 jakllsch Exp $ */
/*-
* Copyright (c) 2015 Nathanial Sloss <[email protected]>
@@ -31,14 +31,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/types.h>
#include <stdio.h>
int
main()
{
int j, i, k, numbits;
- uint8_t data;
+ unsigned int data;
printf("/* sbc_crc.h - Automatically generated by sbc_crc.c. */\n\n");
@@ -61,7 +60,7 @@ main()
if (i % 8 == 0 && i != 0)
printf("\n ");
- printf("0x%02x, ",data);
+ printf("0x%02x, ",data & 0xff);
}
printf("\n};\n\n");