X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/e74ca64c0ec65a93d2f133c4472256e3bbb688e2..141c12847a1c2f8cc8db03d420551584e689fb87:/math/mptext.c diff --git a/math/mptext.c b/math/mptext.c index c902264d..a5c77db0 100644 --- a/math/mptext.c +++ b/math/mptext.c @@ -31,6 +31,8 @@ #include #include +#include + #include "mp.h" #include "mptext.h" #include "paranoia.h" @@ -340,10 +342,10 @@ mp *mp_read(mp *m, int radix, const mptext_ops *ops, void *p) /* --- If we're reading text, skip leading space, and maybe a sign --- */ if (radix >= 0) { - while (isspace(ch)) ch = ops->get(p); + while (ISSPACE(ch)) ch = ops->get(p); switch (ch) { case '-': f |= f_neg; /* and on */ - case '+': do ch = ops->get(p); while (isspace(ch)); + case '+': do ch = ops->get(p); while (ISSPACE(ch)); } } @@ -705,7 +707,7 @@ static int verify(dstr *v) ok = 0; } else { mp_writedstr(m, &d, ob); - if (d.len != v[3].len || memcmp(d.buf, v[3].buf, d.len) != 0) { + if (d.len != v[3].len || MEMCMP(d.buf, !=, v[3].buf, d.len)) { fprintf(stderr, "*** failed read or write\n" "*** input [%2i] = ", ib); if (ib < 0) @@ -746,7 +748,7 @@ static int verify(dstr *v) } if (v[1].len - off != v[4].len || - memcmp(v[1].buf + off, v[4].buf, v[4].len) != 0) { + MEMCMP(v[1].buf + off, !=, v[4].buf, v[4].len)) { fprintf(stderr, "*** leftovers incorrect\n" "*** input [%2i] = ", ib); if (ib < 0)