diff options
Diffstat (limited to 'src/data.c')
| -rw-r--r-- | src/data.c | 88 |
1 files changed, 29 insertions, 59 deletions
diff --git a/src/data.c b/src/data.c index d44176d9b01..156c900933f 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -50,7 +50,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 50 | #include <math.h> | 50 | #include <math.h> |
| 51 | 51 | ||
| 52 | #if !defined (atof) | 52 | #if !defined (atof) |
| 53 | extern double atof (); | 53 | extern double atof (const char *); |
| 54 | #endif /* !atof */ | 54 | #endif /* !atof */ |
| 55 | 55 | ||
| 56 | Lisp_Object Qnil, Qt, Qquote, Qlambda, Qsubr, Qunbound; | 56 | Lisp_Object Qnil, Qt, Qquote, Qlambda, Qsubr, Qunbound; |
| @@ -97,16 +97,14 @@ Lisp_Object Vmost_positive_fixnum, Vmost_negative_fixnum; | |||
| 97 | 97 | ||
| 98 | 98 | ||
| 99 | void | 99 | void |
| 100 | circular_list_error (list) | 100 | circular_list_error (Lisp_Object list) |
| 101 | Lisp_Object list; | ||
| 102 | { | 101 | { |
| 103 | xsignal (Qcircular_list, list); | 102 | xsignal (Qcircular_list, list); |
| 104 | } | 103 | } |
| 105 | 104 | ||
| 106 | 105 | ||
| 107 | Lisp_Object | 106 | Lisp_Object |
| 108 | wrong_type_argument (predicate, value) | 107 | wrong_type_argument (register Lisp_Object predicate, register Lisp_Object value) |
| 109 | register Lisp_Object predicate, value; | ||
| 110 | { | 108 | { |
| 111 | /* If VALUE is not even a valid Lisp object, we'd want to abort here | 109 | /* If VALUE is not even a valid Lisp object, we'd want to abort here |
| 112 | where we can get a backtrace showing where it came from. We used | 110 | where we can get a backtrace showing where it came from. We used |
| @@ -119,21 +117,19 @@ wrong_type_argument (predicate, value) | |||
| 119 | } | 117 | } |
| 120 | 118 | ||
| 121 | void | 119 | void |
| 122 | pure_write_error () | 120 | pure_write_error (void) |
| 123 | { | 121 | { |
| 124 | error ("Attempt to modify read-only object"); | 122 | error ("Attempt to modify read-only object"); |
| 125 | } | 123 | } |
| 126 | 124 | ||
| 127 | void | 125 | void |
| 128 | args_out_of_range (a1, a2) | 126 | args_out_of_range (Lisp_Object a1, Lisp_Object a2) |
| 129 | Lisp_Object a1, a2; | ||
| 130 | { | 127 | { |
| 131 | xsignal2 (Qargs_out_of_range, a1, a2); | 128 | xsignal2 (Qargs_out_of_range, a1, a2); |
| 132 | } | 129 | } |
| 133 | 130 | ||
| 134 | void | 131 | void |
| 135 | args_out_of_range_3 (a1, a2, a3) | 132 | args_out_of_range_3 (Lisp_Object a1, Lisp_Object a2, Lisp_Object a3) |
| 136 | Lisp_Object a1, a2, a3; | ||
| 137 | { | 133 | { |
| 138 | xsignal3 (Qargs_out_of_range, a1, a2, a3); | 134 | xsignal3 (Qargs_out_of_range, a1, a2, a3); |
| 139 | } | 135 | } |
| @@ -146,8 +142,7 @@ int sign_extend_temp; | |||
| 146 | /* On a few machines, XINT can only be done by calling this. */ | 142 | /* On a few machines, XINT can only be done by calling this. */ |
| 147 | 143 | ||
| 148 | int | 144 | int |
| 149 | sign_extend_lisp_int (num) | 145 | sign_extend_lisp_int (EMACS_INT num) |
| 150 | EMACS_INT num; | ||
| 151 | { | 146 | { |
| 152 | if (num & (((EMACS_INT) 1) << (VALBITS - 1))) | 147 | if (num & (((EMACS_INT) 1) << (VALBITS - 1))) |
| 153 | return num | (((EMACS_INT) (-1)) << VALBITS); | 148 | return num | (((EMACS_INT) (-1)) << VALBITS); |
| @@ -840,8 +835,7 @@ Value, if non-nil, is a list \(interactive SPEC). */) | |||
| 840 | indirections contains a loop. */ | 835 | indirections contains a loop. */ |
| 841 | 836 | ||
| 842 | struct Lisp_Symbol * | 837 | struct Lisp_Symbol * |
| 843 | indirect_variable (symbol) | 838 | indirect_variable (struct Lisp_Symbol *symbol) |
| 844 | struct Lisp_Symbol *symbol; | ||
| 845 | { | 839 | { |
| 846 | struct Lisp_Symbol *tortoise, *hare; | 840 | struct Lisp_Symbol *tortoise, *hare; |
| 847 | 841 | ||
| @@ -892,8 +886,7 @@ variable chain of symbols. */) | |||
| 892 | ((blv)->forwarded ? do_symval_forwarding (BLV_FWD (blv)) : BLV_VALUE (blv)) | 886 | ((blv)->forwarded ? do_symval_forwarding (BLV_FWD (blv)) : BLV_VALUE (blv)) |
| 893 | 887 | ||
| 894 | Lisp_Object | 888 | Lisp_Object |
| 895 | do_symval_forwarding (valcontents) | 889 | do_symval_forwarding (register union Lisp_Fwd *valcontents) |
| 896 | register union Lisp_Fwd *valcontents; | ||
| 897 | { | 890 | { |
| 898 | register Lisp_Object val; | 891 | register Lisp_Object val; |
| 899 | switch (XFWDTYPE (valcontents)) | 892 | switch (XFWDTYPE (valcontents)) |
| @@ -947,11 +940,11 @@ do_symval_forwarding (valcontents) | |||
| 947 | } while (0) | 940 | } while (0) |
| 948 | 941 | ||
| 949 | static void | 942 | static void |
| 950 | store_symval_forwarding (/* symbol, */ valcontents, newval, buf) | 943 | store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newval, struct buffer *buf) |
| 951 | /* struct Lisp_Symbol *symbol; */ | 944 | /* struct Lisp_Symbol *symbol; */ |
| 952 | union Lisp_Fwd *valcontents; | 945 | |
| 953 | register Lisp_Object newval; | 946 | |
| 954 | struct buffer *buf; | 947 | |
| 955 | { | 948 | { |
| 956 | switch (XFWDTYPE (valcontents)) | 949 | switch (XFWDTYPE (valcontents)) |
| 957 | { | 950 | { |
| @@ -1032,8 +1025,7 @@ store_symval_forwarding (/* symbol, */ valcontents, newval, buf) | |||
| 1032 | This makes it safe to alter the status of other bindings. */ | 1025 | This makes it safe to alter the status of other bindings. */ |
| 1033 | 1026 | ||
| 1034 | void | 1027 | void |
| 1035 | swap_in_global_binding (symbol) | 1028 | swap_in_global_binding (struct Lisp_Symbol *symbol) |
| 1036 | struct Lisp_Symbol *symbol; | ||
| 1037 | { | 1029 | { |
| 1038 | struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (symbol); | 1030 | struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (symbol); |
| 1039 | 1031 | ||
| @@ -1059,9 +1051,7 @@ swap_in_global_binding (symbol) | |||
| 1059 | This could be another forwarding pointer. */ | 1051 | This could be another forwarding pointer. */ |
| 1060 | 1052 | ||
| 1061 | static void | 1053 | static void |
| 1062 | swap_in_symval_forwarding (symbol, blv) | 1054 | swap_in_symval_forwarding (struct Lisp_Symbol *symbol, struct Lisp_Buffer_Local_Value *blv) |
| 1063 | struct Lisp_Symbol *symbol; | ||
| 1064 | struct Lisp_Buffer_Local_Value *blv; | ||
| 1065 | { | 1055 | { |
| 1066 | register Lisp_Object tem1; | 1056 | register Lisp_Object tem1; |
| 1067 | 1057 | ||
| @@ -1111,8 +1101,7 @@ swap_in_symval_forwarding (symbol, blv) | |||
| 1111 | within this function. Great care is required for this. */ | 1101 | within this function. Great care is required for this. */ |
| 1112 | 1102 | ||
| 1113 | Lisp_Object | 1103 | Lisp_Object |
| 1114 | find_symbol_value (symbol) | 1104 | find_symbol_value (Lisp_Object symbol) |
| 1115 | Lisp_Object symbol; | ||
| 1116 | { | 1105 | { |
| 1117 | struct Lisp_Symbol *sym; | 1106 | struct Lisp_Symbol *sym; |
| 1118 | 1107 | ||
| @@ -1183,8 +1172,7 @@ let_shadows_buffer_binding_p (struct Lisp_Symbol *symbol) | |||
| 1183 | } | 1172 | } |
| 1184 | 1173 | ||
| 1185 | static int | 1174 | static int |
| 1186 | let_shadows_global_binding_p (symbol) | 1175 | let_shadows_global_binding_p (Lisp_Object symbol) |
| 1187 | Lisp_Object symbol; | ||
| 1188 | { | 1176 | { |
| 1189 | struct specbinding *p; | 1177 | struct specbinding *p; |
| 1190 | 1178 | ||
| @@ -1204,9 +1192,7 @@ let_shadows_global_binding_p (symbol) | |||
| 1204 | If BINDFLAG is nonzero, we don't do that. */ | 1192 | If BINDFLAG is nonzero, we don't do that. */ |
| 1205 | 1193 | ||
| 1206 | void | 1194 | void |
| 1207 | set_internal (symbol, newval, where, bindflag) | 1195 | set_internal (register Lisp_Object symbol, register Lisp_Object newval, register Lisp_Object where, int bindflag) |
| 1208 | register Lisp_Object symbol, newval, where; | ||
| 1209 | int bindflag; | ||
| 1210 | { | 1196 | { |
| 1211 | int voide = EQ (newval, Qunbound); | 1197 | int voide = EQ (newval, Qunbound); |
| 1212 | struct Lisp_Symbol *sym; | 1198 | struct Lisp_Symbol *sym; |
| @@ -1357,8 +1343,7 @@ set_internal (symbol, newval, where, bindflag) | |||
| 1357 | Return Qunbound if it is void. */ | 1343 | Return Qunbound if it is void. */ |
| 1358 | 1344 | ||
| 1359 | Lisp_Object | 1345 | Lisp_Object |
| 1360 | default_value (symbol) | 1346 | default_value (Lisp_Object symbol) |
| 1361 | Lisp_Object symbol; | ||
| 1362 | { | 1347 | { |
| 1363 | struct Lisp_Symbol *sym; | 1348 | struct Lisp_Symbol *sym; |
| 1364 | 1349 | ||
| @@ -2109,8 +2094,7 @@ selected frame's terminal device). */) | |||
| 2109 | This is like Findirect_function, except that it doesn't signal an | 2094 | This is like Findirect_function, except that it doesn't signal an |
| 2110 | error if the chain ends up unbound. */ | 2095 | error if the chain ends up unbound. */ |
| 2111 | Lisp_Object | 2096 | Lisp_Object |
| 2112 | indirect_function (object) | 2097 | indirect_function (register Lisp_Object object) |
| 2113 | register Lisp_Object object; | ||
| 2114 | { | 2098 | { |
| 2115 | Lisp_Object tortoise, hare; | 2099 | Lisp_Object tortoise, hare; |
| 2116 | 2100 | ||
| @@ -2326,9 +2310,7 @@ bool-vector. IDX starts at 0. */) | |||
| 2326 | enum comparison { equal, notequal, less, grtr, less_or_equal, grtr_or_equal }; | 2310 | enum comparison { equal, notequal, less, grtr, less_or_equal, grtr_or_equal }; |
| 2327 | 2311 | ||
| 2328 | Lisp_Object | 2312 | Lisp_Object |
| 2329 | arithcompare (num1, num2, comparison) | 2313 | arithcompare (Lisp_Object num1, Lisp_Object num2, enum comparison comparison) |
| 2330 | Lisp_Object num1, num2; | ||
| 2331 | enum comparison comparison; | ||
| 2332 | { | 2314 | { |
| 2333 | double f1 = 0, f2 = 0; | 2315 | double f1 = 0, f2 = 0; |
| 2334 | int floatp = 0; | 2316 | int floatp = 0; |
| @@ -2454,8 +2436,7 @@ DEFUN ("zerop", Fzerop, Szerop, 1, 1, 0, | |||
| 2454 | when the value fits in one. */ | 2436 | when the value fits in one. */ |
| 2455 | 2437 | ||
| 2456 | Lisp_Object | 2438 | Lisp_Object |
| 2457 | long_to_cons (i) | 2439 | long_to_cons (long unsigned int i) |
| 2458 | unsigned long i; | ||
| 2459 | { | 2440 | { |
| 2460 | unsigned long top = i >> 16; | 2441 | unsigned long top = i >> 16; |
| 2461 | unsigned int bot = i & 0xFFFF; | 2442 | unsigned int bot = i & 0xFFFF; |
| @@ -2467,8 +2448,7 @@ long_to_cons (i) | |||
| 2467 | } | 2448 | } |
| 2468 | 2449 | ||
| 2469 | unsigned long | 2450 | unsigned long |
| 2470 | cons_to_long (c) | 2451 | cons_to_long (Lisp_Object c) |
| 2471 | Lisp_Object c; | ||
| 2472 | { | 2452 | { |
| 2473 | Lisp_Object top, bot; | 2453 | Lisp_Object top, bot; |
| 2474 | if (INTEGERP (c)) | 2454 | if (INTEGERP (c)) |
| @@ -2509,8 +2489,7 @@ NUMBER may be an integer or a floating point number. */) | |||
| 2509 | } | 2489 | } |
| 2510 | 2490 | ||
| 2511 | INLINE static int | 2491 | INLINE static int |
| 2512 | digit_to_number (character, base) | 2492 | digit_to_number (int character, int base) |
| 2513 | int character, base; | ||
| 2514 | { | 2493 | { |
| 2515 | int digit; | 2494 | int digit; |
| 2516 | 2495 | ||
| @@ -2610,10 +2589,7 @@ static Lisp_Object float_arith_driver (double, int, enum arithop, | |||
| 2610 | extern Lisp_Object fmod_float (); | 2589 | extern Lisp_Object fmod_float (); |
| 2611 | 2590 | ||
| 2612 | Lisp_Object | 2591 | Lisp_Object |
| 2613 | arith_driver (code, nargs, args) | 2592 | arith_driver (enum arithop code, int nargs, register Lisp_Object *args) |
| 2614 | enum arithop code; | ||
| 2615 | int nargs; | ||
| 2616 | register Lisp_Object *args; | ||
| 2617 | { | 2593 | { |
| 2618 | register Lisp_Object val; | 2594 | register Lisp_Object val; |
| 2619 | register int argnum; | 2595 | register int argnum; |
| @@ -2698,12 +2674,7 @@ arith_driver (code, nargs, args) | |||
| 2698 | #define isnan(x) ((x) != (x)) | 2674 | #define isnan(x) ((x) != (x)) |
| 2699 | 2675 | ||
| 2700 | static Lisp_Object | 2676 | static Lisp_Object |
| 2701 | float_arith_driver (accum, argnum, code, nargs, args) | 2677 | float_arith_driver (double accum, register int argnum, enum arithop code, int nargs, register Lisp_Object *args) |
| 2702 | double accum; | ||
| 2703 | register int argnum; | ||
| 2704 | enum arithop code; | ||
| 2705 | int nargs; | ||
| 2706 | register Lisp_Object *args; | ||
| 2707 | { | 2678 | { |
| 2708 | register Lisp_Object val; | 2679 | register Lisp_Object val; |
| 2709 | double next; | 2680 | double next; |
| @@ -3038,7 +3009,7 @@ lowercase l) for small endian machines. */) | |||
| 3038 | 3009 | ||
| 3039 | 3010 | ||
| 3040 | void | 3011 | void |
| 3041 | syms_of_data () | 3012 | syms_of_data (void) |
| 3042 | { | 3013 | { |
| 3043 | Lisp_Object error_tail, arith_tail; | 3014 | Lisp_Object error_tail, arith_tail; |
| 3044 | 3015 | ||
| @@ -3467,8 +3438,7 @@ syms_of_data () | |||
| 3467 | } | 3438 | } |
| 3468 | 3439 | ||
| 3469 | SIGTYPE | 3440 | SIGTYPE |
| 3470 | arith_error (signo) | 3441 | arith_error (int signo) |
| 3471 | int signo; | ||
| 3472 | { | 3442 | { |
| 3473 | sigsetmask (SIGEMPTYMASK); | 3443 | sigsetmask (SIGEMPTYMASK); |
| 3474 | 3444 | ||
| @@ -3477,7 +3447,7 @@ arith_error (signo) | |||
| 3477 | } | 3447 | } |
| 3478 | 3448 | ||
| 3479 | void | 3449 | void |
| 3480 | init_data () | 3450 | init_data (void) |
| 3481 | { | 3451 | { |
| 3482 | /* Don't do this if just dumping out. | 3452 | /* Don't do this if just dumping out. |
| 3483 | We don't want to call `signal' in this case | 3453 | We don't want to call `signal' in this case |