aboutsummaryrefslogtreecommitdiff
path: root/sys/osb/iupk16.c
blob: 10b5c064ca40e7662845c081875e65470e149246 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#define import_spp
#define import_knames
#include <iraf.h>


/* IUPK16 - Unpack 16-bit int into and array of native integers.
 */
void
IUPK16 (void *a, void *b, XINT *nelems)
{
	int    i;
	int   *op = (int *) calloc (*nelems, sizeof (int)), *tmp;
	short *ip = (short *) a;

	tmp = op;
	for (i=0; i < *nelems; i++)
	    *tmp++ = *ip++;

	memmove (b, op, *nelems * sizeof (int));
	free (op);
}