Date: Tue, 23 Jun 2009 07:58:45 GMT From: Gabor Kovesdan <gabor@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 164941 for review Message-ID: <200906230758.n5N7wjVJ055127@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=164941 Change 164941 by gabor@gabor_server on 2009/06/23 07:58:31 - Some Makefile nits - Merge bc.1 changes from OpenBSD - Add $FreeBSD$ tags - Make really WARNS=6 clean Submitted by: delphij Affected files ... .. //depot/projects/soc2008/gabor_textproc/bc/Makefile#2 edit .. //depot/projects/soc2008/gabor_textproc/bc/USD.doc/Makefile#2 edit .. //depot/projects/soc2008/gabor_textproc/bc/bc.1#3 edit .. //depot/projects/soc2008/gabor_textproc/bc/bc.library#2 edit .. //depot/projects/soc2008/gabor_textproc/bc/bc.y#3 edit .. //depot/projects/soc2008/gabor_textproc/bc/extern.h#2 edit .. //depot/projects/soc2008/gabor_textproc/bc/pathnames.h#2 edit .. //depot/projects/soc2008/gabor_textproc/bc/scan.l#2 edit Differences ... ==== //depot/projects/soc2008/gabor_textproc/bc/Makefile#2 (text+ko) ==== @@ -2,17 +2,12 @@ PROG= bc SRCS= bc.y scan.l -CPPFLAGS+= -I. -I${.CURDIR} -CFLAGS+= -Wall -Wno-unused -YFLAGS+= +CFLAGS+= -I. -I${.CURDIR} +WARNS?= 6 +SUBDIR+= USD.doc beforeinstall: install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/bc.library \ ${DESTDIR}/usr/share/misc -# These get installed verbatim -.if make(install) -SUBDIR+= USD.doc -.endif - .include <bsd.prog.mk> ==== //depot/projects/soc2008/gabor_textproc/bc/USD.doc/Makefile#2 (text+ko) ==== @@ -1,8 +1,10 @@ # $OpenBSD: Makefile,v 1.3 2004/02/01 15:18:01 jmc Exp $ +DOC= bc DIR= usd/06.bc SRCS= bc MACROS= -ms +BINDIR= /usr/share/doc/papers paper.txt: ${SRCS} ${ROFF} -Tascii ${SRCS} > ${.TARGET} ==== //depot/projects/soc2008/gabor_textproc/bc/bc.1#3 (text+ko) ==== @@ -1,4 +1,5 @@ -.\" $OpenBSD: bc.1,v 1.22 2007/05/31 19:20:07 jmc Exp $ +.\" $FreeBSD$ +.\" $OpenBSD: bc.1,v 1.23 2009/02/08 17:15:09 jmc Exp $ .\" .\" Copyright (C) Caldera International Inc. 2001-2002. .\" All rights reserved. @@ -34,7 +35,7 @@ .\" .\" @(#)bc.1 6.8 (Berkeley) 8/8/91 .\" -.Dd $Mdocdate: May 31 2009 $ +.Dd May 31 2007 .Dt BC 1 .Sh NAME .Nm bc @@ -362,7 +363,7 @@ The .Nm utility is compliant with the -.St -p1003.1-2004 +.St -p1003.1-2008 specification. .Pp The flags ==== //depot/projects/soc2008/gabor_textproc/bc/bc.library#2 (text+ko) ==== @@ -1,3 +1,4 @@ +/* $FreeBSD$ */ /* $OpenBSD: bc.library,v 1.3 2007/02/03 21:15:06 otto Exp $ */ /* ==== //depot/projects/soc2008/gabor_textproc/bc/bc.y#3 (text+ko) ==== @@ -30,9 +30,8 @@ * easy regression testing. */ -#ifndef lint -static const char rcsid[] = "$OpenBSD: bc.y,v 1.32 2006/05/18 05:49:53 otto Exp $"; -#endif /* not lint */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); #include <sys/types.h> #include <sys/wait.h> @@ -57,6 +56,9 @@ #define CONST_STRING ((ssize_t) -2) #define ALLOC_STRING ((ssize_t) -3) +extern char *yytext; +extern FILE *yyin; + struct tree { ssize_t index; union { @@ -70,8 +72,8 @@ int fileindex; int sargc; -char **sargv; -char *filename; +const char **sargv; +const char *filename; char *cmdexpr; static void grow(void); @@ -110,6 +112,8 @@ static u_short var_count; static pid_t dc; +static void sigchld(int); + extern char *__progname; #define BREAKSTACK_SZ (sizeof(breakstack)/sizeof(breakstack[0])) @@ -831,11 +835,11 @@ } static void -emit_macro(int node, ssize_t code) +emit_macro(int nodeidx, ssize_t code) { putchar('['); emit(code); - printf("]s%s\n", instructions[node].u.cstr); + printf("]s%s\n", instructions[nodeidx].u.cstr); nesting--; } @@ -953,7 +957,7 @@ } void -yyerror(char *s) +yyerror(const char *s) { char *str, *p; int n; @@ -996,7 +1000,7 @@ static void init(void) { - int i; + unsigned int i; for (i = 0; i < UCHAR_MAX; i++) { str_table[i][0] = i; @@ -1077,17 +1081,20 @@ pid_t pid; int status; - for (;;) { - pid = waitpid(dc, &status, WCONTINUED); - if (pid == -1) { - if (errno == EINTR) - continue; - _exit(0); + switch (signo) { + default: + for (;;) { + pid = waitpid(dc, &status, WCONTINUED); + if (pid == -1) { + if (errno == EINTR) + continue; + _exit(0); + } + if (WIFEXITED(status) || WIFSIGNALED(status)) + _exit(0); + else + break; } - if (WIFEXITED(status) || WIFSIGNALED(status)) - _exit(0); - else - break; } } ==== //depot/projects/soc2008/gabor_textproc/bc/extern.h#2 (text+ko) ==== @@ -1,3 +1,4 @@ +/* $FreeBSD$ */ /* $OpenBSD: extern.h,v 1.6 2006/03/18 20:44:43 otto Exp $ */ /* @@ -24,16 +25,14 @@ }; int yylex(void); -void yyerror(char *); +void yyerror(const char *); void fatal(const char *); void abort_line(int); -extern int lineno; -extern char *yytext; -extern FILE *yyin; -extern int fileindex; -extern int sargc; -extern char **sargv; -extern char *filename; -extern char *cmdexpr; -bool interactive; +extern int lineno; +extern int fileindex; +extern int sargc; +extern const char **sargv; +extern const char *filename; +extern char *cmdexpr; +bool interactive; ==== //depot/projects/soc2008/gabor_textproc/bc/pathnames.h#2 (text+ko) ==== @@ -1,3 +1,4 @@ +/* $FreeBSD$ */ /* $OpenBSD: pathnames.h,v 1.1 2003/09/25 19:32:44 otto Exp $ */ /* ==== //depot/projects/soc2008/gabor_textproc/bc/scan.l#2 (text+ko) ==== @@ -17,9 +17,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef lint -static const char rcsid[] = "$OpenBSD: scan.l,v 1.22 2008/12/15 19:46:29 otto Exp $"; -#endif /* not lint */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); #include <err.h> #include <errno.h> @@ -33,7 +32,6 @@ #include "pathnames.h" int lineno; -bool interactive; static char *strbuf = NULL; static size_t strbuf_sz = 1; @@ -233,10 +231,13 @@ static const char str[] = "[\n]P\n"; int save_errno; - save_errno = errno; - YY_FLUSH_BUFFER; /* XXX signal race? */ - write(STDOUT_FILENO, str, sizeof(str) - 1); - errno = save_errno; + switch (sig) { + default: + save_errno = errno; + YY_FLUSH_BUFFER; /* XXX signal race? */ + write(STDOUT_FILENO, str, sizeof(str) - 1); + errno = save_errno; + } } int
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906230758.n5N7wjVJ055127>