summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2002-04-28 12:34:54 +0000
committermarkm <markm@FreeBSD.org>2002-04-28 12:34:54 +0000
commit20e29126e78e9c75f854655defe093b160f3ac5d (patch)
tree7a9cb4c96f7dbd48c7201bab3397ebe29e01d201 /usr.bin
parent38668d26e34a2f6610f0586b98518e5cdf00e94a (diff)
downloadFreeBSD-src-20e29126e78e9c75f854655defe093b160f3ac5d.zip
FreeBSD-src-20e29126e78e9c75f854655defe093b160f3ac5d.tar.gz
Declarations cleanup; make sure externs are in a common header.
Fix declarations, casts and return values.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mklocale/extern.h40
-rw-r--r--usr.bin/mklocale/lex.l8
-rw-r--r--usr.bin/mklocale/yacc.y33
3 files changed, 72 insertions, 9 deletions
diff --git a/usr.bin/mklocale/extern.h b/usr.bin/mklocale/extern.h
new file mode 100644
index 0000000..a52c6b5
--- /dev/null
+++ b/usr.bin/mklocale/extern.h
@@ -0,0 +1,40 @@
+/*-
+ * Copyright (c) 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Paul Borman at Krystal Technologies.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * 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$
+ */
+
+int yylex(void);
+int yyparse(void);
diff --git a/usr.bin/mklocale/lex.l b/usr.bin/mklocale/lex.l
index 3b81ea5..11ce80a 100644
--- a/usr.bin/mklocale/lex.l
+++ b/usr.bin/mklocale/lex.l
@@ -36,16 +36,21 @@
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)lex.l 8.1 (Berkeley) 6/6/93";
-static char rcsid[] = "$FreeBSD$";
+#endif
#endif /* not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include "ldef.h"
#include "y.tab.h"
+#include "extern.h"
%}
ODIGIT [0-7]
@@ -160,6 +165,7 @@ ENCODING { return(ENCODING); }
%%
#if !defined(yywrap)
+int
yywrap()
{
return(1);
diff --git a/usr.bin/mklocale/yacc.y b/usr.bin/mklocale/yacc.y
index 3001490..b1a6979 100644
--- a/usr.bin/mklocale/yacc.y
+++ b/usr.bin/mklocale/yacc.y
@@ -36,10 +36,14 @@
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)yacc.y 8.1 (Berkeley) 6/6/93";
-static char rcsid[] = "$FreeBSD$";
+#endif /* 0 */
#endif /* not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include <arpa/inet.h>
#include <ctype.h>
@@ -48,16 +52,25 @@ static char rcsid[] = "$FreeBSD$";
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include "ldef.h"
+#include "extern.h"
+
+static void *xmalloc(unsigned int sz);
+static unsigned long *xlalloc(unsigned int sz);
+static void yyerror(const char *s);
+static unsigned long *xrelalloc(unsigned long *old, unsigned int sz);
+static void dump_tables(void);
-char *locale_file = "<stdout>";
+const char *locale_file = "<stdout>";
-rune_map maplower = { 0, };
-rune_map mapupper = { 0, };
-rune_map types = { 0, };
+rune_map maplower = { { 0 }, NULL };
+rune_map mapupper = { { 0 }, NULL };
+rune_map types = { { 0 }, NULL };
-_RuneLocale new_locale = { 0, };
+_RuneLocale new_locale = { "", "", NULL, NULL, 0, {}, {}, {},
+ {0, NULL}, {0, NULL}, {0, NULL}, NULL, 0 };
void set_map __P((rune_map *, rune_list *, unsigned long));
void set_digitmap __P((rune_map *, rune_list *));
@@ -187,6 +200,7 @@ map : LBRK RUNE RUNE RBRK
int debug = 0;
FILE *fp;
+int
main(ac, av)
int ac;
char *av[];
@@ -236,10 +250,13 @@ main(ac, av)
memcpy(new_locale.magic, _RUNE_MAGIC_1, sizeof(new_locale.magic));
yyparse();
+
+ return(0);
}
+void
yyerror(s)
- char *s;
+ const char *s;
{
fprintf(stderr, "%s\n", s);
}
@@ -538,7 +555,7 @@ dump_tables()
for(list = types.root; list; list = list->next) {
list->map = list->types[0];
for (x = 1; x < list->max - list->min + 1; ++x) {
- if (list->types[x] != list->map) {
+ if ((rune_t)list->types[x] != list->map) {
list->map = 0;
break;
}
OpenPOWER on IntegriCloud