Deploy the new <ctype.h> and `foocmp' macros from mLib.
[catacomb] / math / g-ec.c
index f885c40..5d922dd 100644 (file)
 
 #include <ctype.h>
 
+#include <mLib/macros.h>
 #include <mLib/sub.h>
 
 #define ge ec
-#include "group.h"
 #include "ec-raw.h"
 #include "group-guts.h"
 
@@ -100,15 +100,15 @@ static int gread(group *gg, ec *d, const mptext_ops *ops, void *p) {
   int ch;
 
   ch = ops->get(p);
-  if (tolower(ch) == 'i') {
-    if (tolower(ops->get(p)) != 'n' || tolower(ops->get(p)) != 'f')
+  if (TOLOWER(ch) == 'i') {
+    if (TOLOWER(ops->get(p)) != 'n' || TOLOWER(ops->get(p)) != 'f')
       return (-1);
     EC_SETINF(d);
     return (0);
   }
   ops->unget(ch, p);
   if ((t.x = mp_read(MP_NEW, 0, ops, p)) == 0) goto done;
-  do ch = ops->get(p); while (ch == ',' || isspace(ch)); ops->unget(ch, p);
+  do ch = ops->get(p); while (ch == ',' || ISSPACE(ch)); ops->unget(ch, p);
   if ((t.y = mp_read(MP_NEW, 0, ops, p)) == 0) goto done;
   EC_IN(g->ei.c, &t, &t);
   if (EC_CHECK(g->ei.c, &t)) goto done;