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]

PATCH to move CEIL definition to system.h



There's no reason to define CEIL in every source file that uses it.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

2000-01-02  Mark Mitchell  <mark@codesourcery.com>

	* system.h (CEIL): Define.
	* builtins.c (CEIL): Remove.
	* expmed.c (CEIL): Likewise.
	* expr.c (CEIL): Likewise.
	* stor-layout.c (CEIL): Likewise.
	
Index: builtins.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/builtins.c,v
retrieving revision 1.20
diff -c -p -r1.20 builtins.c
*** builtins.c	1999/12/15 20:56:58	1.20
--- builtins.c	2000/01/02 19:34:30
*************** Boston, MA 02111-1307, USA.  */
*** 43,50 ****
  #define CALLED_AS_BUILT_IN(NODE) \
     (!strncmp (IDENTIFIER_POINTER (DECL_NAME (NODE)), "__builtin_", 10))
  
- #define CEIL(x,y) (((x) + (y) - 1) / (y))
- 
  /* Register mappings for target machines without register windows.  */
  #ifndef INCOMING_REGNO
  #define INCOMING_REGNO(OUT) (OUT)
--- 43,48 ----
Index: expmed.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/expmed.c,v
retrieving revision 1.42
diff -c -p -r1.42 expmed.c
*** expmed.c	2000/01/01 12:12:10	1.42
--- expmed.c	2000/01/02 19:34:33
*************** static rtx extract_split_bit_field	PROTO
*** 46,53 ****
  static void do_cmp_and_jump		PROTO((rtx, rtx, enum rtx_code,
  					       enum machine_mode, rtx));
  
- #define CEIL(x,y) (((x) + (y) - 1) / (y))
- 
  /* Non-zero means divides or modulus operations are relatively cheap for
     powers of two, so don't use branches; emit the operation instead. 
     Usually, this will mean that the MD file will emit non-branch
--- 46,51 ----
Index: expr.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/expr.c,v
retrieving revision 1.190
diff -c -p -r1.190 expr.c
*** expr.c	1999/12/24 17:27:36	1.190
--- expr.c	2000/01/02 19:34:39
*************** Boston, MA 02111-1307, USA.  */
*** 43,50 ****
  #include "ggc.h"
  #include "tm_p.h"
  
- #define CEIL(x,y) (((x) + (y) - 1) / (y))
- 
  /* Decide whether a function's arguments should be processed
     from first to last or from last to first.
  
--- 43,48 ----
Index: stor-layout.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/stor-layout.c,v
retrieving revision 1.40
diff -c -p -r1.40 stor-layout.c
*** stor-layout.c	1999/12/20 19:47:58	1.40
--- stor-layout.c	2000/01/02 19:34:40
*************** Boston, MA 02111-1307, USA.  */
*** 30,37 ****
  #include "toplev.h"
  #include "ggc.h"
  
- #define CEIL(x,y) (((x) + (y) - 1) / (y))
- 
  /* Data type for the expressions representing sizes of data types.
     It is the first integer type laid out.  */
  
--- 30,35 ----
Index: system.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/system.h,v
retrieving revision 1.54
diff -c -p -r1.54 system.h
*** system.h	1999/12/30 13:48:51	1.54
--- system.h	2000/01/02 19:34:40
*************** extern int errno;
*** 266,271 ****
--- 266,274 ----
  #define MIN(X,Y) ((X) < (Y) ? (X) : (Y))
  #define MAX(X,Y) ((X) > (Y) ? (X) : (Y))
  
+ /* Returns the least number N such that N * Y >= X.  */
+ #define CEIL(x,y) (((x) + (y) - 1) / (y))
+ 
  #ifdef HAVE_SYS_WAIT_H
  #include <sys/wait.h>
  #endif

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