diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2010-05-08 18:58:28 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2010-05-08 18:58:28 +0000 |
commit | df39f8d38fd4cab767e86d7a18b3a6804ab90656 (patch) | |
tree | e1903904bf06e9bee8c5ae17aeba8a4fb1f1520a /gnu | |
parent | d978e8ed95d31fa987f1211c6c0f1df78b60f5c4 (diff) |
Fixes to build with gcc4, mostly function prototypes and missing
headers.
ok robert kettenis jsg
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/groff/libbib/map.c | 1 | ||||
-rw-r--r-- | gnu/usr.bin/groff/pfbtops/pfbtops.c | 1 | ||||
-rw-r--r-- | gnu/usr.bin/groff/psbb/psbb.c | 1 | ||||
-rw-r--r-- | gnu/usr.bin/groff/refer/refer.cc | 3 | ||||
-rw-r--r-- | gnu/usr.bin/groff/troff/input.cc | 25 | ||||
-rw-r--r-- | gnu/usr.bin/groff/troff/node.cc | 3 |
6 files changed, 28 insertions, 6 deletions
diff --git a/gnu/usr.bin/groff/libbib/map.c b/gnu/usr.bin/groff/libbib/map.c index 3632a11ef48..e8d9c47dbb2 100644 --- a/gnu/usr.bin/groff/libbib/map.c +++ b/gnu/usr.bin/groff/libbib/map.c @@ -21,6 +21,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <sys/types.h> #include <sys/mman.h> +#include <stdlib.h> /* The Net-2 man pages says that a MAP_FILE flag is required. */ #ifndef MAP_FILE diff --git a/gnu/usr.bin/groff/pfbtops/pfbtops.c b/gnu/usr.bin/groff/pfbtops/pfbtops.c index fb370ab79df..54923abee43 100644 --- a/gnu/usr.bin/groff/pfbtops/pfbtops.c +++ b/gnu/usr.bin/groff/pfbtops/pfbtops.c @@ -1,6 +1,7 @@ /* This translates ps fonts in .pfb format to ASCII ps files. */ #include <stdio.h> +#include <stdlib.h> /* Binary bytes per output line. */ #define BYTES_PER_LINE (64/2) diff --git a/gnu/usr.bin/groff/psbb/psbb.c b/gnu/usr.bin/groff/psbb/psbb.c index 43de191d34f..973e7b00d65 100644 --- a/gnu/usr.bin/groff/psbb/psbb.c +++ b/gnu/usr.bin/groff/psbb/psbb.c @@ -18,6 +18,7 @@ with groff; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <stdio.h> +#include <stdlib.h> #include <string.h> #include <errno.h> #ifndef errno diff --git a/gnu/usr.bin/groff/refer/refer.cc b/gnu/usr.bin/groff/refer/refer.cc index 08de6703a62..ea1dd5bdb8c 100644 --- a/gnu/usr.bin/groff/refer/refer.cc +++ b/gnu/usr.bin/groff/refer/refer.cc @@ -513,7 +513,8 @@ static void do_file(const char *filename) if ((flags & FORCE_LEFT_BRACKET) || !have_text) pending_line += PRE_LABEL_MARKER; pending_line += pre; - pending_line += LABEL_MARKER + lt; + char lm = LABEL_MARKER + (int)lt; + pending_line += lm; pending_line += post; if ((flags & FORCE_RIGHT_BRACKET) || !have_text) pending_line += POST_LABEL_MARKER; diff --git a/gnu/usr.bin/groff/troff/input.cc b/gnu/usr.bin/groff/troff/input.cc index 2f942c9ca29..7b2db2a96e5 100644 --- a/gnu/usr.bin/groff/troff/input.cc +++ b/gnu/usr.bin/groff/troff/input.cc @@ -75,6 +75,9 @@ void vjustify(); #endif /* COLUMN */ void transparent(); void transparent_file(); +void process_input_stack(); +void end_diversions(); +void title(); const char *program_name = 0; token tok; @@ -5331,6 +5334,13 @@ struct string_list { string_list(const char *ss) : s(ss), next(0) {} }; +static void prepend_string(const char *s, string_list **p) +{ + string_list *l = new string_list(s); + l->next = *p; + *p = l; +} + static void add_string(const char *s, string_list **p) { while (*p) @@ -5341,8 +5351,8 @@ static void add_string(const char *s, string_list **p) void usage(const char *prog) { errprint( -"usage: %1 -abivzCER -wname -Wname -dcstring -mname -nN -olist -rcN\n" -" -Tname -Fdir -Mdir [ files ]\n", +"usage: %1 -abivzCERU -wname -Wname -dcs -ffam -mname -nnum -olist\n" +" -rcn -Tname -Fdir -Mdir [files...]\n", prog); exit(USAGE_EXIT_CODE); } @@ -5360,11 +5370,12 @@ int main(int argc, char **argv) int tflag = 0; int fflag = 0; int nflag = 0; + int safer_flag = 1; // safer by default int no_rc = 0; // don't process troffrc int next_page_number; opterr = 0; hresolution = vresolution = 1; - while ((c = getopt(argc, argv, "abivw:W:zCEf:m:n:o:r:d:F:M:T:tqs:R")) + while ((c = getopt(argc, argv, "abivw:W:zCEf:m:n:o:r:d:F:M:T:tqs:RU")) != EOF) switch(c) { case 'v': @@ -5444,6 +5455,9 @@ int main(int argc, char **argv) case 't': // silently ignore these break; + case 'U': + safer_flag = 0; // unsafe behaviour + break; case '?': usage(argv[0]); default: @@ -5501,6 +5515,8 @@ int main(int argc, char **argv) } if (!no_rc) process_startup_file(); + if (safer_flag) + prepend_string("safer", ¯os); while (macros) { process_macro_file(macros->s); string_list *tem = macros; @@ -5727,7 +5743,8 @@ static node *read_draw_node() maxpoints *= 2; a_delete oldpoint; } - if (!get_hunits(&point[i].h, 'm')) { + if (!get_hunits(&point[i].h, + type == 'f' || type == 't' ? 'u' : 'm')) { err = 1; break; } diff --git a/gnu/usr.bin/groff/troff/node.cc b/gnu/usr.bin/groff/troff/node.cc index b3dceecbc32..8c28f05bf7f 100644 --- a/gnu/usr.bin/groff/troff/node.cc +++ b/gnu/usr.bin/groff/troff/node.cc @@ -168,6 +168,7 @@ public: hunits get_subscript_correction(charinfo *); friend tfont *make_tfont(tfont_spec &); }; +tfont *make_tfont(tfont_spec &); inline int env_definite_font(environment *env) { @@ -1491,7 +1492,7 @@ void glyph_node::operator delete(void *p) void ligature_node::operator delete(void *p) { - delete p; + delete[] (char *)p; } glyph_node::glyph_node(charinfo *c, tfont *t, node *x) |