mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-26 15:10:50 -08:00
* lread.c (Fload, readevalloop, read1): Rename locals to avoid shadowing.
This commit is contained in:
parent
a6670b0ba2
commit
0902fe4540
2 changed files with 30 additions and 29 deletions
|
|
@ -4,6 +4,7 @@
|
|||
Rename locals to avoid shadowing.
|
||||
|
||||
* lread.c (read1): Rewrite so as not to use empty "else".
|
||||
(Fload, readevalloop, read1): Rename locals to avoid shadowing.
|
||||
|
||||
* print.c (Fredirect_debugging_output): Fix pointer signedess.
|
||||
|
||||
|
|
|
|||
58
src/lread.c
58
src/lread.c
|
|
@ -1020,10 +1020,10 @@ Return t if the file exists and loads successfully. */)
|
|||
Also, just loading a file recursively is not always an error in
|
||||
the general case; the second load may do something different. */
|
||||
{
|
||||
int count = 0;
|
||||
int load_count = 0;
|
||||
Lisp_Object tem;
|
||||
for (tem = Vloads_in_progress; CONSP (tem); tem = XCDR (tem))
|
||||
if (!NILP (Fequal (found, XCAR (tem))) && (++count > 3))
|
||||
if (!NILP (Fequal (found, XCAR (tem))) && (++load_count > 3))
|
||||
{
|
||||
if (fd >= 0)
|
||||
emacs_close (fd);
|
||||
|
|
@ -1654,8 +1654,8 @@ readevalloop (Lisp_Object readcharfun,
|
|||
to a different value when evaluated. */
|
||||
if (BUFFERP (readcharfun))
|
||||
{
|
||||
struct buffer *b = XBUFFER (readcharfun);
|
||||
if (BUF_PT (b) == BUF_ZV (b))
|
||||
struct buffer *buf = XBUFFER (readcharfun);
|
||||
if (BUF_PT (buf) == BUF_ZV (buf))
|
||||
continue_reading_p = 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -2674,7 +2674,7 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
|
|||
{
|
||||
char *p = read_buffer;
|
||||
char *end = read_buffer + read_buffer_size;
|
||||
register int c;
|
||||
register int ch;
|
||||
/* Nonzero if we saw an escape sequence specifying
|
||||
a multibyte character. */
|
||||
int force_multibyte = 0;
|
||||
|
|
@ -2684,8 +2684,8 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
|
|||
int cancel = 0;
|
||||
int nchars = 0;
|
||||
|
||||
while ((c = READCHAR) >= 0
|
||||
&& c != '\"')
|
||||
while ((ch = READCHAR) >= 0
|
||||
&& ch != '\"')
|
||||
{
|
||||
if (end - p < MAX_MULTIBYTE_LENGTH)
|
||||
{
|
||||
|
|
@ -2696,44 +2696,44 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
|
|||
end = read_buffer + read_buffer_size;
|
||||
}
|
||||
|
||||
if (c == '\\')
|
||||
if (ch == '\\')
|
||||
{
|
||||
int modifiers;
|
||||
|
||||
c = read_escape (readcharfun, 1);
|
||||
ch = read_escape (readcharfun, 1);
|
||||
|
||||
/* C is -1 if \ newline has just been seen */
|
||||
if (c == -1)
|
||||
/* CH is -1 if \ newline has just been seen */
|
||||
if (ch == -1)
|
||||
{
|
||||
if (p == read_buffer)
|
||||
cancel = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
modifiers = c & CHAR_MODIFIER_MASK;
|
||||
c = c & ~CHAR_MODIFIER_MASK;
|
||||
modifiers = ch & CHAR_MODIFIER_MASK;
|
||||
ch = ch & ~CHAR_MODIFIER_MASK;
|
||||
|
||||
if (CHAR_BYTE8_P (c))
|
||||
if (CHAR_BYTE8_P (ch))
|
||||
force_singlebyte = 1;
|
||||
else if (! ASCII_CHAR_P (c))
|
||||
else if (! ASCII_CHAR_P (ch))
|
||||
force_multibyte = 1;
|
||||
else /* i.e. ASCII_CHAR_P (c) */
|
||||
else /* i.e. ASCII_CHAR_P (ch) */
|
||||
{
|
||||
/* Allow `\C- ' and `\C-?'. */
|
||||
if (modifiers == CHAR_CTL)
|
||||
{
|
||||
if (c == ' ')
|
||||
c = 0, modifiers = 0;
|
||||
else if (c == '?')
|
||||
c = 127, modifiers = 0;
|
||||
if (ch == ' ')
|
||||
ch = 0, modifiers = 0;
|
||||
else if (ch == '?')
|
||||
ch = 127, modifiers = 0;
|
||||
}
|
||||
if (modifiers & CHAR_SHIFT)
|
||||
{
|
||||
/* Shift modifier is valid only with [A-Za-z]. */
|
||||
if (c >= 'A' && c <= 'Z')
|
||||
if (ch >= 'A' && ch <= 'Z')
|
||||
modifiers &= ~CHAR_SHIFT;
|
||||
else if (c >= 'a' && c <= 'z')
|
||||
c -= ('a' - 'A'), modifiers &= ~CHAR_SHIFT;
|
||||
else if (ch >= 'a' && ch <= 'z')
|
||||
ch -= ('a' - 'A'), modifiers &= ~CHAR_SHIFT;
|
||||
}
|
||||
|
||||
if (modifiers & CHAR_META)
|
||||
|
|
@ -2741,7 +2741,7 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
|
|||
/* Move the meta bit to the right place for a
|
||||
string. */
|
||||
modifiers &= ~CHAR_META;
|
||||
c = BYTE8_TO_CHAR (c | 0x80);
|
||||
ch = BYTE8_TO_CHAR (ch | 0x80);
|
||||
force_singlebyte = 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -2749,20 +2749,20 @@ read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
|
|||
/* Any modifiers remaining are invalid. */
|
||||
if (modifiers)
|
||||
error ("Invalid modifier in string");
|
||||
p += CHAR_STRING (c, (unsigned char *) p);
|
||||
p += CHAR_STRING (ch, (unsigned char *) p);
|
||||
}
|
||||
else
|
||||
{
|
||||
p += CHAR_STRING (c, (unsigned char *) p);
|
||||
if (CHAR_BYTE8_P (c))
|
||||
p += CHAR_STRING (ch, (unsigned char *) p);
|
||||
if (CHAR_BYTE8_P (ch))
|
||||
force_singlebyte = 1;
|
||||
else if (! ASCII_CHAR_P (c))
|
||||
else if (! ASCII_CHAR_P (ch))
|
||||
force_multibyte = 1;
|
||||
}
|
||||
nchars++;
|
||||
}
|
||||
|
||||
if (c < 0)
|
||||
if (ch < 0)
|
||||
end_of_file_error ();
|
||||
|
||||
/* If purifying, and string starts with \ newline,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue