diff mbox series

[2/7] Preprocessor node access

Message ID 3529fd28-7925-3d8d-3cb1-832ecb380d1c@acm.org
State New
Headers show
Series [1/7] Preprocessor cleanup | expand

Commit Message

Nathan Sidwell Oct. 31, 2018, 2:45 p.m. UTC
The hashnode identifier accessor macro unnecessarily casts its operand, 
and the derived accessors don't use it.  Fixed thusly.

applying to trunk.
diff mbox series

Patch

2018-10-31  Nathan Sidwell  <nathan@acm.org>

	* include/cpplib.h (HT_NODE): Don't cast NODE.
	(NODE_LEN, NODE_NAME): Use HT_NODE.

Index: libcpp/include/cpplib.h
===================================================================
--- libcpp/include/cpplib.h	(revision 265671)
+++ libcpp/include/cpplib.h	(working copy)
@@ -844,9 +844,9 @@  enum cpp_builtin_type
 };
 
 #define CPP_HASHNODE(HNODE)	((cpp_hashnode *) (HNODE))
-#define HT_NODE(NODE)		((ht_identifier *) (NODE))
-#define NODE_LEN(NODE)		HT_LEN (&(NODE)->ident)
-#define NODE_NAME(NODE)		HT_STR (&(NODE)->ident)
+#define HT_NODE(NODE)		(&(NODE)->ident)
+#define NODE_LEN(NODE)		HT_LEN (HT_NODE (NODE))
+#define NODE_NAME(NODE)		HT_STR (HT_NODE (NODE))
 
 /* The common part of an identifier node shared amongst all 3 C front
    ends.  Also used to store CPP identifiers, which are a superset of