From 7e3ab3026e9b0f783b8aacead1fad668c792e8ab Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 9 Mar 2011 17:28:06 -0800 Subject: [PATCH] * 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. --- src/ChangeLog | 7 +++++++ 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 @@ 2011-03-10 Paul Eggert + * 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. * xfns.c (x_decode_color, x_set_name, x_window): Now static. (Fx_create_frame): Add braces to silence GCC warning. (Fx_file_dialog, Fx_select_font): Fix pointer signedness. (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame): Remove unused locals. + (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. 2011-03-09 Paul Eggert 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 || GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS) +#define GCPRO1(varname) GCPRO1_VAR (varname, gcpro1) +#define UNGCPRO UNGCPRO_VAR (gcpro1) + #if GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS /* Do something silly with gcproN vars just so gcc shuts up. */ /* You get warnings from MIPSPro... */ -#define GCPRO1(varname) ((void) gcpro1) +#define GCPRO1_VAR(varname, gcpro1) ((void) gcpro1) #define GCPRO2(varname1, varname2)(((void) gcpro2, (void) gcpro1)) #define GCPRO3(varname1, varname2, varname3) \ (((void) gcpro3, (void) gcpro2, (void) gcpro1)) @@ -2165,13 +2168,13 @@ struct gcpro (((void) gcpro5, (void) gcpro4, (void) gcpro3, (void) gcpro2, (void) gcpro1)) #define GCPRO6(varname1, varname2, varname3, varname4, varname5, varname6) \ (((void) gcpro6, (void) gcpro5, (void) gcpro4, (void) gcpro3, (void) gcpro2, (void) gcpro1)) -#define UNGCPRO ((void) 0) +#define UNGCPRO_VAR(gcpro1) ((void) 0) #else /* GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS */ #ifndef DEBUG_GCPRO -#define GCPRO1(varname) \ +#define GCPRO1_VAR(varname, gcpro1) \ {gcpro1.next = gcprolist; gcpro1.var = &varname; gcpro1.nvars = 1; \ gcprolist = &gcpro1; } @@ -2210,13 +2213,13 @@ struct gcpro gcpro6.next = &gcpro5; gcpro6.var = &varname6; gcpro6.nvars = 1; \ gcprolist = &gcpro6; } -#define UNGCPRO (gcprolist = gcpro1.next) +#define UNGCPRO_VAR(gcpro1) (gcprolist = gcpro1.next) #else extern int gcpro_level; -#define GCPRO1(varname) \ +#define GCPRO1_VAR(varname, gcpro1) \ {gcpro1.next = gcprolist; gcpro1.var = &varname; gcpro1.nvars = 1; \ gcpro1.level = gcpro_level++; \ gcprolist = &gcpro1; } @@ -2266,7 +2269,7 @@ extern int gcpro_level; gcpro6.level = gcpro_level++; \ gcprolist = &gcpro6; } -#define UNGCPRO \ +#define UNGCPRO_VAR(gcpro1) \ ((--gcpro_level != gcpro1.level) \ ? (abort (), 0) \ : ((gcprolist = gcpro1.next), 0)) -- 2.39.5