From b3aaa0cc21c63d388230c7ef2a80abd631ff20d5 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Thu, 26 Feb 2009 21:43:15 +0000 Subject: Rename all symbols in libmp(3) to mp_*, just like Solaris. The function pow() in libmp(3) clashes with pow(3) in libm. We could rename this single function, but we can just take the same approach as the Solaris folks did, which is to prefix all function names with mp_. libmp(3) isn't really popular nowadays. I suspect not a single application in ports depends on it. There's still a chance, so I've increased the SHLIB_MAJOR and __FreeBSD_version. Reviewed by: deischen, rdivacky --- tools/regression/lib/libmp/test-libmp.c | 118 ++++++++++++++++---------------- 1 file changed, 59 insertions(+), 59 deletions(-) (limited to 'tools/regression') diff --git a/tools/regression/lib/libmp/test-libmp.c b/tools/regression/lib/libmp/test-libmp.c index 519656ade3b3..d9d2c9f6b3e0 100644 --- a/tools/regression/lib/libmp/test-libmp.c +++ b/tools/regression/lib/libmp/test-libmp.c @@ -40,7 +40,7 @@ static void testmcmp(const MINT *mp1, const MINT *mp2, const char *tname) { - if (mcmp(mp1, mp2) == 0) + if (mp_mcmp(mp1, mp2) == 0) printf("ok %d - %s\n", ++tnr, tname); else printf("not ok - %d %s\n", ++tnr, tname); @@ -53,32 +53,32 @@ testsimpel(void) MINT *t2; char *s; - madd(c42, c1, t0); + mp_madd(c42, c1, t0); testmcmp(c43, t0, "madd0"); - madd(t0, c1, t0); + mp_madd(t0, c1, t0); testmcmp(c44, t0, "madd1"); - msub(t0, c1, t0); + mp_msub(t0, c1, t0); testmcmp(c43, t0, "msub0"); - msub(t0, c1, t0); + mp_msub(t0, c1, t0); testmcmp(c42, t0, "msub1"); - move(c42, t0); + mp_move(c42, t0); testmcmp(c42, t0, "move0"); - t2 = xtom(str42); + t2 = mp_xtom(str42); testmcmp(c42, t2, "xtom"); - s = mtox(t2); + s = mp_mtox(t2); if (strcmp(str42, s) == 0) printf("ok %d - %s\n", ++tnr, "mtox0"); else printf("not ok %d - %s\n", ++tnr, "mtox0"); - mfree(t2); + mp_mfree(t2); } static int testgcd(void) { - gcd(c10, c15, t0); + mp_gcd(c10, c15, t0); testmcmp(t0, c5, "gcd0"); } @@ -86,10 +86,10 @@ static int testmsqrt(void) { - msqrt(c25, t0, t1); + mp_msqrt(c25, t0, t1); testmcmp(t0, c5, "msqrt0"); testmcmp(t1, c0, "msqrt1"); - msqrt(c42, t0, t1); + mp_msqrt(c42, t0, t1); testmcmp(t0, c6, "msqrt2"); testmcmp(t1, c6, "msqrt3"); } @@ -100,34 +100,34 @@ testdiv(void) short ro; MINT *t2; - mdiv(c42, c5, t0, t1); + mp_mdiv(c42, c5, t0, t1); testmcmp(t0, c8, "mdiv0"); testmcmp(t1, c2, "mdiv1"); - mdiv(c10, c8, t0, t1); + mp_mdiv(c10, c8, t0, t1); testmcmp(t0, c1, "mdiv2"); testmcmp(t1, c2, "mdiv3"); - sdiv(c42, 5, t0, &ro); + mp_sdiv(c42, 5, t0, &ro); testmcmp(t0, c8, "sdiv0"); - t2 = itom(ro); // Simpler to use common testmcmp() + t2 = mp_itom(ro); // Simpler to use common testmcmp() testmcmp(t2, c2, "sdiv1"); - mfree(t2); + mp_mfree(t2); - sdiv(c10, 8, t0, &ro); + mp_sdiv(c10, 8, t0, &ro); testmcmp(t0, c1, "sdiv2"); - t2 = itom(ro); // Simpler to use common testmcmp() + t2 = mp_itom(ro); // Simpler to use common testmcmp() testmcmp(t2, c2, "sdiv3"); - mfree(t2); + mp_mfree(t2); } static int testmult(void) { - mult(c5, c2, t0); + mp_mult(c5, c2, t0); testmcmp(t0, c10, "mmult0"); - mult(c3, c14, t0); + mp_mult(c3, c14, t0); testmcmp(t0, c42, "mmult1"); } @@ -135,11 +135,11 @@ static int testpow(void) { - pow(c2, c3, c10, t0); + mp_pow(c2, c3, c10, t0); testmcmp(t0, c8, "pow0"); - pow(c2, c3, c3, t0); + mp_pow(c2, c3, c3, t0); testmcmp(t0, c2, "pow1"); - rpow(c2, 3, t0); + mp_rpow(c2, 3, t0); testmcmp(t0, c8, "rpow0"); } @@ -160,25 +160,25 @@ main(int argc, char *argv[]) * cumbersome way to in theory be able to check for memory * leaks. */ - c0 = itom(0); - c1 = itom(1); - c2 = itom(2); - c3 = itom(3); - c5 = itom(5); - c6 = itom(6); - c8 = itom(8); - c10 = itom(10); - c14 = itom(14); - c15 = itom(15); - c25 = itom(25); - c42 = itom(42); - c43 = itom(43); - c44 = itom(44); - c45 = itom(45); + c0 = mp_itom(0); + c1 = mp_itom(1); + c2 = mp_itom(2); + c3 = mp_itom(3); + c5 = mp_itom(5); + c6 = mp_itom(6); + c8 = mp_itom(8); + c10 = mp_itom(10); + c14 = mp_itom(14); + c15 = mp_itom(15); + c25 = mp_itom(25); + c42 = mp_itom(42); + c43 = mp_itom(43); + c44 = mp_itom(44); + c45 = mp_itom(45); // Init temp variables - t0 = itom(0); - t1 = itom(0); + t0 = mp_itom(0); + t1 = mp_itom(0); // Run tests testsimpel(); @@ -189,23 +189,23 @@ main(int argc, char *argv[]) testmsqrt(); // Cleanup - mfree(c0); - mfree(c1); - mfree(c2); - mfree(c3); - mfree(c5); - mfree(c6); - mfree(c8); - mfree(c10); - mfree(c14); - mfree(c15); - mfree(c25); - mfree(c42); - mfree(c43); - mfree(c44); - mfree(c45); - mfree(t0); - mfree(t1); + mp_mfree(c0); + mp_mfree(c1); + mp_mfree(c2); + mp_mfree(c3); + mp_mfree(c5); + mp_mfree(c6); + mp_mfree(c8); + mp_mfree(c10); + mp_mfree(c14); + mp_mfree(c15); + mp_mfree(c25); + mp_mfree(c42); + mp_mfree(c43); + mp_mfree(c44); + mp_mfree(c45); + mp_mfree(t0); + mp_mfree(t1); return (EX_OK); } -- cgit v1.3