diff options
author | Mark Murray <markm@FreeBSD.org> | 2002-04-28 12:34:54 +0000 |
---|---|---|
committer | Mark Murray <markm@FreeBSD.org> | 2002-04-28 12:34:54 +0000 |
commit | 046f5106a74711066172150345c219e8c962f8b5 (patch) | |
tree | 7a9cb4c96f7dbd48c7201bab3397ebe29e01d201 /usr.bin/mklocale | |
parent | ffc6a8e3250fe439bd9d6a8a45c139c110c50ead (diff) | |
download | src-046f5106a74711066172150345c219e8c962f8b5.tar.gz src-046f5106a74711066172150345c219e8c962f8b5.zip |
Declarations cleanup; make sure externs are in a common header.
Fix declarations, casts and return values.
Notes
Notes:
svn path=/head/; revision=95643
Diffstat (limited to 'usr.bin/mklocale')
-rw-r--r-- | usr.bin/mklocale/extern.h | 40 | ||||
-rw-r--r-- | usr.bin/mklocale/lex.l | 8 | ||||
-rw-r--r-- | usr.bin/mklocale/yacc.y | 33 |
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 000000000000..a52c6b5b9015 --- /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 3b81ea5f6202..11ce80aa7545 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 3001490af995..b1a6979f1e54 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; } |