code: drawterm

ref: 01028c1dd99ddce82c70ce1e789037ffbce9e8a6
dir: /libmp/mpfield.c/

View raw version
#include "os.h"
#include <mp.h>
#include "dat.h"

mpint*
mpfield(mpint *N)
{
	Mfield *f;

	if(N == nil || N->flags & (MPfield|MPstatic))
		return N;
	if((f = cnfield(N)) != nil)
		goto Exchange;
	if((f = gmfield(N)) != nil)
		goto Exchange;
	return N;
Exchange:
	setmalloctag(f, getcallerpc(&N));
	mpfree(N);
	return (mpint*)f;
}