summaryrefslogtreecommitdiff
path: root/sys/src/cmd/unix/drawterm/libmp/mpright.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/mpright.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/mpright.c')
-rw-r--r--sys/src/cmd/unix/drawterm/libmp/mpright.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/sys/src/cmd/unix/drawterm/libmp/mpright.c b/sys/src/cmd/unix/drawterm/libmp/mpright.c
deleted file mode 100644
index 6c42de168..000000000
--- a/sys/src/cmd/unix/drawterm/libmp/mpright.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include "os.h"
-#include <mp.h>
-#include "dat.h"
-
-// res = b >> shift
-void
-mpright(mpint *b, int shift, mpint *res)
-{
- int d, l, r, i;
- mpdigit this, last;
-
- // a negative right shift is a left shift
- if(shift < 0){
- mpleft(b, -shift, res);
- return;
- }
-
- if(res != b)
- mpbits(res, b->top*Dbits - shift);
- d = shift/Dbits;
- r = shift - d*Dbits;
- l = Dbits - r;
-
- // special case digit shifts
- if(r == 0){
- for(i = 0; i < b->top-d; i++)
- res->p[i] = b->p[i+d];
- } else {
- last = b->p[d];
- for(i = 0; i < b->top-d-1; i++){
- this = b->p[i+d+1];
- res->p[i] = (this<<l) | (last>>r);
- last = this;
- }
- res->p[i++] = last>>r;
- }
- while(i > 0 && res->p[i-1] == 0)
- i--;
- res->top = i;
-}