/* Copyright (c) 1979 Regents of the University of California */
static char sccsid
[] = "@(#)PACK.c 1.3 %G%";
* with: a: array[m..n] of t
* z: packed array[u..v] of t
* semantics: for j := u to v do
* 2. i+(v-u) <= n (i.e. i-m <= (n-m)-(v-u))
* on stack: lv(z), lv(a), rv(i) (len 4)
* move w(t)*(v-u+1) bytes from lv(a)+w(t)*(i-m) to lv(z)
PACK(i
, a
, z
, size_a
, lb_a
, ub_a
, size_z
)
long i
; /* subscript into a to begin packing */
char *a
; /* pointer to structure a */
char *z
; /* pointer to structure z */
long size_a
; /* sizeof(a_type) */
long lb_a
; /* lower bound of structure a */
long ub_a
; /* (upper bound of a) - (lb_a + sizeof(z_type)) */
long size_z
; /* sizeof(z_type) */
if (subscr
< 0 || subscr
> ub_a
) {
ERROR("i = %D: Bad i to pack(a,i,z)\n", i
);
cp
= &a
[subscr
* size_a
];