#include <assert.h>
#include <ctype.h>
#include <limits.h>
-#include <math.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include "darray.h"
#include "dstr.h"
+#include "macros.h"
/*----- Tunable constants -------------------------------------------------*/
done_flags:
i = 0;
- while (isdigit((unsigned char)*p)) i = 10*i + *p++ - '0';
+ while (ISDIGIT(*p)) i = 10*i + *p++ - '0';
/* --- Snag: this might have been an argument position indicator --- */
fs->wd = i;
} else if (*p == '*') {
p++;
- if (!isdigit((unsigned char)*p))
+ if (!ISDIGIT(*p))
i = anext++;
else {
i = *p++ - '0';
- while (isdigit((unsigned char)*p)) i = 10*i + *p++ - '0';
+ while (ISDIGIT(*p)) i = 10*i + *p++ - '0';
assert(*p == '$'); p++;
assert(i > 0); i--;
}
if (*p == '.') {
p++;
f |= f_prec;
- if (isdigit((unsigned char)*p)) {
+ if (ISDIGIT(*p)) {
i = *p++ - '0';
- while (isdigit((unsigned char)*p)) i = 10*i + *p++ - '0';
+ while (ISDIGIT(*p)) i = 10*i + *p++ - '0';
fs->prec = i;
} else if (*p != '*')
fs->prec = 0;
else {
p++;
- if (!isdigit((unsigned char)*p))
+ if (!ISDIGIT(*p))
i = anext++;
else {
i = *p++ - '0';
- while (isdigit((unsigned char)*p)) i = 10*i + *p++ - '0';
+ while (ISDIGIT(*p)) i = 10*i + *p++ - '0';
assert(*p == '$'); p++;
assert(i > 0); i--;
}