aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/data.c b/src/data.c
index 5fc6afaaa03..b20d1b4c8af 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1,6 +1,6 @@
1/* Primitive operations on Lisp data types for GNU Emacs Lisp interpreter. 1/* Primitive operations on Lisp data types for GNU Emacs Lisp interpreter.
2 Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2012 2 Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2013 Free Software
3 Free Software Foundation, Inc. 3 Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -506,7 +506,9 @@ DEFUN ("setcdr", Fsetcdr, Ssetcdr, 2, 2, 0,
506/* Extract and set components of symbols. */ 506/* Extract and set components of symbols. */
507 507
508DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0, 508DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0,
509 doc: /* Return t if SYMBOL's value is not void. */) 509 doc: /* Return t if SYMBOL's value is not void.
510Note that if `lexical-binding' is in effect, this refers to the
511global value outside of any lexical scope. */)
510 (register Lisp_Object symbol) 512 (register Lisp_Object symbol)
511{ 513{
512 Lisp_Object valcontents; 514 Lisp_Object valcontents;
@@ -581,7 +583,7 @@ DEFUN ("symbol-function", Fsymbol_function, Ssymbol_function, 1, 1, 0,
581 (register Lisp_Object symbol) 583 (register Lisp_Object symbol)
582{ 584{
583 CHECK_SYMBOL (symbol); 585 CHECK_SYMBOL (symbol);
584 return XSYMBOL (symbol)->function; 586 return XSYMBOL (symbol)->function;
585} 587}
586 588
587DEFUN ("symbol-plist", Fsymbol_plist, Ssymbol_plist, 1, 1, 0, 589DEFUN ("symbol-plist", Fsymbol_plist, Ssymbol_plist, 1, 1, 0,
@@ -912,13 +914,11 @@ store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newva
912 case Lisp_Fwd_Buffer_Obj: 914 case Lisp_Fwd_Buffer_Obj:
913 { 915 {
914 int offset = XBUFFER_OBJFWD (valcontents)->offset; 916 int offset = XBUFFER_OBJFWD (valcontents)->offset;
915 Lisp_Object type = XBUFFER_OBJFWD (valcontents)->slottype; 917 Lisp_Object predicate = XBUFFER_OBJFWD (valcontents)->predicate;
916 918
917 if (!(NILP (type) || NILP (newval) 919 if (!NILP (predicate) && !NILP (newval)
918 || (XINT (type) == Lisp_Int0 920 && NILP (call1 (predicate, newval)))
919 ? INTEGERP (newval) 921 wrong_type_argument (predicate, newval);
920 : XTYPE (newval) == XINT (type))))
921 buffer_slot_type_mismatch (newval, XINT (type));
922 922
923 if (buf == NULL) 923 if (buf == NULL)
924 buf = current_buffer; 924 buf = current_buffer;
@@ -1047,7 +1047,9 @@ find_symbol_value (Lisp_Object symbol)
1047} 1047}
1048 1048
1049DEFUN ("symbol-value", Fsymbol_value, Ssymbol_value, 1, 1, 0, 1049DEFUN ("symbol-value", Fsymbol_value, Ssymbol_value, 1, 1, 0,
1050 doc: /* Return SYMBOL's value. Error if that is void. */) 1050 doc: /* Return SYMBOL's value. Error if that is void.
1051Note that if `lexical-binding' is in effect, this returns the
1052global value outside of any lexical scope. */)
1051 (Lisp_Object symbol) 1053 (Lisp_Object symbol)
1052{ 1054{
1053 Lisp_Object val; 1055 Lisp_Object val;
@@ -2335,13 +2337,13 @@ cons_to_unsigned (Lisp_Object c, uintmax_t max)
2335 uintmax_t val IF_LINT (= 0); 2337 uintmax_t val IF_LINT (= 0);
2336 if (INTEGERP (c)) 2338 if (INTEGERP (c))
2337 { 2339 {
2338 valid = 0 <= XINT (c); 2340 valid = XINT (c) >= 0;
2339 val = XINT (c); 2341 val = XINT (c);
2340 } 2342 }
2341 else if (FLOATP (c)) 2343 else if (FLOATP (c))
2342 { 2344 {
2343 double d = XFLOAT_DATA (c); 2345 double d = XFLOAT_DATA (c);
2344 if (0 <= d 2346 if (d >= 0
2345 && d < (max == UINTMAX_MAX ? (double) UINTMAX_MAX + 1 : max + 1)) 2347 && d < (max == UINTMAX_MAX ? (double) UINTMAX_MAX + 1 : max + 1))
2346 { 2348 {
2347 val = d; 2349 val = d;