X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=binutils%2Fsysinfo.y;h=1e6f75bc8c9a15296f4ed81dd804562ee2d35f4b;hb=313628ccbab4a2f66be351ba65a0734e75e3448f;hp=4aa46073bbbe0650c6cd1b343d25b138f6948446;hpb=2ee563b53258d390d7446e90a67f465d504ae44c;p=deliverable%2Fbinutils-gdb.git diff --git a/binutils/sysinfo.y b/binutils/sysinfo.y index 4aa46073bb..1e6f75bc8c 100644 --- a/binutils/sysinfo.y +++ b/binutils/sysinfo.y @@ -1,42 +1,39 @@ -/* Copyright 2001 Free Software Foundation, Inc. +/* Copyright 2001, 2003, 2005, 2007 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support (steve@cygnus.com). -This file is part of GNU binutils. + This file is part of GNU binutils. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ %{ #include #include -extern char *word; -extern char writecode; -extern int number; -extern int unit; -char nice_name[1000]; -char *it; -int sofar; -int width; -int code; -char * repeat; -char *oldrepeat; -char *name; -int rdepth; -char *loop [] = {"","n","m","/*BAD*/"}; -char *names[] = {" ","[n]","[n][m]"}; -char *pnames[]= {"","*","**"}; +static char writecode; +static char *it; +static int code; +static char * repeat; +static char *oldrepeat; +static char *name; +static int rdepth; +static char *names[] = {" ","[n]","[n][m]"}; +static char *pnames[]= {"","*","**"}; + +static int yyerror (char *s); +extern int yylex (void); %} @@ -117,7 +114,7 @@ it: printf("void sysroff_swap_%s_in(ptr)\n",$2); printf("struct IT_%s *ptr;\n", it); printf("{\n"); - printf("char raw[255];\n"); + printf("unsigned char raw[255];\n"); printf("\tint idx = 0 ;\n"); printf("\tint size;\n"); printf("memset(raw,0,255);\n"); @@ -129,7 +126,7 @@ it: printf("FILE * file;\n"); printf("struct IT_%s *ptr;\n", it); printf("{\n"); - printf("\tchar raw[255];\n"); + printf("\tunsigned char raw[255];\n"); printf("\tint idx = 16 ;\n"); printf("\tmemset (raw, 0, 255);\n"); printf("\tcode = IT_%s_CODE;\n", it); @@ -406,18 +403,15 @@ enum_list: %% /* four modes - -d write structure defintions for sysroff in host format + -d write structure definitions for sysroff in host format -i write functions to swap into sysroff format in -o write functions to swap into sysroff format out -c write code to print info in human form */ int yydebug; -char writecode; int -main(ac,av) -int ac; -char **av; +main (int ac, char **av) { yydebug=0; if (ac > 1) @@ -433,9 +427,8 @@ if (writecode == 'd') return 0; } -int -yyerror(s) - char *s; +static int +yyerror (char *s) { fprintf(stderr, "%s\n" , s); return 0;