diff options
| author | Paul Eggert | 2011-03-17 09:51:42 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-03-17 09:51:42 -0700 |
| commit | a3a6c54ec72118e8d22d2ecd608df5193c8926a3 (patch) | |
| tree | de018428bd736fd37ec25ac07152199664d3f08b /src/eval.c | |
| parent | d6cd56f187a791983579bf5d4ce3702d2ddf2499 (diff) | |
| parent | b1d876f1a19ae65c8a8dd61c4ce17055ca53f16c (diff) | |
| download | emacs-a3a6c54ec72118e8d22d2ecd608df5193c8926a3.tar.gz emacs-a3a6c54ec72118e8d22d2ecd608df5193c8926a3.zip | |
Merge: Fix more problems found by GCC 4.5.2's static checks.
Diffstat (limited to 'src/eval.c')
| -rw-r--r-- | src/eval.c | 61 |
1 files changed, 32 insertions, 29 deletions
diff --git a/src/eval.c b/src/eval.c index d0effc755a2..f68274e6e8c 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -158,7 +158,7 @@ restore_stack_limits (Lisp_Object data) | |||
| 158 | 158 | ||
| 159 | /* Call the Lisp debugger, giving it argument ARG. */ | 159 | /* Call the Lisp debugger, giving it argument ARG. */ |
| 160 | 160 | ||
| 161 | Lisp_Object | 161 | static Lisp_Object |
| 162 | call_debugger (Lisp_Object arg) | 162 | call_debugger (Lisp_Object arg) |
| 163 | { | 163 | { |
| 164 | int debug_while_redisplaying; | 164 | int debug_while_redisplaying; |
| @@ -214,7 +214,7 @@ call_debugger (Lisp_Object arg) | |||
| 214 | return unbind_to (count, val); | 214 | return unbind_to (count, val); |
| 215 | } | 215 | } |
| 216 | 216 | ||
| 217 | void | 217 | static void |
| 218 | do_debug_on_call (Lisp_Object code) | 218 | do_debug_on_call (Lisp_Object code) |
| 219 | { | 219 | { |
| 220 | debug_on_next_call = 0; | 220 | debug_on_next_call = 0; |
| @@ -764,11 +764,11 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) | |||
| 764 | if (SYMBOL_CONSTANT_P (sym)) | 764 | if (SYMBOL_CONSTANT_P (sym)) |
| 765 | { | 765 | { |
| 766 | /* For upward compatibility, allow (defvar :foo (quote :foo)). */ | 766 | /* For upward compatibility, allow (defvar :foo (quote :foo)). */ |
| 767 | Lisp_Object tem = Fcar (tail); | 767 | Lisp_Object tem1 = Fcar (tail); |
| 768 | if (! (CONSP (tem) | 768 | if (! (CONSP (tem1) |
| 769 | && EQ (XCAR (tem), Qquote) | 769 | && EQ (XCAR (tem1), Qquote) |
| 770 | && CONSP (XCDR (tem)) | 770 | && CONSP (XCDR (tem1)) |
| 771 | && EQ (XCAR (XCDR (tem)), sym))) | 771 | && EQ (XCAR (XCDR (tem1)), sym))) |
| 772 | error ("Constant symbol `%s' specified in defvar", | 772 | error ("Constant symbol `%s' specified in defvar", |
| 773 | SDATA (SYMBOL_NAME (sym))); | 773 | SDATA (SYMBOL_NAME (sym))); |
| 774 | } | 774 | } |
| @@ -801,10 +801,11 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) | |||
| 801 | LOADHIST_ATTACH (sym); | 801 | LOADHIST_ATTACH (sym); |
| 802 | } | 802 | } |
| 803 | else | 803 | else |
| 804 | /* Simple (defvar <var>) should not count as a definition at all. | 804 | { |
| 805 | It could get in the way of other definitions, and unloading this | 805 | /* Simple (defvar <var>) should not count as a definition at all. |
| 806 | package could try to make the variable unbound. */ | 806 | It could get in the way of other definitions, and unloading this |
| 807 | ; | 807 | package could try to make the variable unbound. */ |
| 808 | } | ||
| 808 | 809 | ||
| 809 | return sym; | 810 | return sym; |
| 810 | } | 811 | } |
| @@ -855,7 +856,8 @@ user_variable_p_eh (Lisp_Object ignore) | |||
| 855 | static Lisp_Object | 856 | static Lisp_Object |
| 856 | lisp_indirect_variable (Lisp_Object sym) | 857 | lisp_indirect_variable (Lisp_Object sym) |
| 857 | { | 858 | { |
| 858 | XSETSYMBOL (sym, indirect_variable (XSYMBOL (sym))); | 859 | struct Lisp_Symbol *s = indirect_variable (XSYMBOL (sym)); |
| 860 | XSETSYMBOL (sym, s); | ||
| 859 | return sym; | 861 | return sym; |
| 860 | } | 862 | } |
| 861 | 863 | ||
| @@ -1637,7 +1639,7 @@ See also the function `condition-case'. */) | |||
| 1637 | if (!NILP (clause)) | 1639 | if (!NILP (clause)) |
| 1638 | break; | 1640 | break; |
| 1639 | } | 1641 | } |
| 1640 | 1642 | ||
| 1641 | if (/* Don't run the debugger for a memory-full error. | 1643 | if (/* Don't run the debugger for a memory-full error. |
| 1642 | (There is no room in memory to do that!) */ | 1644 | (There is no room in memory to do that!) */ |
| 1643 | !NILP (error_symbol) | 1645 | !NILP (error_symbol) |
| @@ -1654,13 +1656,13 @@ See also the function `condition-case'. */) | |||
| 1654 | can continue code which has signaled a quit. */ | 1656 | can continue code which has signaled a quit. */ |
| 1655 | if (debugger_called && EQ (real_error_symbol, Qquit)) | 1657 | if (debugger_called && EQ (real_error_symbol, Qquit)) |
| 1656 | return Qnil; | 1658 | return Qnil; |
| 1657 | } | 1659 | } |
| 1658 | 1660 | ||
| 1659 | if (!NILP (clause)) | 1661 | if (!NILP (clause)) |
| 1660 | { | 1662 | { |
| 1661 | Lisp_Object unwind_data | 1663 | Lisp_Object unwind_data |
| 1662 | = (NILP (error_symbol) ? data : Fcons (error_symbol, data)); | 1664 | = (NILP (error_symbol) ? data : Fcons (error_symbol, data)); |
| 1663 | 1665 | ||
| 1664 | h->chosen_clause = clause; | 1666 | h->chosen_clause = clause; |
| 1665 | unwind_to_catch (h->tag, unwind_data); | 1667 | unwind_to_catch (h->tag, unwind_data); |
| 1666 | } | 1668 | } |
| @@ -1672,7 +1674,7 @@ See also the function `condition-case'. */) | |||
| 1672 | 1674 | ||
| 1673 | if (! NILP (error_symbol)) | 1675 | if (! NILP (error_symbol)) |
| 1674 | data = Fcons (error_symbol, data); | 1676 | data = Fcons (error_symbol, data); |
| 1675 | 1677 | ||
| 1676 | string = Ferror_message_string (data); | 1678 | string = Ferror_message_string (data); |
| 1677 | fatal ("%s", SDATA (string), 0); | 1679 | fatal ("%s", SDATA (string), 0); |
| 1678 | } | 1680 | } |
| @@ -2537,8 +2539,8 @@ run_hook_with_args (int nargs, Lisp_Object *args, enum run_hooks_condition cond) | |||
| 2537 | } | 2539 | } |
| 2538 | else | 2540 | else |
| 2539 | { | 2541 | { |
| 2540 | Lisp_Object globals = Qnil; | 2542 | Lisp_Object global_vals = Qnil; |
| 2541 | GCPRO3 (sym, val, globals); | 2543 | GCPRO3 (sym, val, global_vals); |
| 2542 | 2544 | ||
| 2543 | for (; | 2545 | for (; |
| 2544 | CONSP (val) && ((cond == to_completion) | 2546 | CONSP (val) && ((cond == to_completion) |
| @@ -2550,23 +2552,25 @@ run_hook_with_args (int nargs, Lisp_Object *args, enum run_hooks_condition cond) | |||
| 2550 | { | 2552 | { |
| 2551 | /* t indicates this hook has a local binding; | 2553 | /* t indicates this hook has a local binding; |
| 2552 | it means to run the global binding too. */ | 2554 | it means to run the global binding too. */ |
| 2553 | globals = Fdefault_value (sym); | 2555 | global_vals = Fdefault_value (sym); |
| 2554 | if (NILP (globals)) continue; | 2556 | if (NILP (global_vals)) continue; |
| 2555 | 2557 | ||
| 2556 | if (!CONSP (globals) || EQ (XCAR (globals), Qlambda)) | 2558 | if (!CONSP (global_vals) || EQ (XCAR (global_vals), Qlambda)) |
| 2557 | { | 2559 | { |
| 2558 | args[0] = globals; | 2560 | args[0] = global_vals; |
| 2559 | ret = Ffuncall (nargs, args); | 2561 | ret = Ffuncall (nargs, args); |
| 2560 | } | 2562 | } |
| 2561 | else | 2563 | else |
| 2562 | { | 2564 | { |
| 2563 | for (; | 2565 | for (; |
| 2564 | CONSP (globals) && ((cond == to_completion) | 2566 | (CONSP (global_vals) |
| 2565 | || (cond == until_success ? NILP (ret) | 2567 | && (cond == to_completion |
| 2566 | : !NILP (ret))); | 2568 | || (cond == until_success |
| 2567 | globals = XCDR (globals)) | 2569 | ? NILP (ret) |
| 2570 | : !NILP (ret)))); | ||
| 2571 | global_vals = XCDR (global_vals)) | ||
| 2568 | { | 2572 | { |
| 2569 | args[0] = XCAR (globals); | 2573 | args[0] = XCAR (global_vals); |
| 2570 | /* In a global value, t should not occur. If it does, we | 2574 | /* In a global value, t should not occur. If it does, we |
| 2571 | must ignore it to avoid an endless loop. */ | 2575 | must ignore it to avoid an endless loop. */ |
| 2572 | if (!EQ (args[0], Qt)) | 2576 | if (!EQ (args[0], Qt)) |
| @@ -3057,7 +3061,7 @@ DEFUN ("fetch-bytecode", Ffetch_bytecode, Sfetch_bytecode, | |||
| 3057 | return object; | 3061 | return object; |
| 3058 | } | 3062 | } |
| 3059 | 3063 | ||
| 3060 | void | 3064 | static void |
| 3061 | grow_specpdl (void) | 3065 | grow_specpdl (void) |
| 3062 | { | 3066 | { |
| 3063 | register int count = SPECPDL_INDEX (); | 3067 | register int count = SPECPDL_INDEX (); |
| @@ -3589,4 +3593,3 @@ The value the function returns is not used. */); | |||
| 3589 | defsubr (&Sbacktrace); | 3593 | defsubr (&Sbacktrace); |
| 3590 | defsubr (&Sbacktrace_frame); | 3594 | defsubr (&Sbacktrace_frame); |
| 3591 | } | 3595 | } |
| 3592 | |||