aboutsummaryrefslogtreecommitdiffstats
path: root/troff/troff.d
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2016-12-25 17:53:10 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2016-12-25 17:53:10 +0000
commit80647123fe63c15caa93687028a45f9efee5b669 (patch)
tree6fe6df04e4b2cd506323ad2994b9527dd1ed7193 /troff/troff.d
parent6db6db4b7f38f7760b90ec861a39b5ccb9df5ba9 (diff)
downloadsrc-80647123fe63c15caa93687028a45f9efee5b669.tar.gz
src-80647123fe63c15caa93687028a45f9efee5b669.zip
Notes
Notes: svn path=/vendor/heirloom-doctools/dist/; revision=310550 svn path=/vendor/heirloom-doctools/20161106/; revision=310551; tag=vendor/heirloom-doctools/20161106
Diffstat (limited to 'troff/troff.d')
-rw-r--r--troff/troff.d/Makefile.mk9
-rw-r--r--troff/troff.d/afm.c1
-rw-r--r--troff/troff.d/afm.h4
-rw-r--r--troff/troff.d/dhtml/dhtml.l2
-rw-r--r--troff/troff.d/dhtml/lib.c1
-rw-r--r--troff/troff.d/dpost.d/Makefile.mk10
-rw-r--r--troff/troff.d/dpost.d/dpost.1.in (renamed from troff/troff.d/dpost.d/dpost.1)0
-rw-r--r--troff/troff.d/dpost.d/dpost.c14
-rw-r--r--troff/troff.d/dpost.d/misc.c1
-rw-r--r--troff/troff.d/font/devhtml/B.in (renamed from troff/troff.d/font/devhtml/B)0
-rw-r--r--troff/troff.d/font/devhtml/BI.in (renamed from troff/troff.d/font/devhtml/BI)0
-rw-r--r--troff/troff.d/font/devhtml/C.in (renamed from troff/troff.d/font/devhtml/C)0
-rw-r--r--troff/troff.d/font/devhtml/CB.in (renamed from troff/troff.d/font/devhtml/CB)0
-rw-r--r--troff/troff.d/font/devhtml/CI.in (renamed from troff/troff.d/font/devhtml/CI)0
-rw-r--r--troff/troff.d/font/devhtml/CR.in (renamed from troff/troff.d/font/devhtml/CR)0
-rw-r--r--troff/troff.d/font/devhtml/CW.in (renamed from troff/troff.d/font/devhtml/CW)0
-rw-r--r--troff/troff.d/font/devhtml/H.in (renamed from troff/troff.d/font/devhtml/H)0
-rw-r--r--troff/troff.d/font/devhtml/HB.in (renamed from troff/troff.d/font/devhtml/HB)0
-rw-r--r--troff/troff.d/font/devhtml/HI.in (renamed from troff/troff.d/font/devhtml/HI)0
-rw-r--r--troff/troff.d/font/devhtml/I.in (renamed from troff/troff.d/font/devhtml/I)0
-rw-r--r--troff/troff.d/font/devhtml/Makefile.mk10
-rw-r--r--troff/troff.d/font/devhtml/R.in (renamed from troff/troff.d/font/devhtml/R)0
-rw-r--r--troff/troff.d/font/devhtml/S.in (renamed from troff/troff.d/font/devhtml/S)0
-rw-r--r--troff/troff.d/font/devhtml/makefont.c6
-rw-r--r--troff/troff.d/otf.c55
-rw-r--r--troff/troff.d/otfdump.c10
-rw-r--r--troff/troff.d/pt.h4
-rw-r--r--troff/troff.d/t10.c10
-rw-r--r--troff/troff.d/t6.c26
-rw-r--r--troff/troff.d/ta.c28
-rw-r--r--troff/troff.d/tmac.d/Makefile.mk7
-rw-r--r--troff/troff.d/tmac.d/mcolor.7.in (renamed from troff/troff.d/tmac.d/mcolor.7)0
-rw-r--r--troff/troff.d/troff.1.in (renamed from troff/troff.d/troff.1)0
-rw-r--r--troff/troff.d/troff.h2
34 files changed, 117 insertions, 83 deletions
diff --git a/troff/troff.d/Makefile.mk b/troff/troff.d/Makefile.mk
index 1cddedf88880..87de1c911acf 100644
--- a/troff/troff.d/Makefile.mk
+++ b/troff/troff.d/Makefile.mk
@@ -12,7 +12,7 @@ FLAGS = -DUSG $(EUC) -I. -I.. -I../../include -DMACDIR='"$(MACDIR)"' \
.c.o:
$(CC) $(_CFLAGS) $(FLAGS) -c $<
-all: troff ta otfdump
+all: troff ta otfdump troff.1
troff: $(OBJ) $(LIBHNJ)/libhnj.a
$(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) -L$(LIBHNJ) -lhnj $(LIBS) -o troff
@@ -35,10 +35,15 @@ install:
clean:
rm -f $(OBJ) draw.o ta.o troff ta otfdump otfdump.o otfdump_vs.o \
- core log *~
+ core log *~ troff.1
mrproper: clean
+troff.1: troff.1.in
+ sed -e 's"/usr/ucblib/doctools/font/"$(ROOT)$(FNTDIR)/"' \
+ -e 's"/usr/ucblib/doctools/tmac/"$(ROOT)$(MACDIR)/"' \
+ troff.1.in > $@
+
draw.o: draw.c
makedev.o: makedev.c dev.h
t10.o: t10.c ../tdef.h ../ext.h dev.h afm.h unimap.h troff.h
diff --git a/troff/troff.d/afm.c b/troff/troff.d/afm.c
index b5bea1c35e6f..0f4a7cbfe183 100644
--- a/troff/troff.d/afm.c
+++ b/troff/troff.d/afm.c
@@ -888,7 +888,6 @@ afmget(struct afmtab *a, char *contents, size_t size)
char *cp, *th, *tp;
int n = 0;
enum spec s;
- size_t l;
if ((cp = strrchr(a->file, '/')) == NULL)
cp = a->file;
diff --git a/troff/troff.d/afm.h b/troff/troff.d/afm.h
index 59c601905917..dba71001fdd5 100644
--- a/troff/troff.d/afm.h
+++ b/troff/troff.d/afm.h
@@ -135,11 +135,11 @@ extern int nextprime(int n);
extern unsigned pjw(const char *);
extern char *afmencodepath(const char *);
extern char *afmdecodepath(const char *);
-#ifdef DPOST
#include <stdio.h>
+int fprintenc(FILE *, const char *);
+#ifdef DPOST
extern int otfcff(const char *, char *, size_t, size_t *, size_t *);
extern int otft42(char *, char *, char *, size_t, FILE *);
-extern int fprintenc(FILE *, const char *);
#endif
extern struct dev dev;
diff --git a/troff/troff.d/dhtml/dhtml.l b/troff/troff.d/dhtml/dhtml.l
index c99db26a88a1..ad7d1c72be65 100644
--- a/troff/troff.d/dhtml/dhtml.l
+++ b/troff/troff.d/dhtml/dhtml.l
@@ -32,6 +32,8 @@
#include "main.h"
static int i0;
%}
+%option nounput
+%option noinput
%x X FONT_NUM FONT_NAM T X_X LINK ULINK ANCHOR
WS [ ]
NWS [^ \n]
diff --git a/troff/troff.d/dhtml/lib.c b/troff/troff.d/dhtml/lib.c
index 251223627e05..90018f329b02 100644
--- a/troff/troff.d/dhtml/lib.c
+++ b/troff/troff.d/dhtml/lib.c
@@ -33,6 +33,7 @@
#include <string.h>
#include "main.h"
#include "bst.h"
+#include "lib.h"
void * /* pointer to \0 terminated file contents */
file2ram(char *p, /* path to file */
diff --git a/troff/troff.d/dpost.d/Makefile.mk b/troff/troff.d/dpost.d/Makefile.mk
index b2594b800192..3677592b3d20 100644
--- a/troff/troff.d/dpost.d/Makefile.mk
+++ b/troff/troff.d/dpost.d/Makefile.mk
@@ -10,7 +10,7 @@ FLAGS = -I. -I.. -DFNTDIR='"$(FNTDIR)"' -DPSTDIR='"$(PSTDIR)"' $(EUC) \
.c.o:
$(CC) $(_CFLAGS) $(FLAGS) -c $<
-all: dpost
+all: dpost dpost.1
dpost: $(OBJ)
$(CC) $(_CFLAGS) $(_LDFLAGS) $(OBJ) $(LIBS) -o dpost
@@ -22,10 +22,16 @@ install:
$(INSTALL) -c -m 644 dpost.1 $(ROOT)$(MANDIR)/man1/dpost.1
clean:
- rm -f $(OBJ) dpost core log *~
+ rm -f $(OBJ) dpost core log *~ dpost.1
mrproper: clean
+dpost.1: dpost.1.in
+ sed -e 's"/usr/ucblib/doctools/font/devpost/postscript/"$(ROOT)$(PSTDIR)/"' \
+ -e 's"/usr/ucblib/doctools/font"$(ROOT)$(FNTDIR)"' \
+ -e 's"/usr/lib/lp/postscript/"$(ROOT)$(PSTDIR)/"' \
+ -e 's"/usr/ucblib/doctools/tmac/"$(ROOT)$(MACDIR)/"' dpost.1.in > $@
+
color.o: color.c gen.h ext.h
dpost.o: dpost.c comments.h gen.h path.h ext.h ../dev.h dpost.h ../afm.h \
asciitype.h
diff --git a/troff/troff.d/dpost.d/dpost.1 b/troff/troff.d/dpost.d/dpost.1.in
index 7a935f823d03..7a935f823d03 100644
--- a/troff/troff.d/dpost.d/dpost.1
+++ b/troff/troff.d/dpost.d/dpost.1.in
diff --git a/troff/troff.d/dpost.d/dpost.c b/troff/troff.d/dpost.d/dpost.c
index 60c0b210fa42..30a33e9c691a 100644
--- a/troff/troff.d/dpost.d/dpost.c
+++ b/troff/troff.d/dpost.d/dpost.c
@@ -1632,7 +1632,8 @@ devcntrl(
char str[4096], *buf, str1[4096];
- int c, n, sz;
+ int c, sz;
+ size_t n;
/*
@@ -1686,7 +1687,7 @@ devcntrl(
break;
case 'f': /* load font in a position */
- fscanf(fp, "%d", &n);
+ fscanf(fp, "%zd", &n);
sget(str, sizeof str, fp);
fgets(buf, sz, fp); /* in case there's a filename */
ungetc('\n', fp); /* fgets() goes too far */
@@ -1698,8 +1699,8 @@ devcntrl(
/* these don't belong here... */
case 'H': /* char height */
- fscanf(fp, "%d", &n);
- if (n != FRACTSIZE)
+ fscanf(fp, "%zd", &n);
+ if (n != (size_t)FRACTSIZE)
t_charht(n, 0);
else {
float f;
@@ -1709,7 +1710,7 @@ devcntrl(
break;
case 'S': /* slant */
- fscanf(fp, "%d", &n);
+ fscanf(fp, "%zd", &n);
t_slant(n);
break;
@@ -1909,7 +1910,6 @@ loadfont (
int nw; /* number of width table entries */
const char *p;
char *path;
- size_t l;
/*
@@ -4578,7 +4578,7 @@ orderbookmarks(void)
int counts[MAXBOOKMARKLEVEL+1];
int refs[MAXBOOKMARKLEVEL+1];
size_t i, j, k, t;
- int lvl = 0;
+ size_t lvl = 0;
/*
* Generate the Count parameter from the given levels.
diff --git a/troff/troff.d/dpost.d/misc.c b/troff/troff.d/dpost.d/misc.c
index b5dc8a4e4858..e79544d0efa9 100644
--- a/troff/troff.d/dpost.d/misc.c
+++ b/troff/troff.d/dpost.d/misc.c
@@ -57,6 +57,7 @@
#include "path.h"
#include "asciitype.h"
+void errprint(char *fmt, ...);
static size_t nolist = 0; /* number of specified ranges */
static int olist[512]; /* processing range pairs */
diff --git a/troff/troff.d/font/devhtml/B b/troff/troff.d/font/devhtml/B.in
index fc9390a7157e..fc9390a7157e 100644
--- a/troff/troff.d/font/devhtml/B
+++ b/troff/troff.d/font/devhtml/B.in
diff --git a/troff/troff.d/font/devhtml/BI b/troff/troff.d/font/devhtml/BI.in
index 8df0242e857d..8df0242e857d 100644
--- a/troff/troff.d/font/devhtml/BI
+++ b/troff/troff.d/font/devhtml/BI.in
diff --git a/troff/troff.d/font/devhtml/C b/troff/troff.d/font/devhtml/C.in
index e9f9fb1bc169..e9f9fb1bc169 100644
--- a/troff/troff.d/font/devhtml/C
+++ b/troff/troff.d/font/devhtml/C.in
diff --git a/troff/troff.d/font/devhtml/CB b/troff/troff.d/font/devhtml/CB.in
index bb929d1a9aa8..bb929d1a9aa8 100644
--- a/troff/troff.d/font/devhtml/CB
+++ b/troff/troff.d/font/devhtml/CB.in
diff --git a/troff/troff.d/font/devhtml/CI b/troff/troff.d/font/devhtml/CI.in
index 3e241d8c28a7..3e241d8c28a7 100644
--- a/troff/troff.d/font/devhtml/CI
+++ b/troff/troff.d/font/devhtml/CI.in
diff --git a/troff/troff.d/font/devhtml/CR b/troff/troff.d/font/devhtml/CR.in
index 6d5683909145..6d5683909145 100644
--- a/troff/troff.d/font/devhtml/CR
+++ b/troff/troff.d/font/devhtml/CR.in
diff --git a/troff/troff.d/font/devhtml/CW b/troff/troff.d/font/devhtml/CW.in
index 497184ad97db..497184ad97db 100644
--- a/troff/troff.d/font/devhtml/CW
+++ b/troff/troff.d/font/devhtml/CW.in
diff --git a/troff/troff.d/font/devhtml/H b/troff/troff.d/font/devhtml/H.in
index 30e1c356c606..30e1c356c606 100644
--- a/troff/troff.d/font/devhtml/H
+++ b/troff/troff.d/font/devhtml/H.in
diff --git a/troff/troff.d/font/devhtml/HB b/troff/troff.d/font/devhtml/HB.in
index a682337d4cd3..a682337d4cd3 100644
--- a/troff/troff.d/font/devhtml/HB
+++ b/troff/troff.d/font/devhtml/HB.in
diff --git a/troff/troff.d/font/devhtml/HI b/troff/troff.d/font/devhtml/HI.in
index 4b1121c8c189..4b1121c8c189 100644
--- a/troff/troff.d/font/devhtml/HI
+++ b/troff/troff.d/font/devhtml/HI.in
diff --git a/troff/troff.d/font/devhtml/I b/troff/troff.d/font/devhtml/I.in
index 347a976a341e..347a976a341e 100644
--- a/troff/troff.d/font/devhtml/I
+++ b/troff/troff.d/font/devhtml/I.in
diff --git a/troff/troff.d/font/devhtml/Makefile.mk b/troff/troff.d/font/devhtml/Makefile.mk
index 41a74b5d9f18..665b77049bb1 100644
--- a/troff/troff.d/font/devhtml/Makefile.mk
+++ b/troff/troff.d/font/devhtml/Makefile.mk
@@ -2,7 +2,12 @@ BIN= makefont
OBJS= $(BIN).o
FONTS= R I B BI C CW CR CI CB H HI HB S
-all: $(BIN)
+.SUFFIXES: .in
+.in: ${BIN}
+ cat $< > $@
+ ./${BIN} $@ >> $@
+
+all: $(BIN) ${FONTS}
install:
d=$(ROOT)$(FNTDIR)/devhtml; test -d $$d || mkdir $$d; \
@@ -11,11 +16,10 @@ install:
sed '1,2d;s/[[:space:]].*//' charset >> $$d/DESC; \
for i in $(FONTS); do \
install -m 644 $$i $$d/; \
- ./$(BIN) $$i >> $$d/$$i; \
done
clean:
- rm -rf $(BIN) $(OBJS)
+ rm -rf $(BIN) $(OBJS) $(FONTS)
mrproper: clean
diff --git a/troff/troff.d/font/devhtml/R b/troff/troff.d/font/devhtml/R.in
index b58aaa066970..b58aaa066970 100644
--- a/troff/troff.d/font/devhtml/R
+++ b/troff/troff.d/font/devhtml/R.in
diff --git a/troff/troff.d/font/devhtml/S b/troff/troff.d/font/devhtml/S.in
index bfcc84e27c7e..bfcc84e27c7e 100644
--- a/troff/troff.d/font/devhtml/S
+++ b/troff/troff.d/font/devhtml/S.in
diff --git a/troff/troff.d/font/devhtml/makefont.c b/troff/troff.d/font/devhtml/makefont.c
index a9b4da08d591..d0587d98dae3 100644
--- a/troff/troff.d/font/devhtml/makefont.c
+++ b/troff/troff.d/font/devhtml/makefont.c
@@ -49,8 +49,10 @@ main(int argc, char **argv) {
char *b, *b0;
ssize_t s;
progname = argv[0];
- if (argc != 2) return usage();
+ if (argc < 2 || argc > 3) return usage();
fontname = argv[1];
+ if (argc == 3)
+ charfile = argv[2];
s = read_file(&b0);
b = b0;
if (!(i = find_font(&b, &s))) {
@@ -189,7 +191,7 @@ next_line(char **b, ssize_t *s) {
static int
usage(void) {
fprintf(stderr,
-"Usage: ./%s <font_name> >> <font_name>\n"
+"Usage: ./%s <font_name> [charsetfile] >> <font_name>\n"
, progname);
return EXIT_FAILURE;
}
diff --git a/troff/troff.d/otf.c b/troff/troff.d/otf.c
index abaec6f55c8f..1733e675646b 100644
--- a/troff/troff.d/otf.c
+++ b/troff/troff.d/otf.c
@@ -63,7 +63,7 @@ unsigned short unitsPerEm;
static short xMin, yMin, xMax, yMax;
static short indexToLocFormat;
static struct afmtab *a;
-static int nc;
+static unsigned long nc;
static int fsType;
static int WeightClass;
static int isFixedPitch;
@@ -1663,7 +1663,8 @@ get_offset_table(void)
static void
get_table_directories(void)
{
- int i, j, o;
+ int i, j;
+ size_t o;
char buf[16];
free(table_directories);
@@ -1750,7 +1751,7 @@ get_bb(int gid, int B[4])
}
static void
-onechar(int gid, int sid)
+onechar(unsigned long gid, int sid)
{
long o;
int w, tp;
@@ -1814,7 +1815,7 @@ static void
get_CFF_Charset(void)
{
int d = 0;
- int gid, i, j, first, nLeft;
+ unsigned long gid, i, j, first, nLeft;
d = get_CFF_Top_DICT_Entry(15);
if (d == 0) {
@@ -2084,7 +2085,7 @@ addunitab(int c __actual_use, int u __actual_use)
static char *got_gid;
static void
-got_mapping(int c, int gid, int addchar)
+got_mapping(int c, unsigned long gid, int addchar)
{
if (gid < nc) {
if (addchar) {
@@ -2515,9 +2516,9 @@ get_OS_2(void)
}
static char *
-GID2SID(int gid)
+GID2SID(unsigned long gid)
{
- if (gid < 0 || gid >= nc)
+ if (gid >= nc)
return NULL;
return getSID(gid2sid[gid]);
}
@@ -2569,18 +2570,18 @@ open_cov(int o)
}
}
-static int
+static unsigned long
get_cov(struct cov *cp)
{
int Start, End;
switch (cp->CoverageFormat) {
default:
- return -1;
+ return (unsigned long)-1;
case 1:
if (cp->cnt < cp->GlyphCount)
return pbe16(&contents[cp->offset+4+2*cp->cnt++]);
- return -1;
+ return (unsigned long)-1;
case 2:
while (cp->cnt < cp->RangeCount) {
Start = pbe16(&contents[cp->offset+4+6*cp->cnt]);
@@ -2594,7 +2595,7 @@ get_cov(struct cov *cp)
cp->gid = Start;
return cp->gid++;
}
- return -1;
+ return (unsigned long)-1;
}
}
@@ -2727,7 +2728,7 @@ static void
kerninit(void)
{
char *cp;
- int i;
+ unsigned long i;
got_kern = 0;
nametable = calloc(nc, sizeof *nametable);
@@ -2739,7 +2740,7 @@ kerninit(void)
#define GID2name(gid) ((gid) < 0 || (gid) >= nc ? NULL : nametable[gid])
static inline void
-kernpair(int first, int second, int x)
+kernpair(unsigned long first, unsigned long second, int x)
{
struct namecache *np1, *np2;
@@ -2767,7 +2768,7 @@ kernfinish(void)
#endif /* !DUMP */
static void
-get_PairValueRecord(int first, int ValueFormat1, int ValueFormat2, int o)
+get_PairValueRecord(int first, int ValueFormat1, int ValueFormat2 __unused, int o)
{
int second;
int x;
@@ -2868,7 +2869,7 @@ get_PairPosFormat2(int o)
}
static void
-get_GPOS_kern1(int _t, int o, const char *_name)
+get_GPOS_kern1(int _t __unused, int o, const char *_name __unused)
{
int PosFormat;
@@ -2881,7 +2882,7 @@ get_GPOS_kern1(int _t, int o, const char *_name)
}
static void
-get_GPOS_kern2(int _t, int o, const char *_name)
+get_GPOS_kern2(int _t __unused, int o, const char *_name __unused)
{
int PosFormat;
@@ -2897,9 +2898,9 @@ static void
get_Ligature(int first, int o)
{
int LigGlyph;
- int CompCount;
+ unsigned int CompCount;
int Component[16];
- int i;
+ unsigned int i;
char *gn;
LigGlyph = pbe16(&contents[o]);
@@ -2969,7 +2970,7 @@ get_LigatureSet(int first, int o)
}
static void
-get_LigatureSubstFormat1(int _t, int o, const char *_name)
+get_LigatureSubstFormat1(int _t __unused, int o, const char *_name __unused)
{
struct cov *cp;
int Coverage;
@@ -3056,9 +3057,9 @@ get_SingleSubstitutionFormat1(int o, const char *name)
{
struct feature *fp;
struct cov *cp;
- int c, d;
+ unsigned long c, d;
int Coverage;
- int DeltaGlyphID;
+ unsigned long DeltaGlyphID;
if (pbe16(&contents[o]) != 1)
return;
@@ -3067,7 +3068,7 @@ get_SingleSubstitutionFormat1(int o, const char *name)
return;
DeltaGlyphID = pbe16(&contents[o+4]);
fp = add_feature(name);
- while ((c = get_cov(cp)) >= 0)
+ while ((c = get_cov(cp)) != (unsigned long)-1)
if ((d = c + DeltaGlyphID) < nc)
add_substitution_pair(fp, c, d);
free_cov(cp);
@@ -3224,7 +3225,7 @@ get_kern_subtable(int o)
static void
get_kern(void)
{
- long o;
+ unsigned long o;
int nTables;
int i, length;
@@ -3450,7 +3451,7 @@ otft42(char *font, char *path, char *_contents, size_t _size, FILE *fp)
{
const char *cp;
int ok = 0;
- int i;
+ unsigned long i;
(void) &ok;
a = NULL;
@@ -3509,14 +3510,14 @@ otft42(char *font, char *path, char *_contents, size_t _size, FILE *fp)
}
fprintf(fp, "end readonly def\n");
}
- fprintf(fp, "/CharStrings %d dict dup begin\n", nc);
+ fprintf(fp, "/CharStrings %lu dict dup begin\n", nc);
for (i = 0; i < nc; i++) {
if ((cp = GID2SID(i)) != NULL &&
(i == 0 || strcmp(cp, ".notdef"))) {
fprintenc(fp, cp);
- fprintf(fp, " %d def\n", i);
+ fprintf(fp, " %lu def\n", i);
} else
- fprintf(fp, "/index0x%02X %d def\n", i, i);
+ fprintf(fp, "/index0x%02lX %lu def\n", i, i);
}
fprintf(fp, "end readonly def\n");
fprintf(fp, "/sfnts[");
diff --git a/troff/troff.d/otfdump.c b/troff/troff.d/otfdump.c
index 283e6ae07d1d..8230de46ba5c 100644
--- a/troff/troff.d/otfdump.c
+++ b/troff/troff.d/otfdump.c
@@ -171,20 +171,22 @@ main(int argc, char **argv)
}
void
-afmaddchar(struct afmtab *a, int C, int tp, int cl, int WX, int B[4], char *N,
- enum spec s, int gid)
+afmaddchar(struct afmtab *a __unused, int C __unused, int tp __unused,
+ int cl __unused, int WX, int B[4] __unused, char *N,
+ enum spec s __unused, int gid __unused)
{
if (N)
print(SHOW_CHARS, "char %s width %d", N, _unitconv(WX));
}
void
-afmalloc(struct afmtab *a, int n)
+afmalloc(struct afmtab *a __unused, int n __unused)
{
}
void
-afmaddkernpair(struct afmtab *a, int ch1, int ch2, int k)
+afmaddkernpair(struct afmtab *a __unused, int ch1 __unused, int ch2 __unused,
+ int k __unused)
{
}
diff --git a/troff/troff.d/pt.h b/troff/troff.d/pt.h
index fcd6c7b5b927..8287a978a18a 100644
--- a/troff/troff.d/pt.h
+++ b/troff/troff.d/pt.h
@@ -7,7 +7,7 @@
/* t6.c */
extern int width(register tchar);
extern void zapwcache(int);
-extern int getcw(register int);
+extern int getcw(size_t);
extern int abscw(int);
extern int onfont(tchar);
extern int getascender(void);
@@ -81,7 +81,7 @@ extern double u2pts(int);
extern void ptinit(void);
extern void specnames(void);
extern int findch(register const char *);
-extern void ptout(register tchar);
+void ptout(register tchar);
extern tchar *ptout0(tchar *, tchar *);
extern void ptps(void);
extern void ptfont(void);
diff --git a/troff/troff.d/t10.c b/troff/troff.d/t10.c
index 4a883041224a..d90916a6c0a2 100644
--- a/troff/troff.d/t10.c
+++ b/troff/troff.d/t10.c
@@ -90,7 +90,7 @@ int Vert;
int Unitwidth;
int nfonts;
static int nsizes;
-int nchtab;
+size_t nchtab;
int lettrack;
float horscale;
@@ -134,7 +134,7 @@ static void ptlink(int);
static void ptulink(int);
static void ptyon(int);
static void ptchar(int, int);
-static void pnc(int, struct afmtab *);
+static void pnc(size_t, struct afmtab *);
void
growfonts(int n)
@@ -227,7 +227,7 @@ ptinit(void)
nfonts = dev.nfonts;
nsizes = dev.nsizes;
nchtab = dev.nchtab;
- if (nchtab >= NCHARS - 128) {
+ if (nchtab >= (size_t)NCHARS - 128) {
errprint("too many special characters in file %s",
termtab);
done3(1);
@@ -350,7 +350,7 @@ specnames(void)
int
findch(register const char *s) /* find char s in chname */
{
- register int i;
+ size_t i;
for (i = 0; i < nchtab; i++)
if (strcmp(s, &chname[chtab[i]]) == 0)
@@ -728,7 +728,7 @@ ptout0(tchar *pi, tchar *pend)
}
static void
-pnc(int k, struct afmtab *a) {
+pnc(size_t k, struct afmtab *a) {
int j;
if (k >= nchtab + 128) {
diff --git a/troff/troff.d/t6.c b/troff/troff.d/t6.c
index b1ae66504c63..33c5229f71a3 100644
--- a/troff/troff.d/t6.c
+++ b/troff/troff.d/t6.c
@@ -73,6 +73,8 @@
#include "troff.h"
#include "fontmap.h"
+int ps2cc(const char *name);
+
/* fitab[f][c] is 0 if c is not on font f */
/* if it's non-zero, c is in fontab[f] at position
* fitab[f][c].
@@ -108,7 +110,7 @@ static int _ps2cc(const char *name, int create);
int
width(register tchar j)
{
- register int i, k;
+ size_t i, k;
_minflg = minflg;
minflg = minspc = 0;
@@ -128,7 +130,7 @@ width(register tchar j)
return(k);
}
i = cbits(j);
- if (html && i >= NCHARS)
+ if (html && i >= (size_t)NCHARS)
i = ' ';
if (i < ' ') {
if (i == '\b')
@@ -207,7 +209,7 @@ zapwcache(int s)
}
int
-getcw(register int i)
+getcw(size_t i)
{
register int k;
register int *p;
@@ -404,7 +406,7 @@ abscw(int n) /* return index of abs char n in fontab[], etc. */
int
onfont(tchar c)
{
- int k = cbits(c);
+ size_t k = cbits(c);
int f = fbits(c);
if (k <= ' ')
@@ -519,7 +521,8 @@ kzap(int f)
static tchar
findchar(tchar c)
{
- int f, i;
+ int f;
+ size_t i;
f = fbits(c);
c = cbits(c);
@@ -573,7 +576,8 @@ getkw(tchar c, tchar e)
{
struct knode *kp;
struct afmtab *a;
- int f, g, i, j, k, n, s, I, J;
+ int f, g, i, j, k, n, s;
+ size_t I, J;
double z;
if (isxfunc(c, CHAR))
@@ -724,7 +728,7 @@ static const struct amap {
tchar
setch(int delim) {
- register int j;
+ size_t j;
char temp[NC];
tchar c, e[2] = {0, 0};
int f;
@@ -831,7 +835,7 @@ tchar setabs(void) /* set absolute char from \C'...' */
n = 0;
n = inumb(&n);
getch();
- if (nonumb || n + nchtab + 128 >= NCHARS)
+ if (nonumb || n + nchtab + 128 >= (size_t)NCHARS)
return 0;
return n + nchtab + 128;
}
@@ -2067,7 +2071,6 @@ loadafm(int nf, int rq, char *file, char *supply, int required, enum spec spec)
struct afmtab *a;
int i, have = 0;
struct namecache *np;
- size_t l;
zapwcache(0);
if (nf < 0)
@@ -2252,7 +2255,8 @@ void
casehidechar(void)
{
int savfont = font, savfont1 = font1;
- int i, j;
+ int j;
+ size_t i;
tchar k;
if (skip(1))
@@ -2871,7 +2875,7 @@ tr2un(tchar i, int f)
a = afmtab[n];
if (a->unitab && i < a->nunitab && a->unitab[i])
return a->unitab[i];
- if (i - 32 >= nchtab + 128)
+ if ((size_t)i - 32 >= nchtab + 128)
i -= nchtab + 128;
if ((n = a->fitab[i - 32]) < a->nchars &&
a->nametab[n] != NULL)
diff --git a/troff/troff.d/ta.c b/troff/troff.d/ta.c
index c3e9d92b4197..a31953f62a4e 100644
--- a/troff/troff.d/ta.c
+++ b/troff/troff.d/ta.c
@@ -112,7 +112,7 @@ x ...\n device control functions:
#define NFONT 10
int output = 0; /* do we do output at all? */
-int nolist = 0; /* output page list if > 0 */
+size_t nolist = 0; /* output page list if > 0 */
int olist[20]; /* pairs of page numbers */
int erase = 1;
@@ -243,7 +243,8 @@ main(int argc, char **argv)
void
outlist(char *s) /* process list of page numbers to be printed */
{
- int n1, n2, i;
+ int n1, n2;
+ size_t i;
nolist = 0;
while (*s && nolist < sizeof olist/sizeof *olist - 1) {
@@ -279,7 +280,7 @@ outlist(char *s) /* process list of page numbers to be printed */
int
in_olist(int n) /* is n in olist? */
{
- int i;
+ size_t i;
if (nolist == 0)
return(1); /* everything is included */
@@ -464,17 +465,17 @@ fileinit(void) /* read in font and code files, etc. */
}
void
-fontprint(int i) /* debugging print of font i (0,...) */
+fontprint(int i __unused) /* debugging print of font i (0,...) */
{
}
void
-loadcode(int n, int nw) /* load codetab on position n (0...); #chars is nw */
+loadcode(int n __unused, int nw __unused) /* load codetab on position n (0...); #chars is nw */
{
}
void
-loadfont(int n, char *s) /* load font info for font s on position n (1...) */
+loadfont(int n __unused, char *s __unused) /* load font info for font s on position n (1...) */
{
}
@@ -518,7 +519,7 @@ int drawdot = '.'; /* draw with this character */
int drawsize = 1; /* shrink by this factor when drawing */
void
-t_init(int reinit) /* initialize device */
+t_init(int reinit __unused) /* initialize device */
{
fflush(stdout);
hpos = vpos = 0;
@@ -686,13 +687,13 @@ t_newline(void) /* do whatever for the end of a line */
}
int
-t_size(int n) /* convert integer to internal size number*/
+t_size(int n __unused) /* convert integer to internal size number*/
{
return 0;
}
int
-t_font(char *s) /* convert string to internal font number */
+t_font(char *s __unused) /* convert string to internal font number */
{
return 0;
}
@@ -807,17 +808,17 @@ put1(int c) /* output char c */
}
void
-setsize(double n) /* set point size to n (internal) */
+setsize(double n __unused) /* set point size to n (internal) */
{
}
void
-t_fp(int n, char *s) /* font position n now contains font s */
+t_fp(int n __unused, char *s __unused) /* font position n now contains font s */
{
}
void
-setfont(int n) /* set font to n */
+setfont(int n __unused) /* set font to n */
{
}
@@ -870,7 +871,8 @@ char *spectab[] ={
static int
sget(char *buf, size_t size, FILE *fp)
{
- int c, n = 0;
+ int c;
+ size_t n = 0;
do
c = getc(fp);
diff --git a/troff/troff.d/tmac.d/Makefile.mk b/troff/troff.d/tmac.d/Makefile.mk
index 444625ce88de..8bb54c185588 100644
--- a/troff/troff.d/tmac.d/Makefile.mk
+++ b/troff/troff.d/tmac.d/Makefile.mk
@@ -24,9 +24,14 @@ install: all $(ROOT)$(MACDIR) $(ROOT)$(MANDIR)/man7
done
clean:
- rm -f andoc bib doc e g m s pm an doc-ditroff
+ rm -f andoc bib doc e g m s pm an doc-ditroff mcolor.7
mrproper: clean
+mcolor.7: mcolor.7.in
+ sed -e 's"/usr/ucblib/doctools/font/devpost/postscript"$(ROOT)$(PSTDIR)"' \
+ -e 's"/usr/ucblib/doctools/tmac"$(ROOT)$(MACDIR)"' \
+ mcolor.7.in > $@
+
$(ROOT)$(MACDIR) $(ROOT)$(MANDIR)/man7:
mkdir -p $@
diff --git a/troff/troff.d/tmac.d/mcolor.7 b/troff/troff.d/tmac.d/mcolor.7.in
index 78408f4fec87..78408f4fec87 100644
--- a/troff/troff.d/tmac.d/mcolor.7
+++ b/troff/troff.d/tmac.d/mcolor.7.in
diff --git a/troff/troff.d/troff.1 b/troff/troff.d/troff.1.in
index 65655d27ee04..65655d27ee04 100644
--- a/troff/troff.d/troff.1
+++ b/troff/troff.d/troff.1.in
diff --git a/troff/troff.d/troff.h b/troff/troff.d/troff.h
index 57c2a2b07e72..d3072e39ed26 100644
--- a/troff/troff.d/troff.h
+++ b/troff/troff.d/troff.h
@@ -51,7 +51,7 @@ extern int *ccstab;
extern int **fallbacktab;
extern float *zoomtab;
-extern int nchtab;
+extern size_t nchtab;
extern char *chname;
extern int c_endash;