Deploy the new <ctype.h> and `foocmp' macros from mLib.
[catacomb] / math / g-ec.c
index 1b6c16e..5d922dd 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <ctype.h>
 
+#include <mLib/macros.h>
 #include <mLib/sub.h>
 
 #define ge ec
@@ -99,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;