chiark
/
gitweb
/
~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cleanup: Big pile of whitespace fixes, all at once.
[catacomb]
/
mpx.c
diff --git
a/mpx.c
b/mpx.c
index 01264b1e117e2b0989123dd3b805bf818b4b2729..29e1dedbb1656c8fce39a0f0e7d46b77cdceeb64 100644
(file)
--- a/
mpx.c
+++ b/
mpx.c
@@
-7,7
+7,7
@@
* (c) 1999 Straylight/Edgeware
*/
* (c) 1999 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of Catacomb.
*
*
* This file is part of Catacomb.
*
@@
-15,12
+15,12
@@
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
- *
+ *
* Catacomb is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
* Catacomb is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Library General Public
* License along with Catacomb; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* You should have received a copy of the GNU Library General Public
* License along with Catacomb; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
@@
-417,7
+417,7
@@
void mpx_lsl(mpw *dv, mpw *dvl, const mpw *av, const mpw *avl, size_t n)
}
/* --- Break out word and bit shifts for more sophisticated work --- */
}
/* --- Break out word and bit shifts for more sophisticated work --- */
-
+
nw = n / MPW_BITS;
nb = n % MPW_BITS;
nw = n / MPW_BITS;
nb = n % MPW_BITS;
@@
-515,7
+515,7
@@
void mpx_lslc(mpw *dv, mpw *dvl, const mpw *av, const mpw *avl, size_t n)
}
/* --- Break out word and bit shifts for more sophisticated work --- */
}
/* --- Break out word and bit shifts for more sophisticated work --- */
-
+
nw = n / MPW_BITS;
nb = n % MPW_BITS;
nw = n / MPW_BITS;
nb = n % MPW_BITS;
@@
-950,7
+950,7
@@
void mpx_umul(mpw *dv, mpw *dvl, const mpw *av, const mpw *avl,
MPX_SHRINK(bv, bvl);
/* --- Deal with a multiply by zero --- */
MPX_SHRINK(bv, bvl);
/* --- Deal with a multiply by zero --- */
-
+
if (bv == bvl) {
MPX_ZERO(dv, dvl);
return;
if (bv == bvl) {
MPX_ZERO(dv, dvl);
return;
@@
-1330,7
+1330,7
@@
mpw mpx_udivn(mpw *qv, mpw *qvl, const mpw *rv, const mpw *rvl, mpw d)
} while (0)
#define MAX(x, y) ((x) > (y) ? (x) : (y))
} while (0)
#define MAX(x, y) ((x) > (y) ? (x) : (y))
-
+
static void dumpbits(const char *msg, const void *pp, size_t sz)
{
const octet *p = pp;
static void dumpbits(const char *msg, const void *pp, size_t sz)
{
const octet *p = pp;
@@
-1515,7
+1515,7
@@
static int lsl(dstr *v)
mpx_lsl(d, dl, a, al, n);
if (!mpx_ueq(d, dl, c, cl)) {
fprintf(stderr, "\n*** lsl(%i) failed\n", n);
mpx_lsl(d, dl, a, al, n);
if (!mpx_ueq(d, dl, c, cl)) {
fprintf(stderr, "\n*** lsl(%i) failed\n", n);
- dumpmp("
a", a, al);
+ dumpmp(" a", a, al);
dumpmp("expected", c, cl);
dumpmp(" result", d, dl);
ok = 0;
dumpmp("expected", c, cl);
dumpmp(" result", d, dl);
ok = 0;
@@
-1540,7
+1540,7
@@
static int lslc(dstr *v)
mpx_lslc(d, dl, a, al, n);
if (!mpx_ueq(d, dl, c, cl)) {
fprintf(stderr, "\n*** lslc(%i) failed\n", n);
mpx_lslc(d, dl, a, al, n);
if (!mpx_ueq(d, dl, c, cl)) {
fprintf(stderr, "\n*** lslc(%i) failed\n", n);
- dumpmp("
a", a, al);
+ dumpmp(" a", a, al);
dumpmp("expected", c, cl);
dumpmp(" result", d, dl);
ok = 0;
dumpmp("expected", c, cl);
dumpmp(" result", d, dl);
ok = 0;
@@
-1565,7
+1565,7
@@
static int lsr(dstr *v)
mpx_lsr(d, dl, a, al, n);
if (!mpx_ueq(d, dl, c, cl)) {
fprintf(stderr, "\n*** lsr(%i) failed\n", n);
mpx_lsr(d, dl, a, al, n);
if (!mpx_ueq(d, dl, c, cl)) {
fprintf(stderr, "\n*** lsr(%i) failed\n", n);
- dumpmp("
a", a, al);
+ dumpmp(" a", a, al);
dumpmp("expected", c, cl);
dumpmp(" result", d, dl);
ok = 0;
dumpmp("expected", c, cl);
dumpmp(" result", d, dl);
ok = 0;
@@
-1591,8
+1591,8
@@
static int uadd(dstr *v)
mpx_uadd(d, dl, a, al, b, bl);
if (!mpx_ueq(d, dl, c, cl)) {
fprintf(stderr, "\n*** uadd failed\n");
mpx_uadd(d, dl, a, al, b, bl);
if (!mpx_ueq(d, dl, c, cl)) {
fprintf(stderr, "\n*** uadd failed\n");
- dumpmp("
a", a, al);
- dumpmp("
b", b, bl);
+ dumpmp(" a", a, al);
+ dumpmp(" b", b, bl);
dumpmp("expected", c, cl);
dumpmp(" result", d, dl);
ok = 0;
dumpmp("expected", c, cl);
dumpmp(" result", d, dl);
ok = 0;
@@
-1618,8
+1618,8
@@
static int usub(dstr *v)
mpx_usub(d, dl, a, al, b, bl);
if (!mpx_ueq(d, dl, c, cl)) {
fprintf(stderr, "\n*** usub failed\n");
mpx_usub(d, dl, a, al, b, bl);
if (!mpx_ueq(d, dl, c, cl)) {
fprintf(stderr, "\n*** usub failed\n");
- dumpmp("
a", a, al);
- dumpmp("
b", b, bl);
+ dumpmp(" a", a, al);
+ dumpmp(" b", b, bl);
dumpmp("expected", c, cl);
dumpmp(" result", d, dl);
ok = 0;
dumpmp("expected", c, cl);
dumpmp(" result", d, dl);
ok = 0;
@@
-1645,8
+1645,8
@@
static int umul(dstr *v)
mpx_umul(d, dl, a, al, b, bl);
if (!mpx_ueq(d, dl, c, cl)) {
fprintf(stderr, "\n*** umul failed\n");
mpx_umul(d, dl, a, al, b, bl);
if (!mpx_ueq(d, dl, c, cl)) {
fprintf(stderr, "\n*** umul failed\n");
- dumpmp("
a", a, al);
- dumpmp("
b", b, bl);
+ dumpmp(" a", a, al);
+ dumpmp(" b", b, bl);
dumpmp("expected", c, cl);
dumpmp(" result", d, dl);
ok = 0;
dumpmp("expected", c, cl);
dumpmp(" result", d, dl);
ok = 0;
@@
-1670,7
+1670,7
@@
static int usqr(dstr *v)
mpx_usqr(d, dl, a, al);
if (!mpx_ueq(d, dl, c, cl)) {
fprintf(stderr, "\n*** usqr failed\n");
mpx_usqr(d, dl, a, al);
if (!mpx_ueq(d, dl, c, cl)) {
fprintf(stderr, "\n*** usqr failed\n");
- dumpmp("
a", a, al);
+ dumpmp(" a", a, al);
dumpmp("expected", c, cl);
dumpmp(" result", d, dl);
ok = 0;
dumpmp("expected", c, cl);
dumpmp(" result", d, dl);
ok = 0;