Commit dbf31225 authored by Paul Eggert's avatar Paul Eggert

Remove GCPRO-related macros that exist only to avoid shadowing locals.

* lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
(GCPRO6_VAR, UNGCPRO_VAR): Remove.  See
<http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
All uses changed to use GCPRO1 etc.
(GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
Revert to old implementation (i.e., before 2011-03-11).
parent e95def75
2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
Remove GCPRO-related macros that exist only to avoid shadowing locals.
* lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
(GCPRO6_VAR, UNGCPRO_VAR): Remove. See
<http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
All uses changed to use GCPRO1 etc.
(GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
Revert to old implementation (i.e., before 2011-03-11).
2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* dispnew.c (scrolling_window): Truncate overlaps in copy destination
......
......@@ -229,11 +229,11 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object m
int len;
int wanted = 0;
Lisp_Object name, finalname;
struct gcpro inner_gcpro1, inner_gcpro2;
struct gcpro gcpro1, gcpro2;
len = NAMLEN (dp);
name = finalname = make_unibyte_string (dp->d_name, len);
GCPRO2_VAR (finalname, name, inner_gcpro);
GCPRO2 (finalname, name);
/* Note: DECODE_FILE can GC; it should protect its argument,
though. */
......@@ -289,23 +289,23 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, Lisp_Object m
/* Construct an expanded filename for the directory entry.
Use the decoded names for input to Ffile_attributes. */
Lisp_Object decoded_fullname, fileattrs;
struct gcpro innermost_gcpro1, innermost_gcpro2;
struct gcpro gcpro1, gcpro2;
decoded_fullname = fileattrs = Qnil;
GCPRO2_VAR (decoded_fullname, fileattrs, innermost_gcpro);
GCPRO2 (decoded_fullname, fileattrs);
/* Both Fexpand_file_name and Ffile_attributes can GC. */
decoded_fullname = Fexpand_file_name (name, directory);
fileattrs = Ffile_attributes (decoded_fullname, id_format);
list = Fcons (Fcons (finalname, fileattrs), list);
UNGCPRO_VAR (innermost_gcpro);
UNGCPRO;
}
else
list = Fcons (finalname, list);
}
UNGCPRO_VAR (inner_gcpro);
UNGCPRO;
}
}
......@@ -673,11 +673,11 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v
if (!NILP (predicate))
{
Lisp_Object val;
struct gcpro inner_gcpro1;
struct gcpro gcpro1;
GCPRO1_VAR (name, inner_gcpro);
GCPRO1 (name);
val = call1 (predicate, name);
UNGCPRO_VAR (inner_gcpro);
UNGCPRO;
if (NILP (val))
continue;
......
......@@ -2998,7 +2998,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
{
Lisp_Object keys;
int key_count, key_count_reset;
struct gcpro inner_gcpro1;
struct gcpro gcpro1;
int count = SPECPDL_INDEX ();
/* Save the echo status. */
......@@ -3026,7 +3026,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
keys = Fcopy_sequence (this_command_keys);
else
keys = Qnil;
GCPRO1_VAR (keys, inner_gcpro);
GCPRO1 (keys);
/* Clear out this_command_keys. */
this_command_key_count = 0;
......@@ -3064,7 +3064,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
if (saved_immediate_echo)
echo_now ();
UNGCPRO_VAR (inner_gcpro);
UNGCPRO;
/* The input method can return no events. */
if (! CONSP (tem))
......@@ -9053,9 +9053,9 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
int junk;
#endif
struct gcpro outer_gcpro1;
struct gcpro gcpro1;
GCPRO1_VAR (fake_prefixed_keys, outer_gcpro);
GCPRO1 (fake_prefixed_keys);
raw_keybuf_count = 0;
last_nonmenu_event = Qnil;
......@@ -9351,7 +9351,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
if (EQ (key, Qt))
{
unbind_to (count, Qnil);
UNGCPRO_VAR (outer_gcpro);
UNGCPRO;
return -1;
}
......@@ -10049,7 +10049,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
add_command_key (keybuf[t]);
}
UNGCPRO_VAR (outer_gcpro);
UNGCPRO;
return t;
}
......
This diff is collapsed.
......@@ -3474,7 +3474,7 @@ usage: (make-network-process &rest ARGS) */)
{
/* Setup coding systems for communicating with the network stream. */
struct gcpro inner_gcpro1;
struct gcpro gcpro1;
/* Qt denotes we have not yet called Ffind_operation_coding_system. */
Lisp_Object coding_systems = Qt;
Lisp_Object fargs[5], val;
......@@ -3502,9 +3502,9 @@ usage: (make-network-process &rest ARGS) */)
{
fargs[0] = Qopen_network_stream, fargs[1] = name,
fargs[2] = buffer, fargs[3] = host, fargs[4] = service;
GCPRO1_VAR (proc, inner_gcpro);
GCPRO1 (proc);
coding_systems = Ffind_operation_coding_system (5, fargs);
UNGCPRO_VAR (inner_gcpro);
UNGCPRO;
}
if (CONSP (coding_systems))
val = XCAR (coding_systems);
......@@ -3535,9 +3535,9 @@ usage: (make-network-process &rest ARGS) */)
{
fargs[0] = Qopen_network_stream, fargs[1] = name,
fargs[2] = buffer, fargs[3] = host, fargs[4] = service;
GCPRO1_VAR (proc, inner_gcpro);
GCPRO1 (proc);
coding_systems = Ffind_operation_coding_system (5, fargs);
UNGCPRO_VAR (inner_gcpro);
UNGCPRO;
}
}
if (CONSP (coding_systems))
......
......@@ -3166,7 +3166,7 @@ This function is an internal primitive--use `make-frame' instead. */)
to get the color reference counts right, so initialize them! */
{
Lisp_Object black;
struct gcpro inner_gcpro1;
struct gcpro gcpro1;
/* Function x_decode_color can signal an error. Make
sure to initialize color slots so that we won't try
......@@ -3179,7 +3179,7 @@ This function is an internal primitive--use `make-frame' instead. */)
f->output_data.x->mouse_pixel = -1;
black = build_string ("black");
GCPRO1_VAR (black, inner_gcpro);
GCPRO1 (black);
FRAME_FOREGROUND_PIXEL (f)
= x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
FRAME_BACKGROUND_PIXEL (f)
......@@ -3192,7 +3192,7 @@ This function is an internal primitive--use `make-frame' instead. */)
= x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
f->output_data.x->mouse_pixel
= x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
UNGCPRO_VAR (inner_gcpro);
UNGCPRO;
}
/* Specify the parent under which to make this X window. */
......@@ -4620,7 +4620,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
to get the color reference counts right, so initialize them! */
{
Lisp_Object black;
struct gcpro inner_gcpro1;
struct gcpro gcpro1;
/* Function x_decode_color can signal an error. Make
sure to initialize color slots so that we won't try
......@@ -4633,7 +4633,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
f->output_data.x->mouse_pixel = -1;
black = build_string ("black");
GCPRO1_VAR (black, inner_gcpro);
GCPRO1 (black);
FRAME_FOREGROUND_PIXEL (f)
= x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
FRAME_BACKGROUND_PIXEL (f)
......@@ -4646,7 +4646,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
= x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
f->output_data.x->mouse_pixel
= x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
UNGCPRO_VAR (inner_gcpro);
UNGCPRO;
}
/* Set the name; the functions to which we pass f expect the name to
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment