]> code.delx.au - gnu-emacs/commitdiff
(BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG):
authorKarl Heuer <kwzh@gnu.org>
Tue, 31 Oct 1995 02:34:16 +0000 (02:34 +0000)
committerKarl Heuer <kwzh@gnu.org>
Tue, 31 Oct 1995 02:34:16 +0000 (02:34 +0000)
Rename from SHORTBITS, INTBITS, LONGBITS.

13 files changed:
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

index 002dc51ddb974dac5abf76b18d5353938405b4a1..978174360b2bf474a82834ffc1454cb7d8cb3a8e 100644 (file)
@@ -1091,7 +1091,7 @@ Both LENGTH and INIT must be numbers.  INIT matters only in whether it is t or n
 
   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 @@ inhibit_garbage_collection ()
 {
   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);
 
index 53e40c11cef1d600fa0af4547dc5a803b71dba69..3394cdb147c42eb641f8c3390d4bcfbc7dee6a34 100644 (file)
@@ -31,13 +31,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #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 @@ or a byte-code object.  INDEX starts at 0.")
   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 @@ ARRAY may be a vector or a string.  IDX starts at 0.")
   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))
     {
index 99e10c0730cae8e9a101dd4e6c0772b0f0d3c245..5639a7eff3a85890df75af1c1873f2314a5cf8db 100644 (file)
@@ -104,7 +104,7 @@ doprnt (buffer, bufsize, format, format_end, nargs, args)
            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.  */
index 459f4d63faa380d47f5cf9ef460fba5687748a1f..63a66519a68840ad54c05da14fdf8115fadfae20 100644 (file)
@@ -53,13 +53,6 @@ Lisp_Object Qarith_error;
 
 #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
index 2e282011e75d018caf72688e5b576e57ca8083d1..b2eada7468ebd26766837dc31086cbbe71d75f29 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -318,9 +318,8 @@ with the original.")
   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 @@ concat (nargs, args, target_type, last_special)
                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 @@ internal_equal (o1, o2, depth)
        /* 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 @@ ARRAY is a vector, string, char-table, or bool-vector.")
   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++)
index 4510f3ba42c198a3ddbbaa6c19e677fdb47a7c30..ca154c91a2f84bcdead78e206fdd8dd1f7ab6887 100644 (file)
@@ -1139,7 +1139,7 @@ vmotion (from, vtarget, w)
                                 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 @@ vmotion (from, vtarget, w)
                             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 @@ vmotion (from, vtarget, w)
       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);
 }
 
index e68676470075852a37495afa278ebf6e8630aaf3..a33e4be616f9a53440ceaa6fe1f333c6bdd75b05 100644 (file)
@@ -299,7 +299,7 @@ make_gap (increment)
      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;
index 3a445446ec063fbdee48e87fe67f7913644c2519..0c864c46e3c7b7e797534b789f911699e2d87d1f 100644 (file)
@@ -102,7 +102,7 @@ enum gdb_lisp_params
 {
   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 @@ enum pvec_type
 /* 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 @@ extern int pure_size;
 #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 @@ extern int pure_size;
 
 #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 */
index ad0779911ea3f78cfad996d0da3b8c3301b2b686..c1de692edfd676ac3f9e5d3087d7bf205b44c40b 100644 (file)
@@ -50,10 +50,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #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 @@ read1 (readcharfun, pch, first_in_list)
          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);
index 3ca2876432cefb117f75c2a7c0f6a3d096f2ec7c..6fff1a544073d93897745e0db2e444dc3bccbe84 100644 (file)
@@ -933,9 +933,8 @@ print (obj, printcharfun, escapeflag)
          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);
 
index 7014219d59ceec2f9255bcb4f4eae377e71a161f..6c8bef4049648ba78353d4c79527af54029d0b4c 100644 (file)
@@ -987,7 +987,7 @@ redisplay ()
          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 @@ redisplay_window (window, just_this_one)
                                  + (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 @@ try_window_id (window)
 
   /* 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 @@ try_window_id (window)
          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 @@ try_window_id (window)
   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 ();
index b2c410d02c4acf72b801f1732763ac67e4488dac..dc7f41888638b5edfae87ade0dc9796c30ece29b 100644 (file)
@@ -400,7 +400,7 @@ DEFUN ("pixmap-spec-p", Fpixmap_spec_p, Spixmap_spec_p, 1, 1, 0,
               && 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);
 }
index 57e21af6bc395af2d940c0595e7cf556d9d2a4d8..8a16fcbae72eda68662fd6d785f3cd177337242c 100644 (file)
@@ -970,7 +970,7 @@ font_char_overlap_left (font, c)
        {
          /* 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 @@ font_char_overlap_right (font, c)
        {
          /* 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