summaryrefslogtreecommitdiff
path: root/sys/src/cmd/unix/drawterm/libmp/mptouv.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2013-11-23 01:05:33 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2013-11-23 01:05:33 +0100
commit2f9ae0f8ac8610e13ced184847b57b87fe5db580 (patch)
treef9ad2223d518585a2cfe9ea1c73e1e37d07bf637 /sys/src/cmd/unix/drawterm/libmp/mptouv.c
parentea5797c0731203c09ec5fb7172e77eab2750f1a9 (diff)
removing (outdated) drawterm
drawterm is much better maintained by russ cox, so removing this outdated copy. for a more recent version, go to: http://swtch.com/drawterm/
Diffstat (limited to 'sys/src/cmd/unix/drawterm/libmp/mptouv.c')
-rw-r--r--sys/src/cmd/unix/drawterm/libmp/mptouv.c49
1 files changed, 0 insertions, 49 deletions
diff --git a/sys/src/cmd/unix/drawterm/libmp/mptouv.c b/sys/src/cmd/unix/drawterm/libmp/mptouv.c
deleted file mode 100644
index 76f93dd7f..000000000
--- a/sys/src/cmd/unix/drawterm/libmp/mptouv.c
+++ /dev/null
@@ -1,49 +0,0 @@
-#include "os.h"
-#include <mp.h>
-#include "dat.h"
-
-#define VLDIGITS (sizeof(vlong)/sizeof(mpdigit))
-
-/*
- * this code assumes that a vlong is an integral number of
- * mpdigits long.
- */
-mpint*
-uvtomp(uvlong v, mpint *b)
-{
- int s;
-
- if(b == nil)
- b = mpnew(VLDIGITS*sizeof(mpdigit));
- else
- mpbits(b, VLDIGITS*sizeof(mpdigit));
- mpassign(mpzero, b);
- if(v == 0)
- return b;
- for(s = 0; s < VLDIGITS && v != 0; s++){
- b->p[s] = v;
- v >>= sizeof(mpdigit)*8;
- }
- b->top = s;
- return b;
-}
-
-uvlong
-mptouv(mpint *b)
-{
- uvlong v;
- int s;
-
- if(b->top == 0)
- return (vlong) 0;
-
- mpnorm(b);
- if(b->top > VLDIGITS)
- return MAXVLONG;
-
- v = (uvlong) 0;
- for(s = 0; s < b->top; s++)
- v |= b->p[s]<<(s*sizeof(mpdigit)*8);
-
- return v;
-}