/* 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.
#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"
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;
}
/* 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));
{
if (NATNUMP (idx) && XFASTINT (idx) < ASIZE (elt))
{
- CHECK_IMPURE (elt);
+ CHECK_IMPURE (elt, XVECTOR (elt));
ASET (elt, XFASTINT (idx), def);
return 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));
}
else
elt = Fcons (idx, def);
- CHECK_IMPURE (insertion_point);
+ CHECK_IMPURE (insertion_point, XCONS (insertion_point));
XSETCDR (insertion_point, Fcons (elt, XCDR (insertion_point)));
}
}
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 " ")