File:  [MW Coherent from dump] / coherent / d / usr / lib / libmp / mcopy.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:38 2019 UTC (7 years, 2 months ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

#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);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.