aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpphash.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-02-11 20:17:27 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-02-11 20:17:27 +0000
commita2a76ce71b44712ae1979cb28c0978e30819b43e (patch)
tree4e6ca8c2c0a5cca5b730a20801572a000aed5b2a /gcc/cpphash.c
parent2144ddea76b1e7d190b3c9c4a63575fc7c86f54e (diff)
downloadgcc-a2a76ce71b44712ae1979cb28c0978e30819b43e.zip
gcc-a2a76ce71b44712ae1979cb28c0978e30819b43e.tar.gz
gcc-a2a76ce71b44712ae1979cb28c0978e30819b43e.tar.bz2
cpphash.c: Fix formatting, update commentary.
* cpphash.c: Fix formatting, update commentary. (dump_definition): Take three separate arguments instead of a MACRODEF structure argument. * cpphash.h: Update prototype of dump_definition. * cppinit.c (cpp_finish): Update call of dump_definition. * cpplib.c (do_define): Always create new hash entry with T_MACRO type. Remove redundant check for redefinition of poisoned identifier. Update call of dump_definition. (do_undef): Don't call check_macro_name. Rename sym_length to len. (do_error, do_warning): Don't use copy_rest_of_line or SKIP_WHITE_SPACE. (do_warning): Don't use pedwarn for the actual warning, only the notice about its not being in the standard. (Fixes bug with #warning in system headers.) (do_ident): Stricter argument checking - accept only a single string after #ident. Also, macro-expand the line. (do_xifdef): Use cpp_defined. De-obfuscate. (do_pragma): Split out specific pragma handling to separate functions. Use get_directive_token. Update commentary. Do not pass on #pragma once or #pragma poison to the front end. (do_pragma_once, do_pragma_implementation, do_pragma_poison, do_pragma_default): New. From-SVN: r31931
Diffstat (limited to 'gcc/cpphash.c')
-rw-r--r--gcc/cpphash.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/gcc/cpphash.c b/gcc/cpphash.c
index 5d6e760..fc2b8ff 100644
--- a/gcc/cpphash.c
+++ b/gcc/cpphash.c
@@ -89,8 +89,7 @@ struct argdata
};
-/* Return hash function on name. must be compatible with the one
- computed a step at a time, elsewhere */
+/* Calculate hash function on a string. */
static unsigned int
hashf (s, len)
@@ -169,7 +168,6 @@ void
delete_macro (hp)
HASHNODE *hp;
{
-
if (hp->prev != NULL)
hp->prev->next = hp->next;
if (hp->next != NULL)
@@ -1575,15 +1573,15 @@ comp_def_part (first, beg1, len1, beg2, len2, last)
to be read back in again. */
void
-dump_definition (pfile, macro)
+dump_definition (pfile, sym, len, defn)
cpp_reader *pfile;
- MACRODEF macro;
+ const U_CHAR *sym;
+ long len;
+ DEFINITION *defn;
{
- DEFINITION *defn = macro.defn;
-
- CPP_RESERVE (pfile, macro.symlen + sizeof "#define ");
+ CPP_RESERVE (pfile, len + sizeof "#define ");
CPP_PUTS_Q (pfile, "#define ", sizeof "#define " -1);
- CPP_PUTS_Q (pfile, macro.symnam, macro.symlen);
+ CPP_PUTS_Q (pfile, sym, len);
if (defn->nargs == -1)
{