changeset 13363:941c37982f37

(BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG): Rename from SHORTBITS, INTBITS, LONGBITS.
author Karl Heuer <kwzh@gnu.org>
date Tue, 31 Oct 1995 02:34:16 +0000
parents 1220026cd3a3
children a568560d232f
files src/alloc.c src/data.c src/doprnt.c src/floatfns.c src/fns.c src/indent.c src/insdel.c src/lisp.h src/lread.c src/print.c src/xdisp.c src/xfaces.c src/xterm.c
diffstat 13 files changed, 35 insertions(+), 61 deletions(-) [+]
line wrap: on
line diff
--- a/src/alloc.c	Tue Oct 31 02:08:29 1995 +0000
+++ b/src/alloc.c	Tue Oct 31 02:34:16 1995 +0000
@@ -1091,7 +1091,7 @@
 
   CHECK_NATNUM (length, 0);
 
-  bits_per_value = sizeof (EMACS_INT) * INTBITS / sizeof (int);
+  bits_per_value = sizeof (EMACS_INT) * BITS_PER_CHAR;
 
   length_in_elts = (XFASTINT (length) + bits_per_value - 1) / bits_per_value;
   length_in_chars = length_in_elts * sizeof (EMACS_INT);
@@ -1428,7 +1428,7 @@
 {
   int count = specpdl_ptr - specpdl;
   Lisp_Object number;
-  int nbits = min (VALBITS, INTBITS);
+  int nbits = min (VALBITS, BITS_PER_INT);
 
   XSETINT (number, ((EMACS_INT) 1 << (nbits - 1)) - 1);
 
--- a/src/data.c	Tue Oct 31 02:08:29 1995 +0000
+++ b/src/data.c	Tue Oct 31 02:34:16 1995 +0000
@@ -31,13 +31,6 @@
 
 #include "syssignal.h"
 
-#ifdef MSDOS
-/* These are redefined (correctly, but differently) in values.h.  */
-#undef INTBITS
-#undef LONGBITS
-#undef SHORTBITS
-#endif
-
 #ifdef LISP_FLOAT_TYPE
 
 #ifdef STDC_HEADERS
@@ -1532,13 +1525,12 @@
   else if (BOOL_VECTOR_P (array))
     {
       int val;
-      int bits_per_char = INTBITS / sizeof (int);
 
       if (idxval < 0 || idxval >= XBOOL_VECTOR (array)->size)
 	args_out_of_range (array, idx);
 
-      val = (unsigned char) XBOOL_VECTOR (array)->data[idxval / bits_per_char];
-      return (val & (1 << (idxval % bits_per_char)) ? Qt : Qnil);
+      val = (unsigned char) XBOOL_VECTOR (array)->data[idxval / BITS_PER_CHAR];
+      return (val & (1 << (idxval % BITS_PER_CHAR)) ? Qt : Qnil);
     }
   else if (CHAR_TABLE_P (array))
     {
@@ -1639,18 +1631,17 @@
   else if (BOOL_VECTOR_P (array))
     {
       int val;
-      int bits_per_char = INTBITS / sizeof (int);
 
       if (idxval < 0 || idxval >= XBOOL_VECTOR (array)->size)
 	args_out_of_range (array, idx);
 
-      val = (unsigned char) XBOOL_VECTOR (array)->data[idxval / bits_per_char];
+      val = (unsigned char) XBOOL_VECTOR (array)->data[idxval / BITS_PER_CHAR];
 
       if (! NILP (newelt))
-	val |= 1 << (idxval % bits_per_char);
+	val |= 1 << (idxval % BITS_PER_CHAR);
       else
-	val &= ~(1 << (idxval % bits_per_char));
-      XBOOL_VECTOR (array)->data[idxval / bits_per_char] = val;
+	val &= ~(1 << (idxval % BITS_PER_CHAR));
+      XBOOL_VECTOR (array)->data[idxval / BITS_PER_CHAR] = val;
     }
   else if (CHAR_TABLE_P (array))
     {
--- a/src/doprnt.c	Tue Oct 31 02:08:29 1995 +0000
+++ b/src/doprnt.c	Tue Oct 31 02:34:16 1995 +0000
@@ -104,7 +104,7 @@
 	    size_bound = -size_bound;
 	  size_bound += 50;
 
-	  if (size_bound > (unsigned) (1 << (INTBITS - 1)))
+	  if (size_bound > (unsigned) (1 << (BITS_PER_INT - 1)))
 	    error ("Format padding too large");
 
 	  /* Make sure we have that much.  */
--- a/src/floatfns.c	Tue Oct 31 02:08:29 1995 +0000
+++ b/src/floatfns.c	Tue Oct 31 02:34:16 1995 +0000
@@ -53,13 +53,6 @@
 
 #ifdef LISP_FLOAT_TYPE
 
-#ifdef MSDOS
-/* These are redefined (correctly, but differently) in values.h.  */
-#undef INTBITS
-#undef LONGBITS
-#undef SHORTBITS
-#endif
-
 /* Work around a problem that happens because math.h on hpux 7
    defines two static variables--which, in Emacs, are not really static,
    because `static' is defined as nothing.  The problem is that they are
--- a/src/fns.c	Tue Oct 31 02:08:29 1995 +0000
+++ b/src/fns.c	Tue Oct 31 02:34:16 1995 +0000
@@ -318,9 +318,8 @@
   if (BOOL_VECTOR_P (arg))
     {
       Lisp_Object val;
-      int bits_per_char = INTBITS / sizeof (int);
       int size_in_chars
-	= (XBOOL_VECTOR (arg)->size + bits_per_char) / bits_per_char;
+	= (XBOOL_VECTOR (arg)->size + BITS_PER_CHAR) / BITS_PER_CHAR;
 
       val = Fmake_bool_vector (Flength (arg), Qnil);
       bcopy (XBOOL_VECTOR (arg)->data, XBOOL_VECTOR (val)->data,
@@ -432,12 +431,11 @@
 		XSETFASTINT (elt, XSTRING (this)->data[thisindex++]);
 	      else if (BOOL_VECTOR_P (this))
 		{
-		  int bits_per_char = INTBITS / sizeof (int);
 		  int size_in_chars
-		    = ((XBOOL_VECTOR (this)->size + bits_per_char)
-		       / bits_per_char);
+		    = ((XBOOL_VECTOR (this)->size + BITS_PER_CHAR)
+		       / BITS_PER_CHAR);
 		  int byte;
-		  byte = XBOOL_VECTOR (val)->data[thisindex / bits_per_char];
+		  byte = XBOOL_VECTOR (val)->data[thisindex / BITS_PER_CHAR];
 		  if (byte & (1 << thisindex))
 		    elt = Qt;
 		  else
@@ -1075,9 +1073,8 @@
 	/* Boolvectors are compared much like strings.  */
 	if (BOOL_VECTOR_P (o1))
 	  {
-	    int bits_per_char = INTBITS / sizeof (int);
 	    int size_in_chars
-	      = (XBOOL_VECTOR (o1)->size + bits_per_char) / bits_per_char;
+	      = (XBOOL_VECTOR (o1)->size + BITS_PER_CHAR) / BITS_PER_CHAR;
 
 	    if (XBOOL_VECTOR (o1)->size != XBOOL_VECTOR (o2)->size)
 	      return 0;
@@ -1160,9 +1157,8 @@
   else if (BOOL_VECTOR_P (array))
     {
       register unsigned char *p = XBOOL_VECTOR (array)->data;
-      int bits_per_char = INTBITS / sizeof (int);
       int size_in_chars
-	= (XBOOL_VECTOR (array)->size + bits_per_char) / bits_per_char;
+	= (XBOOL_VECTOR (array)->size + BITS_PER_CHAR) / BITS_PER_CHAR;
 
       charval = (! NILP (item) ? -1 : 0);
       for (index = 0; index < size_in_chars; index++)
--- a/src/indent.c	Tue Oct 31 02:08:29 1995 +0000
+++ b/src/indent.c	Tue Oct 31 02:34:16 1995 +0000
@@ -1139,7 +1139,7 @@
 				 lmargin + (XFASTINT (prevline) == BEG
 					    ? start_hpos : 0),
 				 0,
-				 from, 1 << (INTBITS - 2), 0,
+				 from, 1 << (BITS_PER_INT - 2), 0,
 				 width, hscroll, 0, w);
 	  vpos -= pos.vpos;
 	  first = 0;
@@ -1185,7 +1185,7 @@
 			     lmargin + (XFASTINT (prevline) == BEG
 					? start_hpos : 0),
 			     0,
-			     from, 1 << (INTBITS - 2), 0,
+			     from, 1 << (BITS_PER_INT - 2), 0,
 			     width, hscroll, 0, w);
       did_motion = 1;
     }
@@ -1196,7 +1196,7 @@
       did_motion = 0;
     }
   return compute_motion (from, vpos, pos.hpos, did_motion,
-			 ZV, vtarget, - (1 << (INTBITS - 2)),
+			 ZV, vtarget, - (1 << (BITS_PER_INT - 2)),
 			 width, hscroll, pos.vpos * width, w);
 }
 
