summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-03-09 17:28:06 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2011-03-09 17:28:06 -0800
commit7e3ab3026e9b0f783b8aacead1fad668c792e8ab (patch)
tree572dc8843e38136cf7845f29ea125355d785417b
parent06b0c8a0ddcb60b00fcf60a3dcd8b7193bca3cc7 (diff)
downloademacs-7e3ab3026e9b0f783b8aacead1fad668c792e8ab.tar.gz
emacs-7e3ab3026e9b0f783b8aacead1fad668c792e8ab.tar.bz2
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.
-rw-r--r--src/ChangeLog7
-rw-r--r--src/lisp.h15
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 <eggert@cs.ucla.edu>
+ * 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 <eggert@cs.ucla.edu>
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))