summaryrefslogtreecommitdiffstats
path: root/usr.bin/colldef
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2001-12-02 23:40:46 +0000
committermarkm <markm@FreeBSD.org>2001-12-02 23:40:46 +0000
commit6aad061ae72991511c19b2a0ffdda6d071ccb1bd (patch)
tree77671be032d017fcc1795356679eb6222071c15a /usr.bin/colldef
parent8896138d554d35b01373620fbe55221f586eda5b (diff)
downloadFreeBSD-src-6aad061ae72991511c19b2a0ffdda6d071ccb1bd.zip
FreeBSD-src-6aad061ae72991511c19b2a0ffdda6d071ccb1bd.tar.gz
WARNS=2 fixup.
Use __FBSDID(). Set NO_WERROR because this would rely on some lex(1) fixes that cannot be committed yet.
Diffstat (limited to 'usr.bin/colldef')
-rw-r--r--usr.bin/colldef/Makefile15
-rw-r--r--usr.bin/colldef/parse.y21
-rw-r--r--usr.bin/colldef/scan.l13
3 files changed, 29 insertions, 20 deletions
diff --git a/usr.bin/colldef/Makefile b/usr.bin/colldef/Makefile
index 0a9022a..4bf49fc 100644
--- a/usr.bin/colldef/Makefile
+++ b/usr.bin/colldef/Makefile
@@ -1,11 +1,12 @@
# $FreeBSD$
-PROG = colldef
-LFLAGS = -8 -i
-CFLAGS += -Wall
-CFLAGS += -I. -I${.CURDIR}/../../lib/libc/locale -DCOLLATE_DEBUG
-SRCS = parse.y scan.l y.tab.h
-LDADD = -ll
-DPADD = ${LIBL}
+PROG= colldef
+SRCS= parse.y scan.l y.tab.h
+WARNS?= 2
+NO_WERROR=yes
+LFLAGS= -8 -i
+CFLAGS+=-I. -I${.CURDIR}/../../lib/libc/locale -DCOLLATE_DEBUG -DYY_NO_UNPUT
+LDADD= -ll
+DPADD= ${LIBL}
.include <bsd.prog.mk>
diff --git a/usr.bin/colldef/parse.y b/usr.bin/colldef/parse.y
index ae7f06e..b7ef565 100644
--- a/usr.bin/colldef/parse.y
+++ b/usr.bin/colldef/parse.y
@@ -24,10 +24,12 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD$
*/
+#include <sys/cdefs.h>
+
+__FBSDID("$FreeBSD$");
+
#include <err.h>
#include <stdarg.h>
#include <stdio.h>
@@ -39,10 +41,11 @@
#include "common.h"
extern FILE *yyin;
-void yyerror(char *fmt, ...) __printflike(1, 2);
+void yyerror(const char *fmt, ...) __printflike(1, 2);
int yyparse(void);
int yylex(void);
-static void usage __P((void));
+static void usage(void);
+static void collate_print_tables(void);
char map_name[FILENAME_MAX] = ".";
@@ -57,7 +60,7 @@ int prim_pri = 1, sec_pri = 1;
int debug;
#endif
-char *out_file = "LC_COLLATE";
+const char *out_file = "LC_COLLATE";
%}
%union {
u_char ch;
@@ -231,6 +234,7 @@ sec_sub_item : CHAR {
%%
int
main(ac, av)
+ int ac;
char **av;
{
int ch;
@@ -278,7 +282,8 @@ usage()
exit(EX_USAGE);
}
-void yyerror(char *fmt, ...)
+void
+yyerror(const char *fmt, ...)
{
va_list ap;
char msg[128];
@@ -290,8 +295,8 @@ void yyerror(char *fmt, ...)
}
#ifdef COLLATE_DEBUG
-void
-collate_print_tables()
+static void
+collate_print_tables(void)
{
int i;
struct __collate_st_chain_pri *p2;
diff --git a/usr.bin/colldef/scan.l b/usr.bin/colldef/scan.l
index 8085440..04f3a57 100644
--- a/usr.bin/colldef/scan.l
+++ b/usr.bin/colldef/scan.l
@@ -25,10 +25,12 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD$
*/
+#include <sys/cdefs.h>
+
+__FBSDID("$FreeBSD$");
+
#include <ctype.h>
#include <err.h>
#include <unistd.h>
@@ -45,6 +47,7 @@ YY_BUFFER_STATE main_buf, map_buf;
#ifdef FLEX_DEBUG
YYSTYPE yylval;
#endif /* FLEX_DEBUG */
+int yylex(void);
%}
%%
<INITIAL,charmap,nchar,subs,subs2>[ \t]+ ;
@@ -166,7 +169,7 @@ YYSTYPE yylval;
return STRING;
}
<name,defn>. {
- char *s = (map_fp != NULL) ? map_name : "input";
+ const char *s = (map_fp != NULL) ? map_name : "input";
if (!isascii(*yytext) || !isprint(*yytext))
errx(EX_UNAVAILABLE, "non-ASCII or non-printable character 0x%02x not allowed in the map/name near line %u of %s",
@@ -219,12 +222,12 @@ YYSTYPE yylval;
*ptr++ = '\a';
}
<name,string,defn>\n {
- char *s = (map_fp != NULL) ? map_name : "input";
+ const char *s = (map_fp != NULL) ? map_name : "input";
errx(EX_UNAVAILABLE, "unterminated map/name/string near line %u of %s", line_no, s);
}
<name,string,nchar><<EOF>> {
- char *s = (map_fp != NULL) ? map_name : "input";
+ const char *s = (map_fp != NULL) ? map_name : "input";
errx(EX_UNAVAILABLE, "premature EOF in the name/string/char near line %u of %s", line_no, s);
}
OpenPOWER on IntegriCloud