This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

misc patch ccphash.h


All,

More low hanging macro fruit.

Bootstrapped i686-pc-linux-gnu, all languages, no regressions.

Graham

ChangeLog

	* cpphash.h (_dollar_ok): Upercase macro parameter.
	(is_idchar): Upercase macro parameter and whitespace.
	(is_numchar): Likewise.
	(is_idstart): Likewise.
	(is_numstart): Likewise.
	(is_hspace): Likewise.
	(is_vspace): Likewise.
	(is_nvspace): Likewise.
	(is_space): Likewise.
	(DSC): Uppercase macro parameter and add parenthesis.
	(xnew): Upercase macro parameter and whitespace.
	(xcnew): Likewise.
	(xnewvec): Likewise.
	(xcnewvec): Likewise.
	(xobnew): Likewise.

--------------------------------------------------------------
Index: gcc/cpphash.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cpphash.h,v
retrieving revision 1.139
diff -c -p -r1.139 cpphash.h
*** cpphash.h   2002/01/03 21:43:06     1.139
--- cpphash.h   2002/01/09 10:03:06     
*************** struct cpp_reader
*** 337,352 ****
     In the unlikely event that characters other than \r and \n enter
     the set is_vspace, the macro handle_newline() in cpplex.c must be
     updated.  */
! #define _dollar_ok(x) ((x) == '$' && CPP_OPTION (pfile, dollars_in_ident))
  
! #define is_idchar(x)  (ISIDNUM(x) || _dollar_ok(x))
! #define is_numchar(x) ISIDNUM(x)
! #define is_idstart(x) (ISIDST(x) || _dollar_ok(x))
! #define is_numstart(x)        ISDIGIT(x)
! #define is_hspace(x)  ISBLANK(x)
! #define is_vspace(x)  IS_VSPACE(x)
! #define is_nvspace(x) IS_NVSPACE(x)
! #define is_space(x)   IS_SPACE_OR_NUL(x)
  
  /* This table is constant if it can be initialized at compile time,
     which is the case if cpp was compiled with GCC >=2.7, or another
--- 337,352 ----
     In the unlikely event that characters other than \r and \n enter
     the set is_vspace, the macro handle_newline() in cpplex.c must be
     updated.  */
! #define _dollar_ok(X) ((X) == '$' && CPP_OPTION (pfile, dollars_in_ident))
  
! #define is_idchar(X)  (ISIDNUM (X) || _dollar_ok (X))
! #define is_numchar(X) ISIDNUM (X)
! #define is_idstart(X) (ISIDST (X) || _dollar_ok (X))
! #define is_numstart(X)        ISDIGIT (X)
! #define is_hspace(X)  ISBLANK (X)
! #define is_vspace(X)  IS_VSPACE (X)
! #define is_nvspace(X) IS_NVSPACE (X)
! #define is_space(X)   IS_SPACE_OR_NUL (X)

  /* This table is constant if it can be initialized at compile time,
     which is the case if cpp was compiled with GCC >=2.7, or another
*************** extern void _cpp_do_file_change PARAMS (
*** 421,432 ****
  extern void _cpp_pop_buffer PARAMS ((cpp_reader *));

  /* Utility routines and macros.  */
! #define DSC(str) (const U_CHAR *)str, sizeof str - 1
! #define xnew(T)               (T *) xmalloc (sizeof(T))
! #define xcnew(T)      (T *) xcalloc (1, sizeof(T))
! #define xnewvec(T, N) (T *) xmalloc (sizeof(T) * (N))
! #define xcnewvec(T, N)        (T *) xcalloc (N, sizeof(T))
! #define xobnew(O, T)  (T *) obstack_alloc (O, sizeof(T))

  /* These are inline functions instead of macros so we can get type
     checking.  */
--- 421,432 ----
  extern void _cpp_pop_buffer PARAMS ((cpp_reader *));

  /* Utility routines and macros.  */
! #define DSC(STR) (const U_CHAR *)(STR), sizeof (STR) - 1
! #define xnew(T)               (T *) xmalloc (sizeof (T))
! #define xcnew(T)      (T *) xcalloc (1, sizeof (T))
! #define xnewvec(T, N) (T *) xmalloc (sizeof (T) * (N))
! #define xcnewvec(T, N)        (T *) xcalloc ((N), sizeof (T))
! #define xobnew(O, T)  (T *) obstack_alloc ((O), sizeof (T))

  /* These are inline functions instead of macros so we can get type
     checking.  */
---------------------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]