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/data.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/data.c')
| -rw-r--r-- | src/data.c | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/src/data.c b/src/data.c index d0afca6a09f..01aafbcede4 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -805,7 +805,10 @@ variable chain of symbols. */) | |||
| 805 | (Lisp_Object object) | 805 | (Lisp_Object object) |
| 806 | { | 806 | { |
| 807 | if (SYMBOLP (object)) | 807 | if (SYMBOLP (object)) |
| 808 | XSETSYMBOL (object, indirect_variable (XSYMBOL (object))); | 808 | { |
| 809 | struct Lisp_Symbol *sym = indirect_variable (XSYMBOL (object)); | ||
| 810 | XSETSYMBOL (object, sym); | ||
| 811 | } | ||
| 809 | return object; | 812 | return object; |
| 810 | } | 813 | } |
| 811 | 814 | ||
| @@ -815,9 +818,6 @@ variable chain of symbols. */) | |||
| 815 | This does not handle buffer-local variables; use | 818 | This does not handle buffer-local variables; use |
| 816 | swap_in_symval_forwarding for that. */ | 819 | swap_in_symval_forwarding for that. */ |
| 817 | 820 | ||
| 818 | #define do_blv_forwarding(blv) \ | ||
| 819 | ((blv)->forwarded ? do_symval_forwarding (BLV_FWD (blv)) : BLV_VALUE (blv)) | ||
| 820 | |||
| 821 | Lisp_Object | 821 | Lisp_Object |
| 822 | do_symval_forwarding (register union Lisp_Fwd *valcontents) | 822 | do_symval_forwarding (register union Lisp_Fwd *valcontents) |
| 823 | { | 823 | { |
| @@ -864,14 +864,6 @@ do_symval_forwarding (register union Lisp_Fwd *valcontents) | |||
| 864 | BUF non-zero means set the value in buffer BUF instead of the | 864 | BUF non-zero means set the value in buffer BUF instead of the |
| 865 | current buffer. This only plays a role for per-buffer variables. */ | 865 | current buffer. This only plays a role for per-buffer variables. */ |
| 866 | 866 | ||
| 867 | #define store_blv_forwarding(blv, newval, buf) \ | ||
| 868 | do { \ | ||
| 869 | if ((blv)->forwarded) \ | ||
| 870 | store_symval_forwarding (BLV_FWD (blv), (newval), (buf)); \ | ||
| 871 | else \ | ||
| 872 | SET_BLV_VALUE (blv, newval); \ | ||
| 873 | } while (0) | ||
| 874 | |||
| 875 | static void | 867 | static void |
| 876 | store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newval, struct buffer *buf) | 868 | store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newval, struct buffer *buf) |
| 877 | { | 869 | { |
| @@ -907,12 +899,12 @@ store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newva | |||
| 907 | 899 | ||
| 908 | for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) | 900 | for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) |
| 909 | { | 901 | { |
| 910 | Lisp_Object buf; | 902 | Lisp_Object lbuf; |
| 911 | struct buffer *b; | 903 | struct buffer *b; |
| 912 | 904 | ||
| 913 | buf = Fcdr (XCAR (tail)); | 905 | lbuf = Fcdr (XCAR (tail)); |
| 914 | if (!BUFFERP (buf)) continue; | 906 | if (!BUFFERP (lbuf)) continue; |
| 915 | b = XBUFFER (buf); | 907 | b = XBUFFER (lbuf); |
| 916 | 908 | ||
| 917 | if (! PER_BUFFER_VALUE_P (b, idx)) | 909 | if (! PER_BUFFER_VALUE_P (b, idx)) |
| 918 | PER_BUFFER_VALUE (b, offset) = newval; | 910 | PER_BUFFER_VALUE (b, offset) = newval; |
| @@ -1269,7 +1261,7 @@ set_internal (register Lisp_Object symbol, register Lisp_Object newval, register | |||
| 1269 | /* Return the default value of SYMBOL, but don't check for voidness. | 1261 | /* Return the default value of SYMBOL, but don't check for voidness. |
| 1270 | Return Qunbound if it is void. */ | 1262 | Return Qunbound if it is void. */ |
| 1271 | 1263 | ||
| 1272 | Lisp_Object | 1264 | static Lisp_Object |
| 1273 | default_value (Lisp_Object symbol) | 1265 | default_value (Lisp_Object symbol) |
| 1274 | { | 1266 | { |
| 1275 | struct Lisp_Symbol *sym; | 1267 | struct Lisp_Symbol *sym; |
| @@ -1503,8 +1495,8 @@ The function `default-value' gets the default value and `set-default' sets it. | |||
| 1503 | { | 1495 | { |
| 1504 | struct Lisp_Symbol *sym; | 1496 | struct Lisp_Symbol *sym; |
| 1505 | struct Lisp_Buffer_Local_Value *blv = NULL; | 1497 | struct Lisp_Buffer_Local_Value *blv = NULL; |
| 1506 | union Lisp_Val_Fwd valcontents; | 1498 | union Lisp_Val_Fwd valcontents IF_LINT (= {0}); |
| 1507 | int forwarded; | 1499 | int forwarded IF_LINT (= 0); |
| 1508 | 1500 | ||
| 1509 | CHECK_SYMBOL (variable); | 1501 | CHECK_SYMBOL (variable); |
| 1510 | sym = XSYMBOL (variable); | 1502 | sym = XSYMBOL (variable); |
| @@ -1579,8 +1571,8 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */) | |||
| 1579 | (register Lisp_Object variable) | 1571 | (register Lisp_Object variable) |
| 1580 | { | 1572 | { |
| 1581 | register Lisp_Object tem; | 1573 | register Lisp_Object tem; |
| 1582 | int forwarded; | 1574 | int forwarded IF_LINT (= 0); |
| 1583 | union Lisp_Val_Fwd valcontents; | 1575 | union Lisp_Val_Fwd valcontents IF_LINT (= {0}); |
| 1584 | struct Lisp_Symbol *sym; | 1576 | struct Lisp_Symbol *sym; |
| 1585 | struct Lisp_Buffer_Local_Value *blv = NULL; | 1577 | struct Lisp_Buffer_Local_Value *blv = NULL; |
| 1586 | 1578 | ||
| @@ -2216,7 +2208,7 @@ bool-vector. IDX starts at 0. */) | |||
| 2216 | 2208 | ||
| 2217 | enum comparison { equal, notequal, less, grtr, less_or_equal, grtr_or_equal }; | 2209 | enum comparison { equal, notequal, less, grtr, less_or_equal, grtr_or_equal }; |
| 2218 | 2210 | ||
| 2219 | Lisp_Object | 2211 | static Lisp_Object |
| 2220 | arithcompare (Lisp_Object num1, Lisp_Object num2, enum comparison comparison) | 2212 | arithcompare (Lisp_Object num1, Lisp_Object num2, enum comparison comparison) |
| 2221 | { | 2213 | { |
| 2222 | double f1 = 0, f2 = 0; | 2214 | double f1 = 0, f2 = 0; |
| @@ -2484,7 +2476,7 @@ enum arithop | |||
| 2484 | 2476 | ||
| 2485 | static Lisp_Object float_arith_driver (double, int, enum arithop, | 2477 | static Lisp_Object float_arith_driver (double, int, enum arithop, |
| 2486 | int, Lisp_Object *); | 2478 | int, Lisp_Object *); |
| 2487 | Lisp_Object | 2479 | static Lisp_Object |
| 2488 | arith_driver (enum arithop code, int nargs, register Lisp_Object *args) | 2480 | arith_driver (enum arithop code, int nargs, register Lisp_Object *args) |
| 2489 | { | 2481 | { |
| 2490 | register Lisp_Object val; | 2482 | register Lisp_Object val; |
| @@ -3308,7 +3300,7 @@ syms_of_data (void) | |||
| 3308 | XSYMBOL (intern_c_string ("most-negative-fixnum"))->constant = 1; | 3300 | XSYMBOL (intern_c_string ("most-negative-fixnum"))->constant = 1; |
| 3309 | } | 3301 | } |
| 3310 | 3302 | ||
| 3311 | SIGTYPE | 3303 | static SIGTYPE |
| 3312 | arith_error (int signo) | 3304 | arith_error (int signo) |
| 3313 | { | 3305 | { |
| 3314 | sigsetmask (SIGEMPTYMASK); | 3306 | sigsetmask (SIGEMPTYMASK); |