aboutsummaryrefslogtreecommitdiff
path: root/contrib/groff/refer
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2000-12-05 18:49:44 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2000-12-05 18:49:44 +0000
commita8c609dad13b24e9c6f65dc28182e45856a116f5 (patch)
tree2c03af2742439f038b0dc084176b85bb8600d284 /contrib/groff/refer
parent67739cc833502fdb0a3c43e57f68ac9a46b7eb09 (diff)
parentc8d1b47c7fde3a8a3f5530bd5e3939bba340ab4b (diff)
This commit was generated by cvs2svn to compensate for changes in r69626,
which included commits to RCS files with non-trunk default branches.
Notes
Notes: svn path=/head/; revision=69627
Diffstat (limited to 'contrib/groff/refer')
-rw-r--r--contrib/groff/refer/Makefile.sub23
-rw-r--r--contrib/groff/refer/label.y12
-rw-r--r--contrib/groff/refer/ref.cc2
-rw-r--r--contrib/groff/refer/refer.cc8
-rw-r--r--contrib/groff/refer/refer.man5
5 files changed, 33 insertions, 17 deletions
diff --git a/contrib/groff/refer/Makefile.sub b/contrib/groff/refer/Makefile.sub
index 287346245866..1631b5e36e05 100644
--- a/contrib/groff/refer/Makefile.sub
+++ b/contrib/groff/refer/Makefile.sub
@@ -2,9 +2,22 @@ PROG=refer
MAN1=refer.n
XLIBS=$(LIBBIB) $(LIBGROFF)
MLIB=$(LIBM)
-OBJS=command.o label.o ref.o refer.o token.o
-CCSRCS=command.cc ref.cc refer.cc token.cc
-HDRS=refer.h token.h command.h ref.h
-GRAM=label.y
-YTABC=label.cc
+OBJS=\
+ command.o \
+ label.o \
+ ref.o \
+ refer.o \
+ token.o
+CCSRCS=\
+ $(srcdir)/command.cc \
+ $(srcdir)/ref.cc \
+ $(srcdir)/refer.cc \
+ $(srcdir)/token.cc
+HDRS=\
+ $(srcdir)/refer.h \
+ $(srcdir)/token.h \
+ $(srcdir)/command.h \
+ $(srcdir)/ref.h
+GRAM=$(srcdir)/label.y
+YTABC=$(srcdir)/label.cc
NAMEPREFIX=$(g)
diff --git a/contrib/groff/refer/label.y b/contrib/groff/refer/label.y
index 474158df0c77..2c7c90951ab0 100644
--- a/contrib/groff/refer/label.y
+++ b/contrib/groff/refer/label.y
@@ -77,7 +77,7 @@ class field_expr : public expression {
int number;
char name;
public:
- field_expr(char nm, int num) : name(nm), number(num) { }
+ field_expr(char nm, int num) : number(num), name(nm) { }
void evaluate(int, const reference &, string &, substring_position &);
unsigned analyze() { return CONTAINS_VARIABLE; }
};
@@ -136,14 +136,14 @@ class extractor_expr : public unary_expr {
public:
enum { BEFORE = +1, MATCH = 0, AFTER = -1 };
extractor_expr(expression *e, extractor_func *f, int pt)
- : unary_expr(e), func(f), part(pt) { }
+ : unary_expr(e), part(pt), func(f) { }
void evaluate(int, const reference &, string &, substring_position &);
};
class truncate_expr : public unary_expr {
int n;
public:
- truncate_expr(expression *e, int i) : n(i), unary_expr(e) { }
+ truncate_expr(expression *e, int i) : unary_expr(e), n(i) { }
void evaluate(int, const reference &, string &, substring_position &);
};
@@ -509,7 +509,7 @@ void format_expr::evaluate(int tentative, const reference &ref,
if (type != '0')
result += format_serial(type, num + 1);
else {
- const char *ptr = itoa(num + first_number);
+ const char *ptr = i_to_a(num + first_number);
int pad = width - strlen(ptr);
while (--pad >= 0)
result += '0';
@@ -530,7 +530,7 @@ static const char *format_serial(char c, int n)
// numerals; I can find no historical basis for this usage
const char *s = c == 'i' ? "zwmdclxvi" : "ZWMDCLXVI";
if (n >= 40000)
- return itoa(n);
+ return i_to_a(n);
while (n >= 10000) {
*p++ = s[0];
n -= 10000;
@@ -928,7 +928,7 @@ int reference::merge_labels_by_parts(reference **v, int n, label_type type,
string label_pool;
label_info::label_info(const string &s)
-: count(0), total(1), length(s.length()), start(label_pool.length())
+: start(label_pool.length()), length(s.length()), count(0), total(1)
{
label_pool += s;
}
diff --git a/contrib/groff/refer/ref.cc b/contrib/groff/refer/ref.cc
index 9347e96552ad..c3517b194598 100644
--- a/contrib/groff/refer/ref.cc
+++ b/contrib/groff/refer/ref.cc
@@ -51,7 +51,7 @@ const char *reference_types[] = {
static string temp_fields[256];
reference::reference(const char *start, int len, reference_id *ridp)
-: no(-1), field(0), nfields(0), h(0), merged(0), label_ptr(0),
+: h(0), merged(0), no(-1), field(0), nfields(0), label_ptr(0),
computed_authors(0), last_needed_author(-1), nauthors(-1)
{
int i;
diff --git a/contrib/groff/refer/refer.cc b/contrib/groff/refer/refer.cc
index 065faf6533e3..70c696f4a9d3 100644
--- a/contrib/groff/refer/refer.cc
+++ b/contrib/groff/refer/refer.cc
@@ -336,8 +336,8 @@ int main(int argc, char **argv)
}
case 'v':
{
- extern const char *version_string;
- fprintf(stderr, "GNU refer version %s\n", version_string);
+ extern const char *Version_string;
+ fprintf(stderr, "GNU refer version %s\n", Version_string);
fflush(stderr);
opt++;
break;
@@ -513,7 +513,7 @@ static void do_file(const char *filename)
if ((flags & FORCE_LEFT_BRACKET) || !have_text)
pending_line += PRE_LABEL_MARKER;
pending_line += pre;
- char lm = LABEL_MARKER + lt;
+ char lm = LABEL_MARKER + (int)lt;
pending_line += lm;
pending_line += post;
if ((flags & FORCE_RIGHT_BRACKET) || !have_text)
@@ -921,7 +921,7 @@ void label_processing_state::process(int c)
extern "C" {
-static int rcompare(const void *p1, const void *p2)
+int rcompare(const void *p1, const void *p2)
{
return compare_reference(**(reference **)p1, **(reference **)p2);
}
diff --git a/contrib/groff/refer/refer.man b/contrib/groff/refer/refer.man
index 6b09c973a931..13708cf0e568 100644
--- a/contrib/groff/refer/refer.man
+++ b/contrib/groff/refer/refer.man
@@ -1,5 +1,5 @@
.ig \"-*- nroff -*-
-Copyright (C) 1989-1995 Free Software Foundation, Inc.
+Copyright (C) 1989-2000 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -58,6 +58,9 @@ the original English.
.RI [\ filename \|.\|.\|.\ ]
.br
.ad \na
+.PP
+It is possible to have whitespace between a command line option and its
+parameter.
.SH DESCRIPTION
This file documents the GNU version of
.BR refer ,