Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/bta2dpd Improve portability baseline of bta2dpd's c...
details: https://anonhg.NetBSD.org/src/rev/6bc35c8b3290
branches: trunk
changeset: 351005:6bc35c8b3290
user: jakllsch <jakllsch%NetBSD.org@localhost>
date: Mon Jan 30 14:55:17 2017 +0000
description:
Improve portability baseline of bta2dpd's cosdata-gen and sbc_crc-gen hostprogs.
XXX why are these being generated at build time?
diffstat:
usr.sbin/bta2dpd/cosdata-gen/cosdata.c | 6 +++---
usr.sbin/bta2dpd/sbc_crc-gen/sbc_crc.c | 7 +++----
2 files changed, 6 insertions(+), 7 deletions(-)
diffs (61 lines):
diff -r 72f880eceefc -r 6bc35c8b3290 usr.sbin/bta2dpd/cosdata-gen/cosdata.c
--- a/usr.sbin/bta2dpd/cosdata-gen/cosdata.c Mon Jan 30 13:27:26 2017 +0000
+++ b/usr.sbin/bta2dpd/cosdata-gen/cosdata.c Mon Jan 30 14:55:17 2017 +0000
@@ -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 <nathanialsloss%yahoo.com.au@localhost>
@@ -89,7 +89,7 @@
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 @@
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);
diff -r 72f880eceefc -r 6bc35c8b3290 usr.sbin/bta2dpd/sbc_crc-gen/sbc_crc.c
--- a/usr.sbin/bta2dpd/sbc_crc-gen/sbc_crc.c Mon Jan 30 13:27:26 2017 +0000
+++ b/usr.sbin/bta2dpd/sbc_crc-gen/sbc_crc.c Mon Jan 30 14:55:17 2017 +0000
@@ -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 <nathanialsloss%yahoo.com.au@localhost>
@@ -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 @@
if (i % 8 == 0 && i != 0)
printf("\n ");
- printf("0x%02x, ",data);
+ printf("0x%02x, ",data & 0xff);
}
printf("\n};\n\n");
Home |
Main Index |
Thread Index |
Old Index