Commit 6cf87ca4 by Zack Weinberg

* cpplib.h, cpphash.h, cppcharset.c, cpperror.c, cppexp.c

	* cppfiles.c, cpphash.c, cppinit.c, cpplex.c, cpplib.c
	* cppmacro.c, cpppch.c, cpptrad.c, cppspec.c: Convert to
	ISO C: new-style function declarations, no need for PARAMS,
	no special punctuation on indirect function calls, use string
	constant concatenation where convenient.

From-SVN: r68070
parent 82620aaf
2003-06-16 Zack Weinberg <zack@codesourcery.com>
* cpplib.h, cpphash.h, cppcharset.c, cpperror.c, cppexp.c
* cppfiles.c, cpphash.c, cppinit.c, cpplex.c, cpplib.c
* cppmacro.c, cpppch.c, cpptrad.c, cppspec.c: Convert to
ISO C: new-style function declarations, no need for PARAMS,
no special punctuation on indirect function calls, use string
constant concatenation where convenient.
2003-06-17 Andreas Jaeger <aj@suse.de> 2003-06-17 Andreas Jaeger <aj@suse.de>
* rtl.h: Remove declarations from coverage.h. * rtl.h: Remove declarations from coverage.h.
...@@ -16,11 +25,11 @@ ...@@ -16,11 +25,11 @@
* config/sparc/aout.h, config/sparc/biarch64.h, config/sparc/elf.h, * config/sparc/aout.h, config/sparc/biarch64.h, config/sparc/elf.h,
config/sparc/freebsd.h, config/sparc/linux.h, config/sparc/linux64.h, config/sparc/freebsd.h, config/sparc/linux.h, config/sparc/linux64.h,
config/sparc/lite.h, config/sparc/litecoff.h, config/sparc/liteelf.h, config/sparc/lite.h, config/sparc/litecoff.h, config/sparc/liteelf.h,
config/sparc/netbsd-elf.h, config/sparc/openbsd.h, config/sparc/netbsd-elf.h, config/sparc/openbsd.h,
config/sparc/rtemself.h, config/sparc/sol2-64.h, config/sparc/rtemself.h, config/sparc/sol2-64.h,
config/sparc/sol2-bi.h, config/sparc/sol2-gas-bi.h, config/sparc/sol2-bi.h, config/sparc/sol2-gas-bi.h,
config/sparc/sol2-gld-bi.h, config/sparc/sol2-gld.h, config/sparc/sol2-gld-bi.h, config/sparc/sol2-gld.h,
config/sparc/sol2.h, config/sparc/sp64-aout.h, config/sparc/sol2.h, config/sparc/sp64-aout.h,
config/sparc/sp64-elf.h, config/sparc/sp86x-elf.h, config/sparc/sp64-elf.h, config/sparc/sp86x-elf.h,
config/sparc/sparc-protos.h, config/sparc/sysv4-only.h: Replace config/sparc/sparc-protos.h, config/sparc/sysv4-only.h: Replace
"GNU compiler", "GNU CC" with "GCC". "GNU compiler", "GNU CC" with "GCC".
...@@ -82,7 +91,7 @@ ...@@ -82,7 +91,7 @@
* builtin-attrs.def, builtin-attrs.def, builtins.c, cpplex.c, * builtin-attrs.def, builtin-attrs.def, builtins.c, cpplex.c,
cpplib.c, gencheck.c, gengenrtl.c, machmode.def, protoize.c: Don't cpplib.c, gencheck.c, gengenrtl.c, machmode.def, protoize.c: Don't
use macros from "symcat.h", instead rely on ISO C. use macros from "symcat.h", instead rely on ISO C.
* system.h: Don't include "symcat.h". * system.h: Don't include "symcat.h".
* configure.in (AC_C_STRINGIZE): Delete. * configure.in (AC_C_STRINGIZE): Delete.
* config.in, configure: Regenerate. * config.in, configure: Regenerate.
......
...@@ -25,7 +25,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ...@@ -25,7 +25,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "cpplib.h" #include "cpplib.h"
#include "cpphash.h" #include "cpphash.h"
static int ucn_valid_in_identifier PARAMS ((cpp_reader *, cppchar_t)); static int ucn_valid_in_identifier (cpp_reader *, cppchar_t);
/* [lex.charset]: The character designated by the universal character /* [lex.charset]: The character designated by the universal character
name \UNNNNNNNN is that character whose character short name in name \UNNNNNNNN is that character whose character short name in
...@@ -52,10 +52,7 @@ static int ucn_valid_in_identifier PARAMS ((cpp_reader *, cppchar_t)); ...@@ -52,10 +52,7 @@ static int ucn_valid_in_identifier PARAMS ((cpp_reader *, cppchar_t));
*/ */
cppchar_t cppchar_t
_cpp_valid_ucn (pfile, pstr, identifier_pos) _cpp_valid_ucn (cpp_reader *pfile, const uchar **pstr, int identifier_pos)
cpp_reader *pfile;
const uchar **pstr;
int identifier_pos;
{ {
cppchar_t result, c; cppchar_t result, c;
unsigned int length; unsigned int length;
...@@ -128,9 +125,7 @@ _cpp_valid_ucn (pfile, pstr, identifier_pos) ...@@ -128,9 +125,7 @@ _cpp_valid_ucn (pfile, pstr, identifier_pos)
identifier. We assume C has already gone through the checks of identifier. We assume C has already gone through the checks of
_cpp_valid_ucn. */ _cpp_valid_ucn. */
static int static int
ucn_valid_in_identifier (pfile, c) ucn_valid_in_identifier (cpp_reader *pfile, cppchar_t c)
cpp_reader *pfile;
cppchar_t c;
{ {
/* None of the valid chars are outside the Basic Multilingual Plane (the /* None of the valid chars are outside the Basic Multilingual Plane (the
low 16 bits). */ low 16 bits). */
......
...@@ -31,16 +31,14 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -31,16 +31,14 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "cpphash.h" #include "cpphash.h"
#include "intl.h" #include "intl.h"
static void print_location PARAMS ((cpp_reader *, unsigned int, unsigned int)); static void print_location (cpp_reader *, unsigned int, unsigned int);
/* Print the logical file location (LINE, COL) in preparation for a /* Print the logical file location (LINE, COL) in preparation for a
diagnostic. Outputs the #include chain if it has changed. A line diagnostic. Outputs the #include chain if it has changed. A line
of zero suppresses the include stack, and outputs the program name of zero suppresses the include stack, and outputs the program name
instead. */ instead. */
static void static void
print_location (pfile, line, col) print_location (cpp_reader *pfile, unsigned int line, unsigned int col)
cpp_reader *pfile;
unsigned int line, col;
{ {
if (!pfile->buffer || line == 0) if (!pfile->buffer || line == 0)
fprintf (stderr, "%s: ", progname); fprintf (stderr, "%s: ", progname);
...@@ -72,10 +70,8 @@ print_location (pfile, line, col) ...@@ -72,10 +70,8 @@ print_location (pfile, line, col)
the correct place by default. Returns 0 if the error has been the correct place by default. Returns 0 if the error has been
suppressed. */ suppressed. */
int int
_cpp_begin_message (pfile, code, line, column) _cpp_begin_message (cpp_reader *pfile, int code, unsigned int line,
cpp_reader *pfile; unsigned int column)
int code;
unsigned int line, column;
{ {
int level = DL_EXTRACT (code); int level = DL_EXTRACT (code);
...@@ -177,10 +173,7 @@ cpp_error_with_line (cpp_reader *pfile, int level, ...@@ -177,10 +173,7 @@ cpp_error_with_line (cpp_reader *pfile, int level,
} }
void void
cpp_errno (pfile, level, msgid) cpp_errno (cpp_reader *pfile, int level, const char *msgid)
cpp_reader *pfile;
int level;
const char *msgid;
{ {
if (msgid[0] == '\0') if (msgid[0] == '\0')
msgid = _("stdout"); msgid = _("stdout");
......
...@@ -30,13 +30,12 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -30,13 +30,12 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "cpplib.h" #include "cpplib.h"
#include "cpphash.h" #include "cpphash.h"
static cpp_hashnode *alloc_node PARAMS ((hash_table *)); static cpp_hashnode *alloc_node (hash_table *);
/* Return an identifier node for hashtable.c. Used by cpplib except /* Return an identifier node for hashtable.c. Used by cpplib except
when integrated with the C front ends. */ when integrated with the C front ends. */
static cpp_hashnode * static cpp_hashnode *
alloc_node (table) alloc_node (hash_table *table)
hash_table *table;
{ {
cpp_hashnode *node; cpp_hashnode *node;
...@@ -49,9 +48,7 @@ alloc_node (table) ...@@ -49,9 +48,7 @@ alloc_node (table)
/* Set up the identifier hash table. Use TABLE if non-null, otherwise /* Set up the identifier hash table. Use TABLE if non-null, otherwise
create our own. */ create our own. */
void void
_cpp_init_hashtable (pfile, table) _cpp_init_hashtable (cpp_reader *pfile, hash_table *table)
cpp_reader *pfile;
hash_table *table;
{ {
struct spec_nodes *s; struct spec_nodes *s;
...@@ -59,7 +56,7 @@ _cpp_init_hashtable (pfile, table) ...@@ -59,7 +56,7 @@ _cpp_init_hashtable (pfile, table)
{ {
pfile->our_hashtable = 1; pfile->our_hashtable = 1;
table = ht_create (13); /* 8K (=2^13) entries. */ table = ht_create (13); /* 8K (=2^13) entries. */
table->alloc_node = (hashnode (*) PARAMS ((hash_table *))) alloc_node; table->alloc_node = (hashnode (*) (hash_table *)) alloc_node;
gcc_obstack_init (&pfile->hash_ob); gcc_obstack_init (&pfile->hash_ob);
} }
...@@ -80,8 +77,7 @@ _cpp_init_hashtable (pfile, table) ...@@ -80,8 +77,7 @@ _cpp_init_hashtable (pfile, table)
/* Tear down the identifier hash table. */ /* Tear down the identifier hash table. */
void void
_cpp_destroy_hashtable (pfile) _cpp_destroy_hashtable (cpp_reader *pfile)
cpp_reader *pfile;
{ {
if (pfile->our_hashtable) if (pfile->our_hashtable)
{ {
...@@ -93,10 +89,7 @@ _cpp_destroy_hashtable (pfile) ...@@ -93,10 +89,7 @@ _cpp_destroy_hashtable (pfile)
/* Returns the hash entry for the STR of length LEN, creating one /* Returns the hash entry for the STR of length LEN, creating one
if necessary. */ if necessary. */
cpp_hashnode * cpp_hashnode *
cpp_lookup (pfile, str, len) cpp_lookup (cpp_reader *pfile, const unsigned char *str, unsigned int len)
cpp_reader *pfile;
const unsigned char *str;
unsigned int len;
{ {
/* ht_lookup cannot return NULL. */ /* ht_lookup cannot return NULL. */
return CPP_HASHNODE (ht_lookup (pfile->hash_table, str, len, HT_ALLOC)); return CPP_HASHNODE (ht_lookup (pfile->hash_table, str, len, HT_ALLOC));
...@@ -104,10 +97,7 @@ cpp_lookup (pfile, str, len) ...@@ -104,10 +97,7 @@ cpp_lookup (pfile, str, len)
/* Determine whether the str STR, of length LEN, is a defined macro. */ /* Determine whether the str STR, of length LEN, is a defined macro. */
int int
cpp_defined (pfile, str, len) cpp_defined (cpp_reader *pfile, const unsigned char *str, int len)
cpp_reader *pfile;
const unsigned char *str;
int len;
{ {
cpp_hashnode *node; cpp_hashnode *node;
...@@ -120,10 +110,7 @@ cpp_defined (pfile, str, len) ...@@ -120,10 +110,7 @@ cpp_defined (pfile, str, len)
/* For all nodes in the hashtable, callback CB with parameters PFILE, /* For all nodes in the hashtable, callback CB with parameters PFILE,
the node, and V. */ the node, and V. */
void void
cpp_forall_identifiers (pfile, cb, v) cpp_forall_identifiers (cpp_reader *pfile, cpp_cb cb, void *v)
cpp_reader *pfile;
cpp_cb cb;
void *v;
{ {
/* We don't need a proxy since the hash table's identifier comes /* We don't need a proxy since the hash table's identifier comes
first in cpp_hashnode. */ first in cpp_hashnode. */
......
...@@ -27,10 +27,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ...@@ -27,10 +27,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "cpphash.h" #include "cpphash.h"
#include "mkdeps.h" #include "mkdeps.h"
static void init_library PARAMS ((void)); static void init_library (void);
static void mark_named_operators PARAMS ((cpp_reader *)); static void mark_named_operators (cpp_reader *);
static void read_original_filename PARAMS ((cpp_reader *)); static void read_original_filename (cpp_reader *);
static void post_options PARAMS ((cpp_reader *)); static void post_options (cpp_reader *);
/* If we have designated initializers (GCC >2.7) these tables can be /* If we have designated initializers (GCC >2.7) these tables can be
initialized, constant data. Otherwise, they have to be filled in at initialized, constant data. Otherwise, they have to be filled in at
...@@ -47,7 +47,7 @@ __extension__ const uchar _cpp_trigraph_map[UCHAR_MAX + 1] = { ...@@ -47,7 +47,7 @@ __extension__ const uchar _cpp_trigraph_map[UCHAR_MAX + 1] = {
#else #else
#define TRIGRAPH_MAP uchar _cpp_trigraph_map[UCHAR_MAX + 1] = { 0 }; \ #define TRIGRAPH_MAP uchar _cpp_trigraph_map[UCHAR_MAX + 1] = { 0 }; \
static void init_trigraph_map PARAMS ((void)) { \ static void init_trigraph_map (void) { \
unsigned char *x = _cpp_trigraph_map; unsigned char *x = _cpp_trigraph_map;
#define END } #define END }
...@@ -91,9 +91,7 @@ static const struct lang_flags lang_defaults[] = ...@@ -91,9 +91,7 @@ static const struct lang_flags lang_defaults[] =
/* Sets internal flags correctly for a given language. */ /* Sets internal flags correctly for a given language. */
void void
cpp_set_lang (pfile, lang) cpp_set_lang (cpp_reader *pfile, enum c_lang lang)
cpp_reader *pfile;
enum c_lang lang;
{ {
const struct lang_flags *l = &lang_defaults[(int) lang]; const struct lang_flags *l = &lang_defaults[(int) lang];
...@@ -110,7 +108,7 @@ cpp_set_lang (pfile, lang) ...@@ -110,7 +108,7 @@ cpp_set_lang (pfile, lang)
/* Initialize library global state. */ /* Initialize library global state. */
static void static void
init_library () init_library (void)
{ {
static int initialized = 0; static int initialized = 0;
...@@ -127,9 +125,7 @@ init_library () ...@@ -127,9 +125,7 @@ init_library ()
/* Initialize a cpp_reader structure. */ /* Initialize a cpp_reader structure. */
cpp_reader * cpp_reader *
cpp_create_reader (lang, table) cpp_create_reader (enum c_lang lang, hash_table *table)
enum c_lang lang;
hash_table *table;
{ {
cpp_reader *pfile; cpp_reader *pfile;
...@@ -205,8 +201,7 @@ cpp_create_reader (lang, table) ...@@ -205,8 +201,7 @@ cpp_create_reader (lang, table)
/* Free resources used by PFILE. Accessing PFILE after this function /* Free resources used by PFILE. Accessing PFILE after this function
returns leads to undefined behavior. Returns the error count. */ returns leads to undefined behavior. Returns the error count. */
void void
cpp_destroy (pfile) cpp_destroy (cpp_reader *pfile)
cpp_reader *pfile;
{ {
cpp_context *context, *contextn; cpp_context *context, *contextn;
tokenrun *run, *runn; tokenrun *run, *runn;
...@@ -309,8 +304,7 @@ static const struct builtin operator_array[] = ...@@ -309,8 +304,7 @@ static const struct builtin operator_array[] =
/* Mark the C++ named operators in the hash table. */ /* Mark the C++ named operators in the hash table. */
static void static void
mark_named_operators (pfile) mark_named_operators (cpp_reader *pfile)
cpp_reader *pfile;
{ {
const struct builtin *b; const struct builtin *b;
...@@ -329,9 +323,7 @@ mark_named_operators (pfile) ...@@ -329,9 +323,7 @@ mark_named_operators (pfile)
macros, into the hash table. HOSTED is true if this is a hosted macros, into the hash table. HOSTED is true if this is a hosted
environment. */ environment. */
void void
cpp_init_builtins (pfile, hosted) cpp_init_builtins (cpp_reader *pfile, int hosted)
cpp_reader *pfile;
int hosted;
{ {
const struct builtin *b; const struct builtin *b;
size_t n = ARRAY_SIZE (builtin_array); size_t n = ARRAY_SIZE (builtin_array);
...@@ -368,9 +360,8 @@ cpp_init_builtins (pfile, hosted) ...@@ -368,9 +360,8 @@ cpp_init_builtins (pfile, hosted)
/* Sanity-checks are dependent on command-line options, so it is /* Sanity-checks are dependent on command-line options, so it is
called as a subroutine of cpp_read_main_file (). */ called as a subroutine of cpp_read_main_file (). */
#if ENABLE_CHECKING #if ENABLE_CHECKING
static void sanity_checks PARAMS ((cpp_reader *)); static void sanity_checks (cpp_reader *);
static void sanity_checks (pfile) static void sanity_checks (cpp_reader *pfile)
cpp_reader *pfile;
{ {
cppchar_t test = 0; cppchar_t test = 0;
size_t max_precision = 2 * CHAR_BIT * sizeof (cpp_num_part); size_t max_precision = 2 * CHAR_BIT * sizeof (cpp_num_part);
...@@ -383,7 +374,8 @@ static void sanity_checks (pfile) ...@@ -383,7 +374,8 @@ static void sanity_checks (pfile)
if (CPP_OPTION (pfile, precision) > max_precision) if (CPP_OPTION (pfile, precision) > max_precision)
cpp_error (pfile, DL_ICE, cpp_error (pfile, DL_ICE,
"preprocessor arithmetic has maximum precision of %lu bits; target requires %lu bits", "preprocessor arithmetic has maximum precision of %lu bits;"
" target requires %lu bits",
(unsigned long) max_precision, (unsigned long) max_precision,
(unsigned long) CPP_OPTION (pfile, precision)); (unsigned long) CPP_OPTION (pfile, precision));
...@@ -408,7 +400,8 @@ static void sanity_checks (pfile) ...@@ -408,7 +400,8 @@ static void sanity_checks (pfile)
if (CPP_OPTION (pfile, wchar_precision) > BITS_PER_CPPCHAR_T) if (CPP_OPTION (pfile, wchar_precision) > BITS_PER_CPPCHAR_T)
cpp_error (pfile, DL_ICE, cpp_error (pfile, DL_ICE,
"CPP on this host cannot handle wide character constants over %lu bits, but the target requires %lu bits", "CPP on this host cannot handle wide character constants over"
" %lu bits, but the target requires %lu bits",
(unsigned long) BITS_PER_CPPCHAR_T, (unsigned long) BITS_PER_CPPCHAR_T,
(unsigned long) CPP_OPTION (pfile, wchar_precision)); (unsigned long) CPP_OPTION (pfile, wchar_precision));
} }
...@@ -420,10 +413,7 @@ static void sanity_checks (pfile) ...@@ -420,10 +413,7 @@ static void sanity_checks (pfile)
cpp_read_main_file(). If no targets have been added before cpp_read_main_file(). If no targets have been added before
cpp_read_main_file(), then the default target is used. */ cpp_read_main_file(), then the default target is used. */
void void
cpp_add_dependency_target (pfile, target, quote) cpp_add_dependency_target (cpp_reader *pfile, const char *target, int quote)
cpp_reader *pfile;
const char *target;
int quote;
{ {
if (!pfile->deps) if (!pfile->deps)
pfile->deps = deps_init (); pfile->deps = deps_init ();
...@@ -436,9 +426,7 @@ cpp_add_dependency_target (pfile, target, quote) ...@@ -436,9 +426,7 @@ cpp_add_dependency_target (pfile, target, quote)
or stdin if it is the empty string. Return the original filename or stdin if it is the empty string. Return the original filename
on success (e.g. foo.i->foo.c), or NULL on failure. */ on success (e.g. foo.i->foo.c), or NULL on failure. */
const char * const char *
cpp_read_main_file (pfile, fname) cpp_read_main_file (cpp_reader *pfile, const char *fname)
cpp_reader *pfile;
const char *fname;
{ {
sanity_checks (pfile); sanity_checks (pfile);
...@@ -480,8 +468,7 @@ cpp_read_main_file (pfile, fname) ...@@ -480,8 +468,7 @@ cpp_read_main_file (pfile, fname)
generate file_change callbacks, which the front ends must handle generate file_change callbacks, which the front ends must handle
appropriately given their state of initialization. */ appropriately given their state of initialization. */
static void static void
read_original_filename (pfile) read_original_filename (cpp_reader *pfile)
cpp_reader *pfile;
{ {
const cpp_token *token, *token1; const cpp_token *token, *token1;
...@@ -512,9 +499,7 @@ read_original_filename (pfile) ...@@ -512,9 +499,7 @@ read_original_filename (pfile)
Maybe it should also reset state, such that you could call Maybe it should also reset state, such that you could call
cpp_start_read with a new filename to restart processing. */ cpp_start_read with a new filename to restart processing. */
int int
cpp_finish (pfile, deps_stream) cpp_finish (cpp_reader *pfile, FILE *deps_stream)
cpp_reader *pfile;
FILE *deps_stream;
{ {
/* Warn about unused macros before popping the final buffer. */ /* Warn about unused macros before popping the final buffer. */
if (CPP_OPTION (pfile, warn_unused_macros)) if (CPP_OPTION (pfile, warn_unused_macros))
...@@ -546,8 +531,7 @@ cpp_finish (pfile, deps_stream) ...@@ -546,8 +531,7 @@ cpp_finish (pfile, deps_stream)
} }
static void static void
post_options (pfile) post_options (cpp_reader *pfile)
cpp_reader *pfile;
{ {
/* -Wtraditional is not useful in C++ mode. */ /* -Wtraditional is not useful in C++ mode. */
if (CPP_OPTION (pfile, cplusplus)) if (CPP_OPTION (pfile, cplusplus))
......
...@@ -24,16 +24,16 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ...@@ -24,16 +24,16 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "hashtab.h" #include "hashtab.h"
#include "mkdeps.h" #include "mkdeps.h"
static int write_macdef PARAMS ((cpp_reader *, cpp_hashnode *, void *)); static int write_macdef (cpp_reader *, cpp_hashnode *, void *);
static int save_idents PARAMS ((cpp_reader *, cpp_hashnode *, void *)); static int save_idents (cpp_reader *, cpp_hashnode *, void *);
static hashval_t hashmem PARAMS ((const void *, size_t)); static hashval_t hashmem (const void *, size_t);
static hashval_t cpp_string_hash PARAMS ((const void *)); static hashval_t cpp_string_hash (const void *);
static int cpp_string_eq PARAMS ((const void *, const void *)); static int cpp_string_eq (const void *, const void *);
static int count_defs PARAMS ((cpp_reader *, cpp_hashnode *, void *)); static int count_defs (cpp_reader *, cpp_hashnode *, void *);
static int comp_hashnodes PARAMS ((const void *, const void *)); static int comp_hashnodes (const void *, const void *);
static int collect_ht_nodes PARAMS ((cpp_reader *, cpp_hashnode *, void *)); static int collect_ht_nodes (cpp_reader *, cpp_hashnode *, void *);
static int write_defs PARAMS ((cpp_reader *, cpp_hashnode *, void *)); static int write_defs (cpp_reader *, cpp_hashnode *, void *);
static int save_macros PARAMS ((cpp_reader *, cpp_hashnode *, void *)); static int save_macros (cpp_reader *, cpp_hashnode *, void *);
/* This structure represents a macro definition on disk. */ /* This structure represents a macro definition on disk. */
struct macrodef_struct struct macrodef_struct
...@@ -47,10 +47,7 @@ struct macrodef_struct ...@@ -47,10 +47,7 @@ struct macrodef_struct
Suitable for being called by cpp_forall_identifiers. */ Suitable for being called by cpp_forall_identifiers. */
static int static int
write_macdef (pfile, hn, file_p) write_macdef (cpp_reader *pfile, cpp_hashnode *hn, void *file_p)
cpp_reader *pfile;
cpp_hashnode *hn;
void *file_p;
{ {
FILE *f = (FILE *) file_p; FILE *f = (FILE *) file_p;
switch (hn->type) switch (hn->type)
...@@ -123,10 +120,7 @@ struct cpp_savedstate ...@@ -123,10 +120,7 @@ struct cpp_savedstate
put the definition in 'definedstrs'. */ put the definition in 'definedstrs'. */
static int static int
save_idents (pfile, hn, ss_p) save_idents (cpp_reader *pfile ATTRIBUTE_UNUSED, cpp_hashnode *hn, void *ss_p)
cpp_reader *pfile ATTRIBUTE_UNUSED;
cpp_hashnode *hn;
void *ss_p;
{ {
struct cpp_savedstate *const ss = (struct cpp_savedstate *)ss_p; struct cpp_savedstate *const ss = (struct cpp_savedstate *)ss_p;
...@@ -158,9 +152,7 @@ save_idents (pfile, hn, ss_p) ...@@ -158,9 +152,7 @@ save_idents (pfile, hn, ss_p)
/* Hash some memory in a generic way. */ /* Hash some memory in a generic way. */
static hashval_t static hashval_t
hashmem (p_p, sz) hashmem (const void *p_p, size_t sz)
const void *p_p;
size_t sz;
{ {
const unsigned char *p = (const unsigned char *)p_p; const unsigned char *p = (const unsigned char *)p_p;
size_t i; size_t i;
...@@ -175,8 +167,7 @@ hashmem (p_p, sz) ...@@ -175,8 +167,7 @@ hashmem (p_p, sz)
/* Hash a cpp string for the hashtable machinery. */ /* Hash a cpp string for the hashtable machinery. */
static hashval_t static hashval_t
cpp_string_hash (a_p) cpp_string_hash (const void *a_p)
const void *a_p;
{ {
const struct cpp_string *a = (const struct cpp_string *) a_p; const struct cpp_string *a = (const struct cpp_string *) a_p;
return hashmem (a->text, a->len); return hashmem (a->text, a->len);
...@@ -185,9 +176,7 @@ cpp_string_hash (a_p) ...@@ -185,9 +176,7 @@ cpp_string_hash (a_p)
/* Compare two cpp strings for the hashtable machinery. */ /* Compare two cpp strings for the hashtable machinery. */
static int static int
cpp_string_eq (a_p, b_p) cpp_string_eq (const void *a_p, const void *b_p)
const void *a_p;
const void *b_p;
{ {
const struct cpp_string *a = (const struct cpp_string *) a_p; const struct cpp_string *a = (const struct cpp_string *) a_p;
const struct cpp_string *b = (const struct cpp_string *) b_p; const struct cpp_string *b = (const struct cpp_string *) b_p;
...@@ -201,9 +190,7 @@ cpp_string_eq (a_p, b_p) ...@@ -201,9 +190,7 @@ cpp_string_eq (a_p, b_p)
would be called when reading the precompiled header back in. */ would be called when reading the precompiled header back in. */
int int
cpp_save_state (r, f) cpp_save_state (cpp_reader *r, FILE *f)
cpp_reader *r;
FILE *f;
{ {
/* Save the list of non-void identifiers for the dependency checking. */ /* Save the list of non-void identifiers for the dependency checking. */
r->savedstate = xmalloc (sizeof (struct cpp_savedstate)); r->savedstate = xmalloc (sizeof (struct cpp_savedstate));
...@@ -220,10 +207,7 @@ cpp_save_state (r, f) ...@@ -220,10 +207,7 @@ cpp_save_state (r, f)
/* Calculate the 'hashsize' field of the saved state. */ /* Calculate the 'hashsize' field of the saved state. */
static int static int
count_defs (pfile, hn, ss_p) count_defs (cpp_reader *pfile ATTRIBUTE_UNUSED, cpp_hashnode *hn, void *ss_p)
cpp_reader *pfile ATTRIBUTE_UNUSED;
cpp_hashnode *hn;
void *ss_p;
{ {
struct cpp_savedstate *const ss = (struct cpp_savedstate *)ss_p; struct cpp_savedstate *const ss = (struct cpp_savedstate *)ss_p;
...@@ -262,10 +246,7 @@ count_defs (pfile, hn, ss_p) ...@@ -262,10 +246,7 @@ count_defs (pfile, hn, ss_p)
/* Collect the identifiers into the state's string table. */ /* Collect the identifiers into the state's string table. */
static int static int
write_defs (pfile, hn, ss_p) write_defs (cpp_reader *pfile ATTRIBUTE_UNUSED, cpp_hashnode *hn, void *ss_p)
cpp_reader *pfile ATTRIBUTE_UNUSED;
cpp_hashnode *hn;
void *ss_p;
{ {
struct cpp_savedstate *const ss = (struct cpp_savedstate *)ss_p; struct cpp_savedstate *const ss = (struct cpp_savedstate *)ss_p;
...@@ -305,9 +286,7 @@ write_defs (pfile, hn, ss_p) ...@@ -305,9 +286,7 @@ write_defs (pfile, hn, ss_p)
/* Comparison function for qsort. The arguments point to pointers of /* Comparison function for qsort. The arguments point to pointers of
type ht_hashnode *. */ type ht_hashnode *. */
static int static int
comp_hashnodes (px, py) comp_hashnodes (const void *px, const void *py)
const void *px;
const void *py;
{ {
cpp_hashnode *x = *(cpp_hashnode **) px; cpp_hashnode *x = *(cpp_hashnode **) px;
cpp_hashnode *y = *(cpp_hashnode **) py; cpp_hashnode *y = *(cpp_hashnode **) py;
...@@ -318,9 +297,7 @@ comp_hashnodes (px, py) ...@@ -318,9 +297,7 @@ comp_hashnodes (px, py)
called after the PCH is ready to be saved. */ called after the PCH is ready to be saved. */
int int
cpp_write_pch_deps (r, f) cpp_write_pch_deps (cpp_reader *r, FILE *f)
cpp_reader *r;
FILE *f;
{ {
struct macrodef_struct z; struct macrodef_struct z;
struct cpp_savedstate *const ss = r->savedstate; struct cpp_savedstate *const ss = r->savedstate;
...@@ -367,9 +344,7 @@ cpp_write_pch_deps (r, f) ...@@ -367,9 +344,7 @@ cpp_write_pch_deps (r, f)
cpp_read_state. */ cpp_read_state. */
int int
cpp_write_pch_state (r, f) cpp_write_pch_state (cpp_reader *r, FILE *f)
cpp_reader *r;
FILE *f;
{ {
struct macrodef_struct z; struct macrodef_struct z;
...@@ -410,10 +385,8 @@ struct ht_node_list ...@@ -410,10 +385,8 @@ struct ht_node_list
/* Callback for collecting identifiers from hash table */ /* Callback for collecting identifiers from hash table */
static int static int
collect_ht_nodes (pfile, hn, nl_p) collect_ht_nodes (cpp_reader *pfile ATTRIBUTE_UNUSED, cpp_hashnode *hn,
cpp_reader *pfile ATTRIBUTE_UNUSED; void *nl_p)
cpp_hashnode *hn;
void *nl_p;
{ {
struct ht_node_list *const nl = (struct ht_node_list *)nl_p; struct ht_node_list *const nl = (struct ht_node_list *)nl_p;
...@@ -446,10 +419,7 @@ collect_ht_nodes (pfile, hn, nl_p) ...@@ -446,10 +419,7 @@ collect_ht_nodes (pfile, hn, nl_p)
*/ */
int int
cpp_valid_state (r, name, fd) cpp_valid_state (cpp_reader *r, const char *name, int fd)
cpp_reader *r;
const char *name;
int fd;
{ {
struct macrodef_struct m; struct macrodef_struct m;
size_t namebufsz = 256; size_t namebufsz = 256;
...@@ -583,10 +553,7 @@ struct save_macro_data ...@@ -583,10 +553,7 @@ struct save_macro_data
a PCH restore. */ a PCH restore. */
static int static int
save_macros (r, h, data_p) save_macros (cpp_reader *r ATTRIBUTE_UNUSED, cpp_hashnode *h, void *data_p)
cpp_reader *r ATTRIBUTE_UNUSED;
cpp_hashnode *h;
void *data_p;
{ {
struct save_macro_data *data = (struct save_macro_data *)data_p; struct save_macro_data *data = (struct save_macro_data *)data_p;
if (h->type != NT_VOID if (h->type != NT_VOID
...@@ -614,9 +581,7 @@ save_macros (r, h, data_p) ...@@ -614,9 +581,7 @@ save_macros (r, h, data_p)
macros in 'data'. */ macros in 'data'. */
void void
cpp_prepare_state (r, data) cpp_prepare_state (cpp_reader *r, struct save_macro_data **data)
cpp_reader *r;
struct save_macro_data **data;
{ {
struct save_macro_data *d = xmalloc (sizeof (struct save_macro_data)); struct save_macro_data *d = xmalloc (sizeof (struct save_macro_data));
...@@ -632,11 +597,8 @@ cpp_prepare_state (r, data) ...@@ -632,11 +597,8 @@ cpp_prepare_state (r, data)
DEPNAME is passed to deps_restore. */ DEPNAME is passed to deps_restore. */
int int
cpp_read_state (r, name, f, data) cpp_read_state (cpp_reader *r, const char *name, FILE *f,
cpp_reader *r; struct save_macro_data *data)
const char *name;
FILE *f;
struct save_macro_data *data;
{ {
struct macrodef_struct m; struct macrodef_struct m;
size_t defnlen = 256; size_t defnlen = 256;
......
...@@ -51,10 +51,8 @@ static const char *const known_suffixes[] = ...@@ -51,10 +51,8 @@ static const char *const known_suffixes[] =
/* Filter argc and argv before processing by the gcc driver proper. */ /* Filter argc and argv before processing by the gcc driver proper. */
void void
lang_specific_driver (in_argc, in_argv, in_added_libraries) lang_specific_driver (int *in_argc, const char *const **in_argv,
int *in_argc; int *in_added_libraries ATTRIBUTE_UNUSED)
const char *const **in_argv;
int *in_added_libraries ATTRIBUTE_UNUSED;
{ {
int argc = *in_argc; int argc = *in_argc;
const char *const *argv = *in_argv; const char *const *argv = *in_argv;
...@@ -203,7 +201,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries) ...@@ -203,7 +201,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
} }
/* Called before linking. Returns 0 on success and -1 on failure. */ /* Called before linking. Returns 0 on success and -1 on failure. */
int lang_specific_pre_link () int lang_specific_pre_link (void)
{ {
return 0; /* Not used for cpp. */ return 0; /* Not used for cpp. */
} }
......
...@@ -81,29 +81,24 @@ enum ls {ls_none = 0, /* Normal state. */ ...@@ -81,29 +81,24 @@ enum ls {ls_none = 0, /* Normal state. */
/* Lexing TODO: Maybe handle space in escaped newlines. Stop cpplex.c /* Lexing TODO: Maybe handle space in escaped newlines. Stop cpplex.c
from recognizing comments and directives during its lexing pass. */ from recognizing comments and directives during its lexing pass. */
static const uchar *skip_whitespace PARAMS ((cpp_reader *, const uchar *, static const uchar *skip_whitespace (cpp_reader *, const uchar *, int);
int)); static cpp_hashnode *lex_identifier (cpp_reader *, const uchar *);
static cpp_hashnode *lex_identifier PARAMS ((cpp_reader *, const uchar *)); static const uchar *copy_comment (cpp_reader *, const uchar *, int);
static const uchar *copy_comment PARAMS ((cpp_reader *, const uchar *, int)); static void check_output_buffer (cpp_reader *, size_t);
static void check_output_buffer PARAMS ((cpp_reader *, size_t)); static void push_replacement_text (cpp_reader *, cpp_hashnode *);
static void push_replacement_text PARAMS ((cpp_reader *, cpp_hashnode *)); static bool scan_parameters (cpp_reader *, cpp_macro *);
static bool scan_parameters PARAMS ((cpp_reader *, cpp_macro *)); static bool recursive_macro (cpp_reader *, cpp_hashnode *);
static bool recursive_macro PARAMS ((cpp_reader *, cpp_hashnode *)); static void save_replacement_text (cpp_reader *, cpp_macro *, unsigned int);
static void save_replacement_text PARAMS ((cpp_reader *, cpp_macro *, static void maybe_start_funlike (cpp_reader *, cpp_hashnode *, const uchar *,
unsigned int)); struct fun_macro *);
static void maybe_start_funlike PARAMS ((cpp_reader *, cpp_hashnode *, static void save_argument (struct fun_macro *, size_t);
const uchar *, struct fun_macro *)); static void replace_args_and_push (cpp_reader *, struct fun_macro *);
static void save_argument PARAMS ((struct fun_macro *, size_t)); static size_t canonicalize_text (uchar *, const uchar *, size_t, uchar *);
static void replace_args_and_push PARAMS ((cpp_reader *, struct fun_macro *));
static size_t canonicalize_text PARAMS ((uchar *, const uchar *, size_t,
uchar *));
/* Ensures we have N bytes' space in the output buffer, and /* Ensures we have N bytes' space in the output buffer, and
reallocates it if not. */ reallocates it if not. */
static void static void
check_output_buffer (pfile, n) check_output_buffer (cpp_reader *pfile, size_t n)
cpp_reader *pfile;
size_t n;
{ {
/* We might need two bytes to terminate an unterminated comment, and /* We might need two bytes to terminate an unterminated comment, and
one more to terminate the line with a NUL. */ one more to terminate the line with a NUL. */
...@@ -134,10 +129,7 @@ check_output_buffer (pfile, n) ...@@ -134,10 +129,7 @@ check_output_buffer (pfile, n)
Returns a pointer to the first character after the comment in the Returns a pointer to the first character after the comment in the
input buffer. */ input buffer. */
static const uchar * static const uchar *
copy_comment (pfile, cur, in_define) copy_comment (cpp_reader *pfile, const uchar *cur, int in_define)
cpp_reader *pfile;
const uchar *cur;
int in_define;
{ {
bool unterminated, copy = false; bool unterminated, copy = false;
unsigned int from_line = pfile->line; unsigned int from_line = pfile->line;
...@@ -197,10 +189,7 @@ copy_comment (pfile, cur, in_define) ...@@ -197,10 +189,7 @@ copy_comment (pfile, cur, in_define)
Returns a pointer to the first character after the whitespace in Returns a pointer to the first character after the whitespace in
the input buffer. */ the input buffer. */
static const uchar * static const uchar *
skip_whitespace (pfile, cur, skip_comments) skip_whitespace (cpp_reader *pfile, const uchar *cur, int skip_comments)
cpp_reader *pfile;
const uchar *cur;
int skip_comments;
{ {
uchar *out = pfile->out.cur; uchar *out = pfile->out.cur;
...@@ -232,9 +221,7 @@ skip_whitespace (pfile, cur, skip_comments) ...@@ -232,9 +221,7 @@ skip_whitespace (pfile, cur, skip_comments)
to point to a valid first character of an identifier. Returns to point to a valid first character of an identifier. Returns
the hashnode, and updates out.cur. */ the hashnode, and updates out.cur. */
static cpp_hashnode * static cpp_hashnode *
lex_identifier (pfile, cur) lex_identifier (cpp_reader *pfile, const uchar *cur)
cpp_reader *pfile;
const uchar *cur;
{ {
size_t len; size_t len;
uchar *out = pfile->out.cur; uchar *out = pfile->out.cur;
...@@ -256,10 +243,7 @@ lex_identifier (pfile, cur) ...@@ -256,10 +243,7 @@ lex_identifier (pfile, cur)
starting at START. The true buffer is restored upon calling starting at START. The true buffer is restored upon calling
restore_buff(). */ restore_buff(). */
void void
_cpp_overlay_buffer (pfile, start, len) _cpp_overlay_buffer (cpp_reader *pfile, const uchar *start, size_t len)
cpp_reader *pfile;
const uchar *start;
size_t len;
{ {
cpp_buffer *buffer = pfile->buffer; cpp_buffer *buffer = pfile->buffer;
...@@ -276,8 +260,7 @@ _cpp_overlay_buffer (pfile, start, len) ...@@ -276,8 +260,7 @@ _cpp_overlay_buffer (pfile, start, len)
/* Restores a buffer overlaid by _cpp_overlay_buffer(). */ /* Restores a buffer overlaid by _cpp_overlay_buffer(). */
void void
_cpp_remove_overlay (pfile) _cpp_remove_overlay (cpp_reader *pfile)
cpp_reader *pfile;
{ {
cpp_buffer *buffer = pfile->overlaid_buffer; cpp_buffer *buffer = pfile->overlaid_buffer;
...@@ -292,8 +275,7 @@ _cpp_remove_overlay (pfile) ...@@ -292,8 +275,7 @@ _cpp_remove_overlay (pfile)
/* Reads a logical line into the output buffer. Returns TRUE if there /* Reads a logical line into the output buffer. Returns TRUE if there
is more text left in the buffer. */ is more text left in the buffer. */
bool bool
_cpp_read_logical_line_trad (pfile) _cpp_read_logical_line_trad (cpp_reader *pfile)
cpp_reader *pfile;
{ {
do do
{ {
...@@ -308,11 +290,7 @@ _cpp_read_logical_line_trad (pfile) ...@@ -308,11 +290,7 @@ _cpp_read_logical_line_trad (pfile)
/* Set up state for finding the opening '(' of a function-like /* Set up state for finding the opening '(' of a function-like
macro. */ macro. */
static void static void
maybe_start_funlike (pfile, node, start, macro) maybe_start_funlike (cpp_reader *pfile, cpp_hashnode *node, const uchar *start, struct fun_macro *macro)
cpp_reader *pfile;
cpp_hashnode *node;
const uchar *start;
struct fun_macro *macro;
{ {
unsigned int n = node->value.macro->paramc + 1; unsigned int n = node->value.macro->paramc + 1;
...@@ -327,9 +305,7 @@ maybe_start_funlike (pfile, node, start, macro) ...@@ -327,9 +305,7 @@ maybe_start_funlike (pfile, node, start, macro)
/* Save the OFFSET of the start of the next argument to MACRO. */ /* Save the OFFSET of the start of the next argument to MACRO. */
static void static void
save_argument (macro, offset) save_argument (struct fun_macro *macro, size_t offset)
struct fun_macro *macro;
size_t offset;
{ {
macro->argc++; macro->argc++;
if (macro->argc <= macro->node->value.macro->paramc) if (macro->argc <= macro->node->value.macro->paramc)
...@@ -344,9 +320,7 @@ save_argument (macro, offset) ...@@ -344,9 +320,7 @@ save_argument (macro, offset)
MACRO, and we call save_replacement_text() every time we meet an MACRO, and we call save_replacement_text() every time we meet an
argument. */ argument. */
bool bool
scan_out_logical_line (pfile, macro) scan_out_logical_line (cpp_reader *pfile, cpp_macro *macro)
cpp_reader *pfile;
cpp_macro *macro;
{ {
bool result = true; bool result = true;
cpp_context *context; cpp_context *context;
...@@ -683,9 +657,7 @@ scan_out_logical_line (pfile, macro) ...@@ -683,9 +657,7 @@ scan_out_logical_line (pfile, macro)
the context stack. NODE is either object-like, or a function-like the context stack. NODE is either object-like, or a function-like
macro with no arguments. */ macro with no arguments. */
static void static void
push_replacement_text (pfile, node) push_replacement_text (cpp_reader *pfile, cpp_hashnode *node)
cpp_reader *pfile;
cpp_hashnode *node;
{ {
size_t len; size_t len;
const uchar *text; const uchar *text;
...@@ -713,9 +685,7 @@ push_replacement_text (pfile, node) ...@@ -713,9 +685,7 @@ push_replacement_text (pfile, node)
/* Returns TRUE if traditional macro recursion is detected. */ /* Returns TRUE if traditional macro recursion is detected. */
static bool static bool
recursive_macro (pfile, node) recursive_macro (cpp_reader *pfile, cpp_hashnode *node)
cpp_reader *pfile;
cpp_hashnode *node;
{ {
bool recursing = !!(node->flags & NODE_DISABLED); bool recursing = !!(node->flags & NODE_DISABLED);
...@@ -756,8 +726,7 @@ recursive_macro (pfile, node) ...@@ -756,8 +726,7 @@ recursive_macro (pfile, node)
/* Return the length of the replacement text of a function-like or /* Return the length of the replacement text of a function-like or
object-like non-builtin macro. */ object-like non-builtin macro. */
size_t size_t
_cpp_replacement_text_len (macro) _cpp_replacement_text_len (const cpp_macro *macro)
const cpp_macro *macro;
{ {
size_t len; size_t len;
...@@ -787,9 +756,7 @@ _cpp_replacement_text_len (macro) ...@@ -787,9 +756,7 @@ _cpp_replacement_text_len (macro)
sufficient size. It is not NUL-terminated. The next character is sufficient size. It is not NUL-terminated. The next character is
returned. */ returned. */
uchar * uchar *
_cpp_copy_replacement_text (macro, dest) _cpp_copy_replacement_text (const cpp_macro *macro, uchar *dest)
const cpp_macro *macro;
uchar *dest;
{ {
if (macro->fun_like && (macro->paramc != 0)) if (macro->fun_like && (macro->paramc != 0))
{ {
...@@ -823,9 +790,7 @@ _cpp_copy_replacement_text (macro, dest) ...@@ -823,9 +790,7 @@ _cpp_copy_replacement_text (macro, dest)
the context stack. NODE is either object-like, or a function-like the context stack. NODE is either object-like, or a function-like
macro with no arguments. */ macro with no arguments. */
static void static void
replace_args_and_push (pfile, fmacro) replace_args_and_push (cpp_reader *pfile, struct fun_macro *fmacro)
cpp_reader *pfile;
struct fun_macro *fmacro;
{ {
cpp_macro *macro = fmacro->node->value.macro; cpp_macro *macro = fmacro->node->value.macro;
...@@ -889,9 +854,7 @@ replace_args_and_push (pfile, fmacro) ...@@ -889,9 +854,7 @@ replace_args_and_push (pfile, fmacro)
duplicate parameter). On success, CUR (pfile->context) is just duplicate parameter). On success, CUR (pfile->context) is just
past the closing parenthesis. */ past the closing parenthesis. */
static bool static bool
scan_parameters (pfile, macro) scan_parameters (cpp_reader *pfile, cpp_macro *macro)
cpp_reader *pfile;
cpp_macro *macro;
{ {
const uchar *cur = CUR (pfile->context) + 1; const uchar *cur = CUR (pfile->context) + 1;
bool ok; bool ok;
...@@ -930,10 +893,8 @@ scan_parameters (pfile, macro) ...@@ -930,10 +893,8 @@ scan_parameters (pfile, macro)
ARG_INDEX, with zero indicating the end of the replacement ARG_INDEX, with zero indicating the end of the replacement
text. */ text. */
static void static void
save_replacement_text (pfile, macro, arg_index) save_replacement_text (cpp_reader *pfile, cpp_macro *macro,
cpp_reader *pfile; unsigned int arg_index)
cpp_macro *macro;
unsigned int arg_index;
{ {
size_t len = pfile->out.cur - pfile->out.base; size_t len = pfile->out.cur - pfile->out.base;
uchar *exp; uchar *exp;
...@@ -981,9 +942,7 @@ save_replacement_text (pfile, macro, arg_index) ...@@ -981,9 +942,7 @@ save_replacement_text (pfile, macro, arg_index)
/* Analyze and save the replacement text of a macro. Returns true on /* Analyze and save the replacement text of a macro. Returns true on
success. */ success. */
bool bool
_cpp_create_trad_definition (pfile, macro) _cpp_create_trad_definition (cpp_reader *pfile, cpp_macro *macro)
cpp_reader *pfile;
cpp_macro *macro;
{ {
const uchar *cur; const uchar *cur;
uchar *limit; uchar *limit;
...@@ -1040,11 +999,7 @@ _cpp_create_trad_definition (pfile, macro) ...@@ -1040,11 +999,7 @@ _cpp_create_trad_definition (pfile, macro)
quote currently in effect is pointed to by PQUOTE, and is updated quote currently in effect is pointed to by PQUOTE, and is updated
by the function. Returns the number of bytes copied. */ by the function. Returns the number of bytes copied. */
static size_t static size_t
canonicalize_text (dest, src, len, pquote) canonicalize_text (uchar *dest, const uchar *src, size_t len, uchar *pquote)
uchar *dest;
const uchar *src;
size_t len;
uchar *pquote;
{ {
uchar *orig_dest = dest; uchar *orig_dest = dest;
uchar quote = *pquote; uchar quote = *pquote;
...@@ -1078,8 +1033,8 @@ canonicalize_text (dest, src, len, pquote) ...@@ -1078,8 +1033,8 @@ canonicalize_text (dest, src, len, pquote)
/* Returns true if MACRO1 and MACRO2 have expansions different other /* Returns true if MACRO1 and MACRO2 have expansions different other
than in the form of their whitespace. */ than in the form of their whitespace. */
bool bool
_cpp_expansions_different_trad (macro1, macro2) _cpp_expansions_different_trad (const cpp_macro *macro1,
const cpp_macro *macro1, *macro2; const cpp_macro *macro2)
{ {
uchar *p1 = xmalloc (macro1->count + macro2->count); uchar *p1 = xmalloc (macro1->count + macro2->count);
uchar *p2 = p1 + macro1->count; uchar *p2 = p1 + macro1->count;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment