From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- 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