#include <assert.h>
#include <ctype.h>
-#include <errno.h>
+#include <sys/errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#ifndef LONG_BIT
-#define LONG_BIT (CHAR_BIT * sizeof (long))
-#endif /* LONG_BIT */
-
#define MAXfunction 32 /* Max function name length. */
-#define MAXBITS LONG_BIT /* Max bitstring length. */
+#define MAXBITS 32 /* Max bitstring length. */
typedef unsigned long bits;
enum type {T_ERROR, T_UNKNOWN, T_INTEGER, T_STRING};
const char *const typename[] = {"error", "unknown", "integer", "string"};
p = *stringp;
if (*p != '(') {
fprintf(stderr, "%s: %s(%d): missing ( after function %.*s\n", progname,
- filename, lineno, p - start, start);
+ filename, lineno, (int)(p - start), start);
return 1;
}
sp->type = S_FUNCTIONCALL;
const char concatdeclarations[] = "\
#include <string.h>\n\
#include <stdlib.h>\n\
-#include <errno.h>\n\
+#include <sys/errno.h>\n\
\n\
extern void *dis_realloc(void *p, size_t size); /* User-provided. */\n\
void *dis_alloc(size_t size);\n\
last = ", ";
}
for (ap = fp->args; ap != NULL; ap = ap->next) {
- fprintf(f, last);
+ fprintf(f, "%s", last);
compiletype(f, &ap->type);
putc(ap->name, f);
last = ", ";
}
last = "";
for (sp1 = sp; sp1 != NULL; sp1 = sp1->next) {
- printf(last);
+ printf("%s", last);
if (type != T_INTEGER)
last = ", ";
if (sp1->type == S_ARRAY)
putc('\n', stderr);
return 1;
}
- printf(last);
+ printf("%s", last);
last = ", ";
if (compileconcat(actualp->string, formaltype) != 0)
return 1;
else
compiletype(stdout, tp);
if (name != NULL)
- printf(name);
+ printf("%s", name);
else
compiletemp(num);
printf("[]");
printf("(");
for (bsp = splicep->splice; bsp != NULL; bsp = bsp->next) {
- printf(last);
+ printf("%s", last);
last = " | ";
if (bsp->type == S_PARAMETER)
putchar(bsp->value.arg->name);