aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
authorJoakim Verona2012-09-03 17:30:17 +0200
committerJoakim Verona2012-09-03 17:30:17 +0200
commit4a37733c693d59a9b83a3fb2d0c7f9461d149f60 (patch)
treea33402e09342f748baebf0e4f5a1e40538e620f4 /src/data.c
parent5436d1df5e2ba0b4d4f72b03a1cd09b20403654b (diff)
parentdcde497f27945c3ca4ce8c21f655ef6f627acdd2 (diff)
downloademacs-4a37733c693d59a9b83a3fb2d0c7f9461d149f60.tar.gz
emacs-4a37733c693d59a9b83a3fb2d0c7f9461d149f60.zip
upstream
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c77
1 files changed, 37 insertions, 40 deletions
diff --git a/src/data.c b/src/data.c
index ea511824e6d..d8b7f42ea3f 100644
--- a/src/data.c
+++ b/src/data.c
@@ -83,8 +83,8 @@ Lisp_Object Qoverflow_error, Qunderflow_error;
83Lisp_Object Qfloatp; 83Lisp_Object Qfloatp;
84Lisp_Object Qnumberp, Qnumber_or_marker_p; 84Lisp_Object Qnumberp, Qnumber_or_marker_p;
85 85
86Lisp_Object Qinteger, Qinterval, Qfloat, Qvector; 86Lisp_Object Qinteger, Qsymbol;
87Lisp_Object Qsymbol, Qstring, Qcons, Qmisc; 87static Lisp_Object Qcons, Qfloat, Qmisc, Qstring, Qvector;
88Lisp_Object Qwindow; 88Lisp_Object Qwindow;
89static Lisp_Object Qoverlay, Qwindow_configuration; 89static Lisp_Object Qoverlay, Qwindow_configuration;
90static Lisp_Object Qprocess, Qmarker; 90static Lisp_Object Qprocess, Qmarker;
@@ -847,7 +847,7 @@ do_symval_forwarding (register union Lisp_Fwd *valcontents)
847 return *XOBJFWD (valcontents)->objvar; 847 return *XOBJFWD (valcontents)->objvar;
848 848
849 case Lisp_Fwd_Buffer_Obj: 849 case Lisp_Fwd_Buffer_Obj:
850 return PER_BUFFER_VALUE (current_buffer, 850 return per_buffer_value (current_buffer,
851 XBUFFER_OBJFWD (valcontents)->offset); 851 XBUFFER_OBJFWD (valcontents)->offset);
852 852
853 case Lisp_Fwd_Kboard_Obj: 853 case Lisp_Fwd_Kboard_Obj:
@@ -919,7 +919,7 @@ store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newva
919 b = XBUFFER (lbuf); 919 b = XBUFFER (lbuf);
920 920
921 if (! PER_BUFFER_VALUE_P (b, idx)) 921 if (! PER_BUFFER_VALUE_P (b, idx))
922 PER_BUFFER_VALUE (b, offset) = newval; 922 set_per_buffer_value (b, offset, newval);
923 } 923 }
924 } 924 }
925 break; 925 break;
@@ -937,7 +937,7 @@ store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newva
937 937
938 if (buf == NULL) 938 if (buf == NULL)
939 buf = current_buffer; 939 buf = current_buffer;
940 PER_BUFFER_VALUE (buf, offset) = newval; 940 set_per_buffer_value (buf, offset, newval);
941 } 941 }
942 break; 942 break;
943 943
@@ -1080,10 +1080,10 @@ DEFUN ("set", Fset, Sset, 2, 2, 0,
1080 return newval; 1080 return newval;
1081} 1081}
1082 1082
1083/* Return 1 if SYMBOL currently has a let-binding 1083/* Return true if SYMBOL currently has a let-binding
1084 which was made in the buffer that is now current. */ 1084 which was made in the buffer that is now current. */
1085 1085
1086static int 1086static bool
1087let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol) 1087let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol)
1088{ 1088{
1089 struct specbinding *p; 1089 struct specbinding *p;
@@ -1102,7 +1102,7 @@ let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol)
1102 return 0; 1102 return 0;
1103} 1103}
1104 1104
1105static int 1105static bool
1106let_shadows_global_binding_p (Lisp_Object symbol) 1106let_shadows_global_binding_p (Lisp_Object symbol)
1107{ 1107{
1108 struct specbinding *p; 1108 struct specbinding *p;
@@ -1118,14 +1118,15 @@ let_shadows_global_binding_p (Lisp_Object symbol)
1118 If buffer/frame-locality is an issue, WHERE specifies which context to use. 1118 If buffer/frame-locality is an issue, WHERE specifies which context to use.
1119 (nil stands for the current buffer/frame). 1119 (nil stands for the current buffer/frame).
1120 1120
1121 If BINDFLAG is zero, then if this symbol is supposed to become 1121 If BINDFLAG is false, then if this symbol is supposed to become
1122 local in every buffer where it is set, then we make it local. 1122 local in every buffer where it is set, then we make it local.
1123 If BINDFLAG is nonzero, we don't do that. */ 1123 If BINDFLAG is true, we don't do that. */
1124 1124
1125void 1125void
1126set_internal (register Lisp_Object symbol, register Lisp_Object newval, register Lisp_Object where, int bindflag) 1126set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where,
1127 bool bindflag)
1127{ 1128{
1128 int voide = EQ (newval, Qunbound); 1129 bool voide = EQ (newval, Qunbound);
1129 struct Lisp_Symbol *sym; 1130 struct Lisp_Symbol *sym;
1130 Lisp_Object tem1; 1131 Lisp_Object tem1;
1131 1132
@@ -1184,7 +1185,7 @@ set_internal (register Lisp_Object symbol, register Lisp_Object newval, register
1184 ? XFRAME (where)->param_alist 1185 ? XFRAME (where)->param_alist
1185 : BVAR (XBUFFER (where), local_var_alist))); 1186 : BVAR (XBUFFER (where), local_var_alist)));
1186 set_blv_where (blv, where); 1187 set_blv_where (blv, where);
1187 set_blv_found (blv, 1); 1188 blv->found = 1;
1188 1189
1189 if (NILP (tem1)) 1190 if (NILP (tem1))
1190 { 1191 {
@@ -1199,7 +1200,7 @@ set_internal (register Lisp_Object symbol, register Lisp_Object newval, register
1199 if (bindflag || !blv->local_if_set 1200 if (bindflag || !blv->local_if_set
1200 || let_shadows_buffer_binding_p (sym)) 1201 || let_shadows_buffer_binding_p (sym))
1201 { 1202 {
1202 set_blv_found (blv, 0); 1203 blv->found = 0;
1203 tem1 = blv->defcell; 1204 tem1 = blv->defcell;
1204 } 1205 }
1205 /* If it's a local_if_set, being set not bound, 1206 /* If it's a local_if_set, being set not bound,
@@ -1309,7 +1310,7 @@ default_value (Lisp_Object symbol)
1309 { 1310 {
1310 int offset = XBUFFER_OBJFWD (valcontents)->offset; 1311 int offset = XBUFFER_OBJFWD (valcontents)->offset;
1311 if (PER_BUFFER_IDX (offset) != 0) 1312 if (PER_BUFFER_IDX (offset) != 0)
1312 return PER_BUFFER_DEFAULT (offset); 1313 return per_buffer_default (offset);
1313 } 1314 }
1314 1315
1315 /* For other variables, get the current value. */ 1316 /* For other variables, get the current value. */
@@ -1396,7 +1397,7 @@ for this variable. */)
1396 int offset = XBUFFER_OBJFWD (valcontents)->offset; 1397 int offset = XBUFFER_OBJFWD (valcontents)->offset;
1397 int idx = PER_BUFFER_IDX (offset); 1398 int idx = PER_BUFFER_IDX (offset);
1398 1399
1399 PER_BUFFER_DEFAULT (offset) = value; 1400 set_per_buffer_default (offset, value);
1400 1401
1401 /* If this variable is not always local in all buffers, 1402 /* If this variable is not always local in all buffers,
1402 set it in the buffers that don't nominally have a local value. */ 1403 set it in the buffers that don't nominally have a local value. */
@@ -1406,7 +1407,7 @@ for this variable. */)
1406 1407
1407 FOR_EACH_BUFFER (b) 1408 FOR_EACH_BUFFER (b)
1408 if (!PER_BUFFER_VALUE_P (b, idx)) 1409 if (!PER_BUFFER_VALUE_P (b, idx))
1409 PER_BUFFER_VALUE (b, offset) = value; 1410 set_per_buffer_value (b, offset, value);
1410 } 1411 }
1411 return value; 1412 return value;
1412 } 1413 }
@@ -1464,7 +1465,8 @@ union Lisp_Val_Fwd
1464 }; 1465 };
1465 1466
1466static struct Lisp_Buffer_Local_Value * 1467static struct Lisp_Buffer_Local_Value *
1467make_blv (struct Lisp_Symbol *sym, int forwarded, union Lisp_Val_Fwd valcontents) 1468make_blv (struct Lisp_Symbol *sym, bool forwarded,
1469 union Lisp_Val_Fwd valcontents)
1468{ 1470{
1469 struct Lisp_Buffer_Local_Value *blv = xmalloc (sizeof *blv); 1471 struct Lisp_Buffer_Local_Value *blv = xmalloc (sizeof *blv);
1470 Lisp_Object symbol; 1472 Lisp_Object symbol;
@@ -1508,7 +1510,7 @@ The function `default-value' gets the default value and `set-default' sets it.
1508 struct Lisp_Symbol *sym; 1510 struct Lisp_Symbol *sym;
1509 struct Lisp_Buffer_Local_Value *blv = NULL; 1511 struct Lisp_Buffer_Local_Value *blv = NULL;
1510 union Lisp_Val_Fwd valcontents IF_LINT (= {LISP_INITIALLY_ZERO}); 1512 union Lisp_Val_Fwd valcontents IF_LINT (= {LISP_INITIALLY_ZERO});
1511 int forwarded IF_LINT (= 0); 1513 bool forwarded IF_LINT (= 0);
1512 1514
1513 CHECK_SYMBOL (variable); 1515 CHECK_SYMBOL (variable);
1514 sym = XSYMBOL (variable); 1516 sym = XSYMBOL (variable);
@@ -1580,10 +1582,10 @@ See also `make-variable-buffer-local'.
1580 1582
1581Do not use `make-local-variable' to make a hook variable buffer-local. 1583Do not use `make-local-variable' to make a hook variable buffer-local.
1582Instead, use `add-hook' and specify t for the LOCAL argument. */) 1584Instead, use `add-hook' and specify t for the LOCAL argument. */)
1583 (register Lisp_Object variable) 1585 (Lisp_Object variable)
1584{ 1586{
1585 register Lisp_Object tem; 1587 Lisp_Object tem;
1586 int forwarded IF_LINT (= 0); 1588 bool forwarded IF_LINT (= 0);
1587 union Lisp_Val_Fwd valcontents IF_LINT (= {LISP_INITIALLY_ZERO}); 1589 union Lisp_Val_Fwd valcontents IF_LINT (= {LISP_INITIALLY_ZERO});
1588 struct Lisp_Symbol *sym; 1590 struct Lisp_Symbol *sym;
1589 struct Lisp_Buffer_Local_Value *blv = NULL; 1591 struct Lisp_Buffer_Local_Value *blv = NULL;
@@ -1705,8 +1707,8 @@ From now on the default value will apply in this buffer. Return VARIABLE. */)
1705 if (idx > 0) 1707 if (idx > 0)
1706 { 1708 {
1707 SET_PER_BUFFER_VALUE_P (current_buffer, idx, 0); 1709 SET_PER_BUFFER_VALUE_P (current_buffer, idx, 0);
1708 PER_BUFFER_VALUE (current_buffer, offset) 1710 set_per_buffer_value (current_buffer, offset,
1709 = PER_BUFFER_DEFAULT (offset); 1711 per_buffer_default (offset));
1710 } 1712 }
1711 } 1713 }
1712 return variable; 1714 return variable;
@@ -1735,7 +1737,7 @@ From now on the default value will apply in this buffer. Return VARIABLE. */)
1735 if (EQ (buf, blv->where)) 1737 if (EQ (buf, blv->where))
1736 { 1738 {
1737 set_blv_where (blv, Qnil); 1739 set_blv_where (blv, Qnil);
1738 set_blv_found (blv, 0); 1740 blv->found = 0;
1739 find_symbol_value (variable); 1741 find_symbol_value (variable);
1740 } 1742 }
1741 } 1743 }
@@ -1767,9 +1769,9 @@ is to set the VARIABLE frame parameter of that frame. See
1767Note that since Emacs 23.1, variables cannot be both buffer-local and 1769Note that since Emacs 23.1, variables cannot be both buffer-local and
1768frame-local any more (buffer-local bindings used to take precedence over 1770frame-local any more (buffer-local bindings used to take precedence over
1769frame-local bindings). */) 1771frame-local bindings). */)
1770 (register Lisp_Object variable) 1772 (Lisp_Object variable)
1771{ 1773{
1772 int forwarded; 1774 bool forwarded;
1773 union Lisp_Val_Fwd valcontents; 1775 union Lisp_Val_Fwd valcontents;
1774 struct Lisp_Symbol *sym; 1776 struct Lisp_Symbol *sym;
1775 struct Lisp_Buffer_Local_Value *blv = NULL; 1777 struct Lisp_Buffer_Local_Value *blv = NULL;
@@ -2225,7 +2227,7 @@ static Lisp_Object
2225arithcompare (Lisp_Object num1, Lisp_Object num2, enum comparison comparison) 2227arithcompare (Lisp_Object num1, Lisp_Object num2, enum comparison comparison)
2226{ 2228{
2227 double f1 = 0, f2 = 0; 2229 double f1 = 0, f2 = 0;
2228 int floatp = 0; 2230 bool floatp = 0;
2229 2231
2230 CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (num1); 2232 CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (num1);
2231 CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (num2); 2233 CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (num2);
@@ -2342,7 +2344,7 @@ DEFUN ("zerop", Fzerop, Szerop, 1, 1, 0,
2342uintmax_t 2344uintmax_t
2343cons_to_unsigned (Lisp_Object c, uintmax_t max) 2345cons_to_unsigned (Lisp_Object c, uintmax_t max)
2344{ 2346{
2345 int valid = 0; 2347 bool valid = 0;
2346 uintmax_t val IF_LINT (= 0); 2348 uintmax_t val IF_LINT (= 0);
2347 if (INTEGERP (c)) 2349 if (INTEGERP (c))
2348 { 2350 {
@@ -2395,7 +2397,7 @@ cons_to_unsigned (Lisp_Object c, uintmax_t max)
2395intmax_t 2397intmax_t
2396cons_to_signed (Lisp_Object c, intmax_t min, intmax_t max) 2398cons_to_signed (Lisp_Object c, intmax_t min, intmax_t max)
2397{ 2399{
2398 int valid = 0; 2400 bool valid = 0;
2399 intmax_t val IF_LINT (= 0); 2401 intmax_t val IF_LINT (= 0);
2400 if (INTEGERP (c)) 2402 if (INTEGERP (c))
2401 { 2403 {
@@ -2513,14 +2515,11 @@ static Lisp_Object float_arith_driver (double, ptrdiff_t, enum arithop,
2513static Lisp_Object 2515static Lisp_Object
2514arith_driver (enum arithop code, ptrdiff_t nargs, Lisp_Object *args) 2516arith_driver (enum arithop code, ptrdiff_t nargs, Lisp_Object *args)
2515{ 2517{
2516 register Lisp_Object val; 2518 Lisp_Object val;
2517 ptrdiff_t argnum; 2519 ptrdiff_t argnum, ok_args;
2518 register EMACS_INT accum = 0; 2520 EMACS_INT accum = 0;
2519 register EMACS_INT next; 2521 EMACS_INT next, ok_accum;
2520 2522 bool overflow = 0;
2521 int overflow = 0;
2522 ptrdiff_t ok_args;
2523 EMACS_INT ok_accum;
2524 2523
2525 switch (code) 2524 switch (code)
2526 { 2525 {
@@ -3090,8 +3089,6 @@ syms_of_data (void)
3090 DEFSYM (Qchar_table, "char-table"); 3089 DEFSYM (Qchar_table, "char-table");
3091 DEFSYM (Qbool_vector, "bool-vector"); 3090 DEFSYM (Qbool_vector, "bool-vector");
3092 DEFSYM (Qhash_table, "hash-table"); 3091 DEFSYM (Qhash_table, "hash-table");
3093 /* Used by Fgarbage_collect. */
3094 DEFSYM (Qinterval, "interval");
3095 DEFSYM (Qmisc, "misc"); 3092 DEFSYM (Qmisc, "misc");
3096 3093
3097 DEFSYM (Qdefun, "defun"); 3094 DEFSYM (Qdefun, "defun");