]> code.delx.au - gnu-emacs/blobdiff - src/character.h
* test/lisp/help-fns-tests.el: Add several tests for 'describe-function'.
[gnu-emacs] / src / character.h
index 871c1c3de959e6a3b420c2a57ff4051fd5ff7e38..586f330fba9fe3dfbe5c47db9715924a9fe1d482 100644 (file)
@@ -9,8 +9,8 @@ This file is part of GNU Emacs.
 
 GNU Emacs is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -135,14 +135,12 @@ enum
   do {                                 \
     Lisp_Object tmp = XCAR (x);                \
     CHECK_CHARACTER (tmp);             \
-    XSETCAR ((x), tmp);                        \
   } while (false)
 
 #define CHECK_CHARACTER_CDR(x) \
   do {                                 \
     Lisp_Object tmp = XCDR (x);                \
     CHECK_CHARACTER (tmp);             \
-    XSETCDR ((x), tmp);                        \
   } while (false)
 
 /* Nonzero iff C is a character of code less than 0x100.  */
@@ -614,14 +612,13 @@ sanitize_char_width (EMACS_INT width)
    : (c) <= 0xE01EF ? (c) - 0xE0100 + 17       \
    : 0)
 
-/* If C is a high surrogate, return 1.  If C is a low surrogate,
-   return 2.  Otherwise, return 0.  */
+/* Return true if C is a surrogate.  */
 
-#define CHAR_SURROGATE_PAIR_P(c)       \
-  ((c) < 0xD800 ? 0                    \
-   : (c) <= 0xDBFF ? 1                 \
-   : (c) <= 0xDFFF ? 2                 \
-   : 0)
+INLINE bool
+char_surrogate_p (int c)
+{
+  return 0xD800 <= c && c <= 0xDFFF;
+}
 
 /* Data type for Unicode general category.