--- a/src/insdel.c	Tue Oct 31 02:08:29 1995 +0000
+++ b/src/insdel.c	Tue Oct 31 02:34:16 1995 +0000
@@ -299,7 +299,7 @@
      That won't work because so many places use `int'.  */
      
   if (Z - BEG + GAP_SIZE + increment
-      >= ((unsigned) 1 << (min (INTBITS, VALBITS) - 1)))
+      >= ((unsigned) 1 << (min (BITS_PER_INT, VALBITS) - 1)))
     error ("Buffer exceeds maximum size");
 
   BLOCK_INPUT;
--- a/src/lisp.h	Tue Oct 31 02:08:29 1995 +0000
+++ b/src/lisp.h	Tue Oct 31 02:34:16 1995 +0000
@@ -102,7 +102,7 @@
 {
   gdb_valbits = VALBITS,
   gdb_gctypebits = GCTYPEBITS,
-  gdb_emacs_intbits = sizeof (EMACS_INT) * INTBITS / sizeof (int),
+  gdb_emacs_intbits = sizeof (EMACS_INT) * BITS_PER_CHAR,
 #ifdef DATA_SEG_BITS
   gdb_data_seg_bits = DATA_SEG_BITS
 #else
@@ -271,7 +271,7 @@
 /* Extract the value of a Lisp_Object as a signed integer.  */
 
 #ifndef XINT   /* Some machines need to do this differently.  */
-#define XINT(a) (((a) << (INTBITS-VALBITS)) >> (INTBITS-VALBITS))
+#define XINT(a) (((a) << (BITS_PER_INT-VALBITS)) >> (BITS_PER_INT-VALBITS))
 #endif
 
 /* Extract the value as an unsigned integer.  This is a basis
@@ -316,7 +316,7 @@
 #define XGCTYPE(a) ((enum Lisp_Type) (((a) >> VALBITS) & GCTYPEMASK))
 #endif
 
-#if VALBITS + GCTYPEBITS == INTBITS - 1
+#if VALBITS + GCTYPEBITS == BITS_PER_INT - 1
 /* Make XMARKBIT faster if mark bit is sign bit.  */
 #ifndef XMARKBIT
 #define XMARKBIT(a) ((a) < 0)
@@ -354,7 +354,7 @@
 
 #ifdef EXPLICIT_SIGN_EXTEND
 /* Make sure we sign-extend; compilers have been known to fail to do so.  */
-#define XINT(a) (((a).i << (INTBITS-VALBITS)) >> (INTBITS-VALBITS))
+#define XINT(a) (((a).i << (BITS_PER_INT-VALBITS)) >> (BITS_PER_INT-VALBITS))
 #else
 #define XINT(a) ((a).s.val)
 #endif /* EXPLICIT_SIGN_EXTEND */
--- a/src/lread.c	Tue Oct 31 02:08:29 1995 +0000
+++ b/src/lread.c	Tue Oct 31 02:34:16 1995 +0000
@@ -50,10 +50,6 @@
 
 #ifdef MSDOS
 #include "msdos.h"
-/* These are redefined (correctly, but differently) in values.h.  */
-#undef INTBITS
-#undef LONGBITS
-#undef SHORTBITS
 #endif
 
 #include <math.h>
@@ -1203,9 +1199,8 @@
 	  if (c == '"')
 	    {
 	      Lisp_Object tmp, val;
-	      int bits_per_char = INTBITS / sizeof (int);
-	      int size_in_chars = ((XFASTINT (length) + bits_per_char)
-				   / bits_per_char);
+	      int size_in_chars = ((XFASTINT (length) + BITS_PER_CHAR)
+				   / BITS_PER_CHAR);
 
 	      UNREAD (c);
 	      tmp = read1 (readcharfun, pch, first_in_list);
--- a/src/print.c	Tue Oct 31 02:08:29 1995 +0000
+++ b/src/print.c	Tue Oct 31 02:34:16 1995 +0000
@@ -933,9 +933,8 @@
 	  register int i;
 	  register unsigned char c;
 	  struct gcpro gcpro1;
-	  int bits_per_char = INTBITS / sizeof (int);
 	  int size_in_chars
-	    = (XBOOL_VECTOR (obj)->size + bits_per_char) / bits_per_char;
+	    = (XBOOL_VECTOR (obj)->size + BITS_PER_CHAR) / BITS_PER_CHAR;
 
 	  GCPRO1 (obj);
 
--- a/src/xdisp.c	Tue Oct 31 02:08:29 1995 +0000
+++ b/src/xdisp.c	Tue Oct 31 02:34:16 1995 +0000
@@ -987,7 +987,7 @@
 	  pos = *compute_motion (tlbufpos, 0,
 				 XINT (w->hscroll) ? 1 - XINT (w->hscroll) : 0,
 				 0,
-				 PT, 2, - (1 << (SHORTBITS - 1)),
+				 PT, 2, - (1 << (BITS_PER_SHORT - 1)),
 				 window_internal_width (w) - 1,
 				 XINT (w->hscroll),
 				 pos_tab_offset (w, tlbufpos), w);
@@ -1531,7 +1531,7 @@
 				  + (hscroll ? 1 - hscroll : 0)),
 				 0,
 				 ZV, height / 2,
-				 - (1 << (SHORTBITS - 1)),
+				 - (1 << (BITS_PER_SHORT - 1)),
 				 width, hscroll, pos_tab_offset (w, startp), w);
 	  BUF_PT (current_buffer) = pos.bufpos;
 	  if (w != XWINDOW (selected_window))
