aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Haberkorn <rhaberkorn@fmsbw.de>2026-06-21 22:04:49 +0200
committerRobin Haberkorn <rhaberkorn@fmsbw.de>2026-06-21 22:05:37 +0200
commitba7d2c8e48711cf089c35745234d71574bc7ae7f (patch)
treee75545990bd406979601f4ccfc6531e621844444
parent13f5fd77bbc528862f295f9e7196f3ff709d185a (diff)
downloadterex-ba7d2c8e48711cf089c35745234d71574bc7ae7f.tar.gz
fixed some warnings when building with `-Wall`
-rw-r--r--regc_lex.c2
-rw-r--r--regcomp.c4
-rw-r--r--rege_dfa.c18
3 files changed, 14 insertions, 10 deletions
diff --git a/regc_lex.c b/regc_lex.c
index ae71884..2033913 100644
--- a/regc_lex.c
+++ b/regc_lex.c
@@ -1147,6 +1147,7 @@ newline(void)
^ static const chr *ch(NOPARMS);
^ #endif
*/
+#if 0
#ifdef REG_DEBUG
static const chr *
ch(void)
@@ -1156,6 +1157,7 @@ ch(void)
return chstr;
}
#endif
+#endif
/*
- chrnamed - return the chr known by a given (chr string) name
diff --git a/regcomp.c b/regcomp.c
index c00e19e..25b1a85 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -83,9 +83,11 @@ static chr lexdigits(struct vars *, int, int, int);
static int brenext(struct vars *, pchr);
static void skip(struct vars *);
static chr newline(NOPARMS);
+#if 0
#ifdef REG_DEBUG
static const chr *ch(NOPARMS);
#endif
+#endif
static pchr chrnamed(struct vars *, const chr *, const chr *, pchr);
/* === regc_color.c === */
static void initcm(struct vars *, struct colormap *);
@@ -2039,7 +2041,7 @@ dump(
}
fprintf(f, "\n\n\n========= DUMP ==========\n");
- fprintf(f, "nsub %d, info 0%lo, csize %d, ntree %d\n",
+ fprintf(f, "nsub %zu, info 0%lo, csize %d, ntree %d\n",
re->re_nsub, re->re_info, re->re_csize, g->ntree);
dumpcolors(&g->cmap, f);
diff --git a/rege_dfa.c b/rege_dfa.c
index a2f3a28..32daab9 100644
--- a/rege_dfa.c
+++ b/rege_dfa.c
@@ -86,7 +86,7 @@ longest(
if (v->eflags&REG_FTRACE) {
while (cp < realstop) {
- FDEBUG(("+++ at c%d +++\n", css - d->ssets));
+ FDEBUG(("+++ at c%ld +++\n", css - d->ssets));
pchr c = getchr(cp, stop);
co = GETCOLOR(cm, c);
FDEBUG(("char %c (%u), color %ld\n", (char)c, c, (long)co));
@@ -122,7 +122,7 @@ longest(
* Shutdown.
*/
- FDEBUG(("+++ shutdown at c%d +++\n", css - d->ssets));
+ FDEBUG(("+++ shutdown at c%ld +++\n", css - d->ssets));
if (cp == v->stop && stop == v->stop) {
if (hitstopp != NULL) {
*hitstopp = 1;
@@ -219,7 +219,7 @@ shortest(
if (v->eflags&REG_FTRACE) {
while (cp < realmax) {
- FDEBUG(("--- at c%d ---\n", css - d->ssets));
+ FDEBUG(("--- at c%ld ---\n", css - d->ssets));
pchr c = getchr(cp, max);
co = GETCOLOR(cm, c);
FDEBUG(("char %c (%u), color %ld\n", (char)c, c, (long)co));
@@ -586,7 +586,7 @@ miss(
for (p = d->ssets, i = d->nssused; i > 0; p++, i--) {
if (HIT(h, d->work, p, d->wordsper)) {
- FDEBUG(("cached c%d\n", p - d->ssets));
+ FDEBUG(("cached c%ld\n", p - d->ssets));
break; /* NOTE BREAK OUT */
}
}
@@ -608,7 +608,7 @@ miss(
}
if (!sawlacons) { /* lookahead conds. always cache miss */
- FDEBUG(("c%d[%d]->c%d\n", css - d->ssets, co, p - d->ssets));
+ FDEBUG(("c%ld[%d]->c%ld\n", css - d->ssets, co, p - d->ssets));
css->outs[co] = p;
css->inchain[co] = p->ins;
p->ins.ss = css;
@@ -679,7 +679,7 @@ getvacant(
ap = ss->ins;
while ((p = ap.ss) != NULL) {
co = ap.co;
- FDEBUG(("zapping c%d's %ld outarc\n", p - d->ssets, (long)co));
+ FDEBUG(("zapping c%ld's %ld outarc\n", p - d->ssets, (long)co));
p->outs[co] = NULL;
ap = p->inchain[co];
p->inchain[co].ss = NULL; /* paranoia */
@@ -696,7 +696,7 @@ getvacant(
if (p == NULL) {
continue; /* NOTE CONTINUE */
}
- FDEBUG(("del outarc %d from c%d's in chn\n", i, p - d->ssets));
+ FDEBUG(("del outarc %d from c%ld's in chn\n", i, p - d->ssets));
if (p->ins.ss == ss && p->ins.co == i) {
p->ins = ss->inchain[i];
} else {
@@ -791,7 +791,7 @@ pickss(
if ((ss->lastseen == NULL || ss->lastseen < ancient)
&& !(ss->flags&LOCKED)) {
d->search = ss + 1;
- FDEBUG(("replacing c%d\n", ss - d->ssets));
+ FDEBUG(("replacing c%ld\n", ss - d->ssets));
return ss;
}
}
@@ -799,7 +799,7 @@ pickss(
if ((ss->lastseen == NULL || ss->lastseen < ancient)
&& !(ss->flags&LOCKED)) {
d->search = ss + 1;
- FDEBUG(("replacing c%d\n", ss - d->ssets));
+ FDEBUG(("replacing c%ld\n", ss - d->ssets));
return ss;
}
}