From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- sys/osb/ipak16.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 sys/osb/ipak16.c (limited to 'sys/osb/ipak16.c') diff --git a/sys/osb/ipak16.c b/sys/osb/ipak16.c new file mode 100644 index 00000000..94670857 --- /dev/null +++ b/sys/osb/ipak16.c @@ -0,0 +1,20 @@ +#define import_spp +#define import_knames +#include + +/* IPAK16 - Pack an array of native ints into and array of 16-bit short. + */ +void +IPAK16 (void *a, void *b, XINT *nelems) +{ + /* MACHDEP - Works only for little-endian systems (e.g. x86) + */ + int i = 0; + int *ip = (int *) a; + short *op = (short *) b; + + for (i=0; i < *nelems; i++) { + *op = (int) *ip; + op++, ip++; + } +} -- cgit