@@ -1967,7 +1967,7 @@
 
   /* Compute the cursor position after that newline.  */
   ep = *compute_motion (pos, vpos, val.hpos, did_motion, tem,
-			height, - (1 << (SHORTBITS - 1)),
+			height, - (1 << (BITS_PER_SHORT - 1)),
 			width, hscroll, pos_tab_offset (w, bp.bufpos), w);
 
   /* If changes reach past the text available on the frame,
@@ -2023,13 +2023,13 @@
 	  if (PT <= xp.bufpos)
 	    {
 	      pp = *compute_motion (ep.bufpos, ep.vpos, ep.hpos, 1,
-				    PT, height, - (1 << (SHORTBITS - 1)),
+				    PT, height, - (1 << (BITS_PER_SHORT - 1)),
 				    width, hscroll, epto, w);
 	    }
 	  else
 	    {
 	      pp = *compute_motion (xp.bufpos, xp.vpos, xp.hpos, 1,
-				    PT, height, - (1 << (SHORTBITS - 1)),
+				    PT, height, - (1 << (BITS_PER_SHORT - 1)),
 				    width, hscroll,
 				    pos_tab_offset (w, xp.bufpos), w);
 	    }
@@ -2250,7 +2250,7 @@
   if (debug_end_pos)
     {
       val = *compute_motion (start, 0, lmargin, 0, ZV,
-			     height, - (1 << (SHORTBITS - 1)),
+			     height, - (1 << (BITS_PER_SHORT - 1)),
 			     width, hscroll, pos_tab_offset (w, start), w);
       if (val.vpos != XFASTINT (w->window_end_vpos))
 	abort ();
--- a/src/xfaces.c	Tue Oct 31 02:08:29 1995 +0000
+++ b/src/xfaces.c	Tue Oct 31 02:34:16 1995 +0000
@@ -400,7 +400,7 @@
 	       && XINT (height) > 0
 	       /* The string must have enough bits for width * height.  */
 	       && ((XSTRING (XCONS (XCONS (XCONS (arg)->cdr)->cdr)->car)->size
-		    * (INTBITS / sizeof (int)))
+		    * (BITS_PER_INT / sizeof (int)))
 		   >= XFASTINT (width) * XFASTINT (height))))
 	  ? Qt : Qnil);
 }
--- a/src/xterm.c	Tue Oct 31 02:08:29 1995 +0000
+++ b/src/xterm.c	Tue Oct 31 02:34:16 1995 +0000
@@ -970,7 +970,7 @@
 	{
 	  /* If char is out of range, try the font's default char instead.  */
 	  c = font->default_char;
-	  row = c >> (INTBITS - 8);
+	  row = c >> (BITS_PER_INT - 8);
 	  within = c & 0177;
 	}
       if (!(within >= font->min_char_or_byte2
@@ -1015,7 +1015,7 @@
 	{
 	  /* If char is out of range, try the font's default char instead.  */
 	  c = font->default_char;
-	  row = c >> (INTBITS - 8);
+	  row = c >> (BITS_PER_INT - 8);
 	  within = c & 0177;
 	}
       if (!(within >= font->min_char_or_byte2