]> code.delx.au - gnu-emacs/blobdiff - src/keymap.c
Update copyright year to 2016
[gnu-emacs] / src / keymap.c
index 6a8d129ce2b108c2deff44d02ce77a00bacd5d30..7928e62ea4441ab7904f5cb17d40c0ec448d6c9a 100644 (file)
@@ -1,5 +1,5 @@
 /* Manipulation of keymaps
-   Copyright (C) 1985-1988, 1993-1995, 1998-2015 Free Software
+   Copyright (C) 1985-1988, 1993-1995, 1998-2016 Free Software
    Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -46,9 +46,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "commands.h"
 #include "character.h"
 #include "buffer.h"
-#include "charset.h"
 #include "keyboard.h"
-#include "frame.h"
 #include "termhooks.h"
 #include "blockinput.h"
 #include "puresize.h"
@@ -341,7 +339,7 @@ Return PARENT.  PARENT should be nil or another keymap.  */)
         If we came to the end, add the parent in PREV.  */
       if (!CONSP (list) || KEYMAPP (list))
        {
-         CHECK_IMPURE (prev);
+         CHECK_IMPURE (prev, XCONS (prev));
          XSETCDR (prev, parent);
          return parent;
        }
@@ -750,7 +748,7 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx, Lisp_Object def)
 
   /* If we are preparing to dump, and DEF is a menu element
      with a menu item indicator, copy it to ensure it is not pure.  */
-  if (CONSP (def) && PURE_P (def)
+  if (CONSP (def) && PURE_P (XCONS (def))
       && (EQ (XCAR (def), Qmenu_item) || STRINGP (XCAR (def))))
     def = Fcons (XCAR (def), XCDR (def));
 
@@ -798,7 +796,7 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx, Lisp_Object def)
          {
            if (NATNUMP (idx) && XFASTINT (idx) < ASIZE (elt))
              {
-               CHECK_IMPURE (elt);
+               CHECK_IMPURE (elt, XVECTOR (elt));
                ASET (elt, XFASTINT (idx), def);
                return def;
              }
@@ -851,11 +849,13 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx, Lisp_Object def)
              }
            else if (EQ (idx, XCAR (elt)))
              {
-               CHECK_IMPURE (elt);
+               CHECK_IMPURE (elt, XCONS (elt));
                XSETCDR (elt, def);
                return def;
              }
-           else if (CONSP (idx) && CHARACTERP (XCAR (idx)))
+           else if (CONSP (idx)
+                    && CHARACTERP (XCAR (idx))
+                    && CHARACTERP (XCAR (elt)))
              {
                int from = XFASTINT (XCAR (idx));
                int to = XFASTINT (XCDR (idx));
@@ -895,7 +895,7 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx, Lisp_Object def)
        }
       else
        elt = Fcons (idx, def);
-      CHECK_IMPURE (insertion_point);
+      CHECK_IMPURE (insertion_point, XCONS (insertion_point));
       XSETCDR (insertion_point, Fcons (elt, XCDR (insertion_point)));
     }
   }
@@ -1986,9 +1986,10 @@ For an approximate inverse of this, see `kbd'.  */)
     size += XINT (Flength (prefix));
 
   /* This has one extra element at the end that we don't pass to Fconcat.  */
-  if (min (PTRDIFF_MAX, SIZE_MAX) / word_size / 4 < size)
+  EMACS_INT size4;
+  if (INT_MULTIPLY_WRAPV (size, 4, &size4))
     memory_full (SIZE_MAX);
-  SAFE_ALLOCA_LISP (args, size * 4);
+  SAFE_ALLOCA_LISP (args, size4);
 
   /* In effect, this computes
      (mapconcat 'single-key-description keys " ")