aboutsummaryrefslogtreecommitdiff
path: root/sys/osb/ipak16.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/osb/ipak16.c')
-rw-r--r--sys/osb/ipak16.c20
1 files changed, 20 insertions, 0 deletions
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 <iraf.h>
+
+/* 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++;
+ }
+}