diff options
| author | Paul Eggert | 2011-03-09 17:28:06 -0800 |
|---|---|---|
| committer | Paul Eggert | 2011-03-09 17:28:06 -0800 |
| commit | 7e3ab3026e9b0f783b8aacead1fad668c792e8ab (patch) | |
| tree | 572dc8843e38136cf7845f29ea125355d785417b /src | |
| parent | 06b0c8a0ddcb60b00fcf60a3dcd8b7193bca3cc7 (diff) | |
| download | emacs-7e3ab3026e9b0f783b8aacead1fad668c792e8ab.tar.gz emacs-7e3ab3026e9b0f783b8aacead1fad668c792e8ab.zip | |
* lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
so that the caller can use some name other than gcpro1.
(GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
(Fx_create_frame, x_create_tip_frame, Fx_show_tip):
(Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
macros.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/lisp.h | 15 |
2 files changed, 16 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 51724faf9c7..33fa9806be2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,10 +1,17 @@ | |||
| 1 | 2011-03-10 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-03-10 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros, | ||
| 4 | so that the caller can use some name other than gcpro1. | ||
| 5 | (GCPRO1, UNGCPRO): Reimplement in terms of the new macros. | ||
| 3 | * xfns.c (x_decode_color, x_set_name, x_window): Now static. | 6 | * xfns.c (x_decode_color, x_set_name, x_window): Now static. |
| 4 | (Fx_create_frame): Add braces to silence GCC warning. | 7 | (Fx_create_frame): Add braces to silence GCC warning. |
| 5 | (Fx_file_dialog, Fx_select_font): Fix pointer signedness. | 8 | (Fx_file_dialog, Fx_select_font): Fix pointer signedness. |
| 6 | (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame): | 9 | (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame): |
| 7 | Remove unused locals. | 10 | Remove unused locals. |
| 11 | (Fx_create_frame, x_create_tip_frame, Fx_show_tip): | ||
| 12 | (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing. | ||
| 13 | Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR | ||
| 14 | macros. | ||
| 8 | 15 | ||
| 9 | 2011-03-09 Paul Eggert <eggert@cs.ucla.edu> | 16 | 2011-03-09 Paul Eggert <eggert@cs.ucla.edu> |
| 10 | 17 | ||
diff --git a/src/lisp.h b/src/lisp.h index 1e8e01cf91f..fa8cb223a6a 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2150,12 +2150,15 @@ struct gcpro | |||
| 2150 | || GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS) | 2150 | || GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS) |
| 2151 | 2151 | ||
| 2152 | 2152 | ||
| 2153 | #define GCPRO1(varname) GCPRO1_VAR (varname, gcpro1) | ||
| 2154 | #define UNGCPRO UNGCPRO_VAR (gcpro1) | ||
| 2155 | |||
| 2153 | #if GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS | 2156 | #if GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS |
| 2154 | 2157 | ||
| 2155 | /* Do something silly with gcproN vars just so gcc shuts up. */ | 2158 | /* Do something silly with gcproN vars just so gcc shuts up. */ |
| 2156 | /* You get warnings from MIPSPro... */ | 2159 | /* You get warnings from MIPSPro... */ |
| 2157 | 2160 | ||
| 2158 | #define GCPRO1(varname) ((void) gcpro1) | 2161 | #define GCPRO1_VAR(varname, gcpro1) ((void) gcpro1) |
| 2159 | #define GCPRO2(varname1, varname2)(((void) gcpro2, (void) gcpro1)) | 2162 | #define GCPRO2(varname1, varname2)(((void) gcpro2, (void) gcpro1)) |
| 2160 | #define GCPRO3(varname1, varname2, varname3) \ | 2163 | #define GCPRO3(varname1, varname2, varname3) \ |
| 2161 | (((void) gcpro3, (void) gcpro2, (void) gcpro1)) | 2164 | (((void) gcpro3, (void) gcpro2, (void) gcpro1)) |
| @@ -2165,13 +2168,13 @@ struct gcpro | |||
| 2165 | (((void) gcpro5, (void) gcpro4, (void) gcpro3, (void) gcpro2, (void) gcpro1)) | 2168 | (((void) gcpro5, (void) gcpro4, (void) gcpro3, (void) gcpro2, (void) gcpro1)) |
| 2166 | #define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \ | 2169 | #define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \ |
| 2167 | (((void) gcpro6, (void) gcpro5, (void) gcpro4, (void) gcpro3, (void) gcpro2, (void) gcpro1)) | 2170 | (((void) gcpro6, (void) gcpro5, (void) gcpro4, (void) gcpro3, (void) gcpro2, (void) gcpro1)) |
| 2168 | #define UNGCPRO ((void) 0) | 2171 | #define UNGCPRO_VAR(gcpro1) ((void) 0) |
| 2169 | 2172 | ||
| 2170 | #else /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */ | 2173 | #else /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */ |
| 2171 | 2174 | ||
| 2172 | #ifndef DEBUG_GCPRO | 2175 | #ifndef DEBUG_GCPRO |
| 2173 | 2176 | ||
| 2174 | #define GCPRO1(varname) \ | 2177 | #define GCPRO1_VAR(varname, gcpro1) \ |
| 2175 | {gcpro1.next = gcprolist; gcpro1.var = &varname; gcpro1.nvars = 1; \ | 2178 | {gcpro1.next = gcprolist; gcpro1.var = &varname; gcpro1.nvars = 1; \ |
| 2176 | gcprolist = &gcpro1; } | 2179 | gcprolist = &gcpro1; } |
| 2177 | 2180 | ||
| @@ -2210,13 +2213,13 @@ struct gcpro | |||
| 2210 | gcpro6.next = &gcpro5; gcpro6.var = &varname6; gcpro6.nvars = 1; \ | 2213 | gcpro6.next = &gcpro5; gcpro6.var = &varname6; gcpro6.nvars = 1; \ |
| 2211 | gcprolist = &gcpro6; } | 2214 | gcprolist = &gcpro6; } |
| 2212 | 2215 | ||
| 2213 | #define UNGCPRO (gcprolist = gcpro1.next) | 2216 | #define UNGCPRO_VAR(gcpro1) (gcprolist = gcpro1.next) |
| 2214 | 2217 | ||
| 2215 | #else | 2218 | #else |
| 2216 | 2219 | ||
| 2217 | extern int gcpro_level; | 2220 | extern int gcpro_level; |
| 2218 | 2221 | ||
| 2219 | #define GCPRO1(varname) \ | 2222 | #define GCPRO1_VAR(varname, gcpro1) \ |
| 2220 | {gcpro1.next = gcprolist; gcpro1.var = &varname; gcpro1.nvars = 1; \ | 2223 | {gcpro1.next = gcprolist; gcpro1.var = &varname; gcpro1.nvars = 1; \ |
| 2221 | gcpro1.level = gcpro_level++; \ | 2224 | gcpro1.level = gcpro_level++; \ |
| 2222 | gcprolist = &gcpro1; } | 2225 | gcprolist = &gcpro1; } |
| @@ -2266,7 +2269,7 @@ extern int gcpro_level; | |||
| 2266 | gcpro6.level = gcpro_level++; \ | 2269 | gcpro6.level = gcpro_level++; \ |
| 2267 | gcprolist = &gcpro6; } | 2270 | gcprolist = &gcpro6; } |
| 2268 | 2271 | ||
| 2269 | #define UNGCPRO \ | 2272 | #define UNGCPRO_VAR(gcpro1) \ |
| 2270 | ((--gcpro_level != gcpro1.level) \ | 2273 | ((--gcpro_level != gcpro1.level) \ |
| 2271 | ? (abort (), 0) \ | 2274 | ? (abort (), 0) \ |
| 2272 | : ((gcprolist = gcpro1.next), 0)) | 2275 | : ((gcprolist = gcpro1.next), 0)) |