X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=gcc%2Fscan.c;fp=gcc%2Fscan.c;h=a66107933a4aecdda635d127e98ece55b36bc052;hb=6fed43773c9b0ce596dca5686f37ac3fc0fa11c0;hp=ee2607c575efec05135cb47be9561b1123f76456;hpb=27b11d56b743098deb193d510b337ba22dc52e5c;p=msp430-gcc.git diff --git a/gcc/scan.c b/gcc/scan.c index ee2607c5..a6610793 100644 --- a/gcc/scan.c +++ b/gcc/scan.c @@ -1,22 +1,25 @@ /* Utility functions for scan-decls and fix-header programs. - Copyright (C) 1993, 1994, 1998, 2002 Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 1998, 2002, 2003, 2007, 2008 + Free Software Foundation, Inc. -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, 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, 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, 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; see the file COPYING3. If not see + . */ -#include "hconfig.h" +#include "bconfig.h" #include "system.h" +#include "coretypes.h" +#include "tm.h" #include "scan.h" int lineno = 1; @@ -24,9 +27,7 @@ int source_lineno = 1; sstring source_filename; void -make_sstring_space (str, count) - sstring *str; - int count; +make_sstring_space (sstring *str, int count) { int cur_pos = str->ptr - str->base; int cur_size = str->limit - str->base; @@ -34,16 +35,14 @@ make_sstring_space (str, count) if (new_size <= cur_size) return; - - str->base = xrealloc (str->base, new_size); + + str->base = (char *) xrealloc (str->base, new_size); str->ptr = str->base + cur_size; str->limit = str->base + new_size; } void -sstring_append (dst, src) - sstring *dst; - sstring *src; +sstring_append (sstring *dst, sstring *src) { char *d, *s; int count = SSTRING_LENGTH (src); @@ -53,14 +52,11 @@ sstring_append (dst, src) s = src->base; while (--count >= 0) *d++ = *s++; dst->ptr = d; - *d = 0; + *d = 0; } int -scan_ident (fp, s, c) - FILE *fp; - sstring *s; - int c; +scan_ident (FILE *fp, sstring *s, int c) { s->ptr = s->base; if (ISIDST (c)) @@ -79,10 +75,7 @@ scan_ident (fp, s, c) } int -scan_string (fp, s, init) - FILE *fp; - sstring *s; - int init; +scan_string (FILE *fp, sstring *s, int init) { int c; @@ -114,9 +107,7 @@ scan_string (fp, s, init) /* Skip horizontal white spaces (spaces, tabs, and C-style comments). */ int -skip_spaces (fp, c) - FILE *fp; - int c; +skip_spaces (FILE *fp, int c) { for (;;) { @@ -152,10 +143,7 @@ skip_spaces (fp, c) } int -read_upto (fp, str, delim) - FILE *fp; - sstring *str; - int delim; +read_upto (FILE *fp, sstring *str, int delim) { int ch; @@ -172,9 +160,7 @@ read_upto (fp, str, delim) } int -get_token (fp, s) - FILE *fp; - sstring *s; +get_token (FILE *fp, sstring *s) { int c; @@ -242,9 +228,7 @@ get_token (fp, s) } unsigned int -hashstr (str, len) - const char *str; - unsigned int len; +hashstr (const char *str, unsigned int len) { unsigned int n = len; unsigned int r = 0;