Don't assume process IDs fit in int.
[bpt/emacs.git] / src / charset.h
index 516582a..b5fa362 100644 (file)
@@ -29,6 +29,11 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <verify.h>
 
+INLINE_HEADER_BEGIN
+#ifndef CHARSET_INLINE
+# define CHARSET_INLINE INLINE
+#endif
+
 /* Index to arguments of Fdefine_charset_internal.  */
 
 enum define_charset_arg_index
@@ -168,12 +173,24 @@ struct charset
      check if a code-point is in a valid range.  */
   unsigned char *code_space_mask;
 
-  /* 1 if there's no gap in code-points.  */
-  int code_linear_p;
+  /* True if there's no gap in code-points.  */
+  unsigned code_linear_p : 1;
+
+  /* True if the charset is treated as 96 chars in ISO-2022
+     as opposed to 94 chars.  */
+  unsigned iso_chars_96 : 1;
+
+  /* True if the charset is compatible with ASCII.  */
+  unsigned ascii_compatible_p : 1;
 
-  /* If the charset is treated as 94-chars in ISO-2022, the value is 0.
-     If the charset is treated as 96-chars in ISO-2022, the value is 1.  */
-  int iso_chars_96;
+  /* True if the charset is supplementary.  */
+  unsigned supplementary_p : 1;
+
+  /* True if all the code points are representable by Lisp_Int.  */
+  unsigned compact_codes_p : 1;
+
+  /* True if the charset is unified with Unicode.  */
+  unsigned unified_p : 1;
 
   /* ISO final byte of the charset: 48..127.  It may be -1 if the
      charset doesn't conform to ISO-2022.  */
@@ -187,15 +204,6 @@ struct charset
      version.  Otherwise, -1.  */
   int emacs_mule_id;
 
-  /* Nonzero if the charset is compatible with ASCII.  */
-  int ascii_compatible_p;
-
-  /* Nonzero if the charset is supplementary.  */
-  int supplementary_p;
-
-  /* Nonzero if all the code points are representable by Lisp_Int.  */
-  int compact_codes_p;
-
   /* The method for encoding/decoding characters of the charset.  */
   enum charset_method method;
 
@@ -234,8 +242,6 @@ struct charset
   /* Offset value to calculate a character code from code-point, and
      visa versa.  */
   int code_offset;
-
-  int unified_p;
 };
 
 /* Hash table of charset symbols vs. the corresponding attribute
@@ -325,6 +331,13 @@ extern int emacs_mule_charset[256];
 #define CHARSET_DEUNIFIER(charset)     \
   (CHARSET_ATTR_DEUNIFIER (CHARSET_ATTRIBUTES (charset)))
 
+CHARSET_INLINE void
+set_charset_attr (struct charset *charset, enum charset_attr_index idx,
+                 Lisp_Object val)
+{
+  ASET (CHARSET_ATTRIBUTES (charset), idx, val);
+}
+
 
 /* Nonzero if OBJ is a valid charset symbol.  */
 #define CHARSETP(obj) (CHARSET_SYMBOL_HASH_INDEX (obj) >= 0)
@@ -444,7 +457,7 @@ extern Lisp_Object charset_work;
 
 /* Set to 1 when a charset map is loaded to warn that a buffer text
    and a string data may be relocated.  */
-extern int charset_map_loaded;
+extern bool charset_map_loaded;
 
 
 /* Set CHARSET to the charset highest priority of C, CODE to the
@@ -462,10 +475,10 @@ extern int charset_map_loaded;
    macro ISO_CHARSET_TABLE (DIMENSION, CHARS, FINAL_CHAR).  */
 extern int iso_charset_table[ISO_MAX_DIMENSION][ISO_MAX_CHARS][ISO_MAX_FINAL];
 
-/* A charset of type iso2022 who has DIMENSION, CHARS, and FINAL
+/* A charset of type iso2022 who has DIMENSION, CHARS_96, and FINAL
    (final character).  */
 #define ISO_CHARSET_TABLE(dimension, chars_96, final)  \
-  iso_charset_table[(dimension) - 1][(chars_96)][(final)]
+  iso_charset_table[(dimension) - 1][chars_96][final]
 
 /* Nonzero if the charset who has FAST_MAP may contain C.  */
 #define CHARSET_FAST_MAP_REF(c, fast_map)              \
@@ -483,7 +496,7 @@ extern int iso_charset_table[ISO_MAX_DIMENSION][ISO_MAX_CHARS][ISO_MAX_FINAL];
 
 
 
-/* 1 if CHARSET may contain the character C.  */
+/* True if CHARSET may contain the character C.  */
 #define CHAR_CHARSET_P(c, charset)                                      \
   ((ASCII_CHAR_P (c) && (charset)->ascii_compatible_p)                  \
    || ((CHARSET_UNIFIED_P (charset)                                     \
@@ -525,7 +538,6 @@ extern int charset_unibyte;
 extern struct charset *char_charset (int, Lisp_Object, unsigned *);
 extern Lisp_Object charset_attributes (int);
 
-extern int maybe_unify_char (int, Lisp_Object);
 extern int decode_char (struct charset *, unsigned);
 extern unsigned encode_char (struct charset *, int);
 extern int string_xstring_p (Lisp_Object);
@@ -534,4 +546,6 @@ extern void map_charset_chars (void (*) (Lisp_Object, Lisp_Object),
                                Lisp_Object, Lisp_Object,
                                struct charset *, unsigned, unsigned);
 
+INLINE_HEADER_END
+
 #endif /* EMACS_CHARSET_H */