|
|
DataMuseum.dkPresents historical artifacts from the history of: Commodore CBM-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Commodore CBM-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 568 (0x238)
Types: TextFile
Notes: UNIX file
Names: »mcopy.c«
└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
└─⟦f4b8d8c84⟧ UNIX Filesystem
└─⟦this⟧ »libmp/mcopy.c«
#include "mprec.h"
#include <assert.h>
/*
* Mcopy sets the mint pointed to by "b" to a copy of the mint
* pointed to by "a". This is used when a scratch copy is needed.
*/
void
mcopy(a, b)
register mint *a, *b;
{
register char *ap, *bp;
register unsigned count;
/* throw away old value and allocate space for new one */
mpfree(b->val);
b->val = (char *)mpalc(a->len);
b->len = a->len;
/* copy value */
ap = a->val;
bp = b->val;
count = a->len;
while (count-- != 0)
*bp++ = *ap++;
assert(bp == b->val + b->len);
assert(ap == a->val + a->len);
}