aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
authorDmitry Antipov2012-08-01 11:57:09 +0400
committerDmitry Antipov2012-08-01 11:57:09 +0400
commit8271d59040b3d83fb3fc8cb23723538183b12ad4 (patch)
tree909df79d98251334a8e2dc393d54ec47cc441756 /src/data.c
parent0d26d7c4dc79554439ad96fb7d9f75aa2085e0ca (diff)
downloademacs-8271d59040b3d83fb3fc8cb23723538183b12ad4.tar.gz
emacs-8271d59040b3d83fb3fc8cb23723538183b12ad4.zip
Use INTERNAL_FIELD for symbols.
* src/lisp.h (SVAR): New macro. Adjust users. * src/alloc.c, src/bytecode.c, src/cmds.c, src/data.c, src/doc.c, src/eval.c: * src/fns.c, src/keyboard.c, src/lread.c, src/xterm.c: Users changed. * admin/coccinelle/symbol.cocci: Semantic patch to replace direct access to Lisp_Object members of struct Lisp_Symbol to SVAR.
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/data.c b/src/data.c
index 59228adb28f..4c6f7fe3eae 100644
--- a/src/data.c
+++ b/src/data.c
@@ -562,7 +562,7 @@ DEFUN ("fboundp", Ffboundp, Sfboundp, 1, 1, 0,
562 (register Lisp_Object symbol) 562 (register Lisp_Object symbol)
563{ 563{
564 CHECK_SYMBOL (symbol); 564 CHECK_SYMBOL (symbol);
565 return (EQ (XSYMBOL (symbol)->function, Qunbound) ? Qnil : Qt); 565 return (EQ (SVAR (XSYMBOL (symbol), function), Qunbound) ? Qnil : Qt);
566} 566}
567 567
568DEFUN ("makunbound", Fmakunbound, Smakunbound, 1, 1, 0, 568DEFUN ("makunbound", Fmakunbound, Smakunbound, 1, 1, 0,
@@ -585,7 +585,7 @@ Return SYMBOL. */)
585 CHECK_SYMBOL (symbol); 585 CHECK_SYMBOL (symbol);
586 if (NILP (symbol) || EQ (symbol, Qt)) 586 if (NILP (symbol) || EQ (symbol, Qt))
587 xsignal1 (Qsetting_constant, symbol); 587 xsignal1 (Qsetting_constant, symbol);
588 XSYMBOL (symbol)->function = Qunbound; 588 SVAR (XSYMBOL (symbol), function) = Qunbound;
589 return symbol; 589 return symbol;
590} 590}
591 591
@@ -594,8 +594,8 @@ DEFUN ("symbol-function", Fsymbol_function, Ssymbol_function, 1, 1, 0,
594 (register Lisp_Object symbol) 594 (register Lisp_Object symbol)
595{ 595{
596 CHECK_SYMBOL (symbol); 596 CHECK_SYMBOL (symbol);
597 if (!EQ (XSYMBOL (symbol)->function, Qunbound)) 597 if (!EQ (SVAR (XSYMBOL (symbol), function), Qunbound))
598 return XSYMBOL (symbol)->function; 598 return SVAR (XSYMBOL (symbol), function);
599 xsignal1 (Qvoid_function, symbol); 599 xsignal1 (Qvoid_function, symbol);
600} 600}
601 601
@@ -604,7 +604,7 @@ DEFUN ("symbol-plist", Fsymbol_plist, Ssymbol_plist, 1, 1, 0,
604 (register Lisp_Object symbol) 604 (register Lisp_Object symbol)
605{ 605{
606 CHECK_SYMBOL (symbol); 606 CHECK_SYMBOL (symbol);
607 return XSYMBOL (symbol)->plist; 607 return SVAR (XSYMBOL (symbol), plist);
608} 608}
609 609
610DEFUN ("symbol-name", Fsymbol_name, Ssymbol_name, 1, 1, 0, 610DEFUN ("symbol-name", Fsymbol_name, Ssymbol_name, 1, 1, 0,
@@ -628,7 +628,7 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0,
628 if (NILP (symbol) || EQ (symbol, Qt)) 628 if (NILP (symbol) || EQ (symbol, Qt))
629 xsignal1 (Qsetting_constant, symbol); 629 xsignal1 (Qsetting_constant, symbol);
630 630
631 function = XSYMBOL (symbol)->function; 631 function = SVAR (XSYMBOL (symbol), function);
632 632
633 if (!NILP (Vautoload_queue) && !EQ (function, Qunbound)) 633 if (!NILP (Vautoload_queue) && !EQ (function, Qunbound))
634 Vautoload_queue = Fcons (Fcons (symbol, function), Vautoload_queue); 634 Vautoload_queue = Fcons (Fcons (symbol, function), Vautoload_queue);
@@ -636,13 +636,13 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0,
636 if (CONSP (function) && EQ (XCAR (function), Qautoload)) 636 if (CONSP (function) && EQ (XCAR (function), Qautoload))
637 Fput (symbol, Qautoload, XCDR (function)); 637 Fput (symbol, Qautoload, XCDR (function));
638 638
639 XSYMBOL (symbol)->function = definition; 639 SVAR (XSYMBOL (symbol), function) = definition;
640 /* Handle automatic advice activation. */ 640 /* Handle automatic advice activation. */
641 if (CONSP (XSYMBOL (symbol)->plist) 641 if (CONSP (SVAR (XSYMBOL (symbol), plist))
642 && !NILP (Fget (symbol, Qad_advice_info))) 642 && !NILP (Fget (symbol, Qad_advice_info)))
643 { 643 {
644 call2 (Qad_activate_internal, symbol, Qnil); 644 call2 (Qad_activate_internal, symbol, Qnil);
645 definition = XSYMBOL (symbol)->function; 645 definition = SVAR (XSYMBOL (symbol), function);
646 } 646 }
647 return definition; 647 return definition;
648} 648}
@@ -657,8 +657,8 @@ The return value is undefined. */)
657 (register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring) 657 (register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring)
658{ 658{
659 CHECK_SYMBOL (symbol); 659 CHECK_SYMBOL (symbol);
660 if (CONSP (XSYMBOL (symbol)->function) 660 if (CONSP (SVAR (XSYMBOL (symbol), function))
661 && EQ (XCAR (XSYMBOL (symbol)->function), Qautoload)) 661 && EQ (XCAR (SVAR (XSYMBOL (symbol), function)), Qautoload))
662 LOADHIST_ATTACH (Fcons (Qt, symbol)); 662 LOADHIST_ATTACH (Fcons (Qt, symbol));
663 if (!NILP (Vpurify_flag) 663 if (!NILP (Vpurify_flag)
664 /* If `definition' is a keymap, immutable (and copying) is wrong. */ 664 /* If `definition' is a keymap, immutable (and copying) is wrong. */
@@ -679,7 +679,7 @@ DEFUN ("setplist", Fsetplist, Ssetplist, 2, 2, 0,
679 (register Lisp_Object symbol, Lisp_Object newplist) 679 (register Lisp_Object symbol, Lisp_Object newplist)
680{ 680{
681 CHECK_SYMBOL (symbol); 681 CHECK_SYMBOL (symbol);
682 XSYMBOL (symbol)->plist = newplist; 682 SVAR (XSYMBOL (symbol), plist) = newplist;
683 return newplist; 683 return newplist;
684} 684}
685 685
@@ -2019,12 +2019,12 @@ indirect_function (register Lisp_Object object)
2019 { 2019 {
2020 if (!SYMBOLP (hare) || EQ (hare, Qunbound)) 2020 if (!SYMBOLP (hare) || EQ (hare, Qunbound))
2021 break; 2021 break;
2022 hare = XSYMBOL (hare)->function; 2022 hare = SVAR (XSYMBOL (hare), function);
2023 if (!SYMBOLP (hare) || EQ (hare, Qunbound)) 2023 if (!SYMBOLP (hare) || EQ (hare, Qunbound))
2024 break; 2024 break;
2025 hare = XSYMBOL (hare)->function; 2025 hare = SVAR (XSYMBOL (hare), function);
2026 2026
2027 tortoise = XSYMBOL (tortoise)->function; 2027 tortoise = SVAR (XSYMBOL (tortoise), function);
2028 2028
2029 if (EQ (hare, tortoise)) 2029 if (EQ (hare, tortoise))
2030 xsignal1 (Qcyclic_function_indirection, object); 2030 xsignal1 (Qcyclic_function_indirection, object);
@@ -2048,7 +2048,7 @@ function chain of symbols. */)
2048 /* Optimize for no indirection. */ 2048 /* Optimize for no indirection. */
2049 result = object; 2049 result = object;
2050 if (SYMBOLP (result) && !EQ (result, Qunbound) 2050 if (SYMBOLP (result) && !EQ (result, Qunbound)
2051 && (result = XSYMBOL (result)->function, SYMBOLP (result))) 2051 && (result = SVAR (XSYMBOL (result), function), SYMBOLP (result)))
2052 result = indirect_function (result); 2052 result = indirect_function (result);
2053 if (!EQ (result, Qunbound)) 2053 if (!EQ (result, Qunbound))
2054 return result; 2054 return result;
@@ -3197,7 +3197,7 @@ syms_of_data (void)
3197 defsubr (&Ssubr_arity); 3197 defsubr (&Ssubr_arity);
3198 defsubr (&Ssubr_name); 3198 defsubr (&Ssubr_name);
3199 3199
3200 XSYMBOL (Qwholenump)->function = XSYMBOL (Qnatnump)->function; 3200 SVAR (XSYMBOL (Qwholenump), function) = SVAR (XSYMBOL (Qnatnump), function);
3201 3201
3202 DEFVAR_LISP ("most-positive-fixnum", Vmost_positive_fixnum, 3202 DEFVAR_LISP ("most-positive-fixnum", Vmost_positive_fixnum,
3203 doc: /* The largest value that is representable in a Lisp integer. */); 3203 doc: /* The largest value that is representable in a Lisp integer. */);