summaryrefslogtreecommitdiff
path: root/sys/src/libmp
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-04-10 02:35:01 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2016-04-10 02:35:01 +0200
commit3ba1197aeb382e1750cbb0f2567794bd4482e1e2 (patch)
tree446c21efad26cd5f497c212e86392ac00036e099 /sys/src/libmp
parentb47c096c8ceb7b96820ec886146a674eb9ad2c7b (diff)
libmp: make includes consistent, make test program compile under ape (work in progress)
Diffstat (limited to 'sys/src/libmp')
-rw-r--r--sys/src/libmp/mkfile10
-rw-r--r--sys/src/libmp/port/mpmodop.c3
-rw-r--r--sys/src/libmp/test.c17
3 files changed, 7 insertions, 23 deletions
diff --git a/sys/src/libmp/mkfile b/sys/src/libmp/mkfile
index 886e3729f..3c12457bd 100644
--- a/sys/src/libmp/mkfile
+++ b/sys/src/libmp/mkfile
@@ -26,12 +26,12 @@ installall:V:
for(objtype in $CPUS) mk $MKFLAGS install
everything:V:
- rm -f */*.[012456789kvx]
+ rm -f */*.[$OS]
for(objtype in 386)@{
echo $objtype
mk $MKFLAGS install
}
- rm -f */*.[012456789kvx]
+ rm -f */*.[$OS]
test.$O: test.c /$objtype/include/u.h /sys/include/mp.h port/dat.h
$CC -Iport test.c
@@ -46,9 +46,9 @@ $O.bigtest: bigtest.$O /$objtype/lib/libmp.a
$LD -o $O.bigtest bigtest.$O
allout:
+ objtype=arm; mk; mk 5.test 5.bigtest
+ objtype=amd64; mk; mk 6.test 6.bigtest
objtype=386; mk; mk 8.test 8.bigtest
- objtype=power; mk; mk q.test q.bigtest
- objtype=mips; mk; mk v.test v.bigtest
cleanout:
- rm -f [qv8].* *.[qv8]
+ rm -f [568].* *.[568]
diff --git a/sys/src/libmp/port/mpmodop.c b/sys/src/libmp/port/mpmodop.c
index 8bc7cbb5a..331f1cc76 100644
--- a/sys/src/libmp/port/mpmodop.c
+++ b/sys/src/libmp/port/mpmodop.c
@@ -1,5 +1,4 @@
-#include <u.h>
-#include <libc.h>
+#include "os.h"
#include <mp.h>
/* operands need to have m->top+1 digits of space and satisfy 0 ≤ a ≤ m-1 */
diff --git a/sys/src/libmp/test.c b/sys/src/libmp/test.c
index 5b81bf9f2..47033a5dd 100644
--- a/sys/src/libmp/test.c
+++ b/sys/src/libmp/test.c
@@ -5,26 +5,11 @@
int loops = 1;
-long randomreg;
-
-void
-srand(long seed)
-{
- randomreg = seed;
-}
-
-long
-lrand(void)
-{
- randomreg = randomreg*104381 + 81761;
- return randomreg;
-}
-
void
prng(uchar *p, int n)
{
while(n-- > 0)
- *p++ = lrand();
+ *p++ = rand();
}
void