diff options
Diffstat (limited to 'src/data.c')
| -rw-r--r-- | src/data.c | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/src/data.c b/src/data.c index 95c1d857964..9492c8041c8 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -687,7 +687,6 @@ DEFUN ("setcar", Fsetcar, Ssetcar, 2, 2, 0, | |||
| 687 | (register Lisp_Object cell, Lisp_Object newcar) | 687 | (register Lisp_Object cell, Lisp_Object newcar) |
| 688 | { | 688 | { |
| 689 | CHECK_CONS (cell); | 689 | CHECK_CONS (cell); |
| 690 | CHECK_IMPURE (cell, XCONS (cell)); | ||
| 691 | XSETCAR (cell, newcar); | 690 | XSETCAR (cell, newcar); |
| 692 | return newcar; | 691 | return newcar; |
| 693 | } | 692 | } |
| @@ -697,7 +696,6 @@ DEFUN ("setcdr", Fsetcdr, Ssetcdr, 2, 2, 0, | |||
| 697 | (register Lisp_Object cell, Lisp_Object newcdr) | 696 | (register Lisp_Object cell, Lisp_Object newcdr) |
| 698 | { | 697 | { |
| 699 | CHECK_CONS (cell); | 698 | CHECK_CONS (cell); |
| 700 | CHECK_IMPURE (cell, XCONS (cell)); | ||
| 701 | XSETCDR (cell, newcdr); | 699 | XSETCDR (cell, newcdr); |
| 702 | return newcdr; | 700 | return newcdr; |
| 703 | } | 701 | } |
| @@ -995,10 +993,6 @@ The return value is undefined. */) | |||
| 995 | (register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring) | 993 | (register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring) |
| 996 | { | 994 | { |
| 997 | CHECK_SYMBOL (symbol); | 995 | CHECK_SYMBOL (symbol); |
| 998 | if (!NILP (Vpurify_flag) | ||
| 999 | /* If `definition' is a keymap, immutable (and copying) is wrong. */ | ||
| 1000 | && !KEYMAPP (definition)) | ||
| 1001 | definition = Fpurecopy (definition); | ||
| 1002 | 996 | ||
| 1003 | defalias (symbol, definition); | 997 | defalias (symbol, definition); |
| 1004 | 998 | ||
| @@ -2588,7 +2582,6 @@ bool-vector. IDX starts at 0. */) | |||
| 2588 | 2582 | ||
| 2589 | if (VECTORP (array)) | 2583 | if (VECTORP (array)) |
| 2590 | { | 2584 | { |
| 2591 | CHECK_IMPURE (array, XVECTOR (array)); | ||
| 2592 | if (idxval < 0 || idxval >= ASIZE (array)) | 2585 | if (idxval < 0 || idxval >= ASIZE (array)) |
| 2593 | args_out_of_range (array, idx); | 2586 | args_out_of_range (array, idx); |
| 2594 | ASET (array, idxval, newelt); | 2587 | ASET (array, idxval, newelt); |
| @@ -2606,14 +2599,12 @@ bool-vector. IDX starts at 0. */) | |||
| 2606 | } | 2599 | } |
| 2607 | else if (RECORDP (array)) | 2600 | else if (RECORDP (array)) |
| 2608 | { | 2601 | { |
| 2609 | CHECK_IMPURE (array, XVECTOR (array)); | ||
| 2610 | if (idxval < 0 || idxval >= PVSIZE (array)) | 2602 | if (idxval < 0 || idxval >= PVSIZE (array)) |
| 2611 | args_out_of_range (array, idx); | 2603 | args_out_of_range (array, idx); |
| 2612 | ASET (array, idxval, newelt); | 2604 | ASET (array, idxval, newelt); |
| 2613 | } | 2605 | } |
| 2614 | else /* STRINGP */ | 2606 | else /* STRINGP */ |
| 2615 | { | 2607 | { |
| 2616 | CHECK_IMPURE (array, XSTRING (array)); | ||
| 2617 | if (idxval < 0 || idxval >= SCHARS (array)) | 2608 | if (idxval < 0 || idxval >= SCHARS (array)) |
| 2618 | args_out_of_range (array, idx); | 2609 | args_out_of_range (array, idx); |
| 2619 | CHECK_CHARACTER (newelt); | 2610 | CHECK_CHARACTER (newelt); |
| @@ -4072,7 +4063,7 @@ syms_of_data (void) | |||
| 4072 | DEFSYM (Qaref, "aref"); | 4063 | DEFSYM (Qaref, "aref"); |
| 4073 | DEFSYM (Qaset, "aset"); | 4064 | DEFSYM (Qaset, "aset"); |
| 4074 | 4065 | ||
| 4075 | error_tail = pure_cons (Qerror, Qnil); | 4066 | error_tail = Fcons (Qerror, Qnil); |
| 4076 | 4067 | ||
| 4077 | /* ERROR is used as a signaler for random errors for which nothing else is | 4068 | /* ERROR is used as a signaler for random errors for which nothing else is |
| 4078 | right. */ | 4069 | right. */ |
| @@ -4080,14 +4071,14 @@ syms_of_data (void) | |||
| 4080 | Fput (Qerror, Qerror_conditions, | 4071 | Fput (Qerror, Qerror_conditions, |
| 4081 | error_tail); | 4072 | error_tail); |
| 4082 | Fput (Qerror, Qerror_message, | 4073 | Fput (Qerror, Qerror_message, |
| 4083 | build_pure_c_string ("error")); | 4074 | build_string ("error")); |
| 4084 | 4075 | ||
| 4085 | #define PUT_ERROR(sym, tail, msg) \ | 4076 | #define PUT_ERROR(sym, tail, msg) \ |
| 4086 | Fput (sym, Qerror_conditions, pure_cons (sym, tail)); \ | 4077 | Fput (sym, Qerror_conditions, Fcons (sym, tail)); \ |
| 4087 | Fput (sym, Qerror_message, build_pure_c_string (msg)) | 4078 | Fput (sym, Qerror_message, build_string (msg)) |
| 4088 | 4079 | ||
| 4089 | PUT_ERROR (Qquit, Qnil, "Quit"); | 4080 | PUT_ERROR (Qquit, Qnil, "Quit"); |
| 4090 | PUT_ERROR (Qminibuffer_quit, pure_cons (Qquit, Qnil), "Quit"); | 4081 | PUT_ERROR (Qminibuffer_quit, Fcons (Qquit, Qnil), "Quit"); |
| 4091 | 4082 | ||
| 4092 | PUT_ERROR (Quser_error, error_tail, ""); | 4083 | PUT_ERROR (Quser_error, error_tail, ""); |
| 4093 | PUT_ERROR (Qwrong_length_argument, error_tail, "Wrong length argument"); | 4084 | PUT_ERROR (Qwrong_length_argument, error_tail, "Wrong length argument"); |
| @@ -4114,14 +4105,14 @@ syms_of_data (void) | |||
| 4114 | PUT_ERROR (Qno_catch, error_tail, "No catch for tag"); | 4105 | PUT_ERROR (Qno_catch, error_tail, "No catch for tag"); |
| 4115 | PUT_ERROR (Qend_of_file, error_tail, "End of file during parsing"); | 4106 | PUT_ERROR (Qend_of_file, error_tail, "End of file during parsing"); |
| 4116 | 4107 | ||
| 4117 | arith_tail = pure_cons (Qarith_error, error_tail); | 4108 | arith_tail = Fcons (Qarith_error, error_tail); |
| 4118 | Fput (Qarith_error, Qerror_conditions, arith_tail); | 4109 | Fput (Qarith_error, Qerror_conditions, arith_tail); |
| 4119 | Fput (Qarith_error, Qerror_message, build_pure_c_string ("Arithmetic error")); | 4110 | Fput (Qarith_error, Qerror_message, build_string ("Arithmetic error")); |
| 4120 | 4111 | ||
| 4121 | PUT_ERROR (Qbeginning_of_buffer, error_tail, "Beginning of buffer"); | 4112 | PUT_ERROR (Qbeginning_of_buffer, error_tail, "Beginning of buffer"); |
| 4122 | PUT_ERROR (Qend_of_buffer, error_tail, "End of buffer"); | 4113 | PUT_ERROR (Qend_of_buffer, error_tail, "End of buffer"); |
| 4123 | PUT_ERROR (Qbuffer_read_only, error_tail, "Buffer is read-only"); | 4114 | PUT_ERROR (Qbuffer_read_only, error_tail, "Buffer is read-only"); |
| 4124 | PUT_ERROR (Qtext_read_only, pure_cons (Qbuffer_read_only, error_tail), | 4115 | PUT_ERROR (Qtext_read_only, Fcons (Qbuffer_read_only, error_tail), |
| 4125 | "Text is read-only"); | 4116 | "Text is read-only"); |
| 4126 | PUT_ERROR (Qinhibited_interaction, error_tail, | 4117 | PUT_ERROR (Qinhibited_interaction, error_tail, |
| 4127 | "User interaction while inhibited"); | 4118 | "User interaction while inhibited"); |
| @@ -4144,10 +4135,10 @@ syms_of_data (void) | |||
| 4144 | PUT_ERROR (Qunderflow_error, Fcons (Qrange_error, arith_tail), | 4135 | PUT_ERROR (Qunderflow_error, Fcons (Qrange_error, arith_tail), |
| 4145 | "Arithmetic underflow error"); | 4136 | "Arithmetic underflow error"); |
| 4146 | 4137 | ||
| 4147 | recursion_tail = pure_cons (Qrecursion_error, error_tail); | 4138 | recursion_tail = Fcons (Qrecursion_error, error_tail); |
| 4148 | Fput (Qrecursion_error, Qerror_conditions, recursion_tail); | 4139 | Fput (Qrecursion_error, Qerror_conditions, recursion_tail); |
| 4149 | Fput (Qrecursion_error, Qerror_message, build_pure_c_string | 4140 | Fput (Qrecursion_error, Qerror_message, |
| 4150 | ("Excessive recursive calling error")); | 4141 | build_string ("Excessive recursive calling error")); |
| 4151 | 4142 | ||
| 4152 | PUT_ERROR (Qexcessive_lisp_nesting, recursion_tail, | 4143 | PUT_ERROR (Qexcessive_lisp_nesting, recursion_tail, |
| 4153 | "Lisp nesting exceeds `max-lisp-eval-depth'"); | 4144 | "Lisp nesting exceeds `max-lisp-eval-depth'"); |