1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-01 11:14:55 +00:00

* make-docfile.c (scan_c_file): Refactor local variable decls to make their scope

more accurate and to avoid a GCC -Wuninitialized diagnostic.
This commit is contained in:
Paul Eggert 2011-02-25 14:21:01 -08:00
parent 564ff1f20c
commit 8dfa32f6a5
2 changed files with 6 additions and 9 deletions

View File

@ -3,6 +3,8 @@
* make-docfile.c (write_globals): Change char * to char const *
to avoid a GCC "assignment discards qualifiers" diagnostic
in some configurations.
(scan_c_file): Refactor local variable decls to make their scope
more accurate and to avoid a GCC -Wuninitialized diagnostic.
2011-02-22 Eli Zaretskii <eliz@gnu.org>

View File

@ -658,12 +658,8 @@ scan_c_file (char *filename, const char *mode)
FILE *infile;
register int c;
register int commas;
register int defunflag;
register int defvarperbufferflag;
register int defvarflag;
int minargs, maxargs;
int extension = filename[strlen (filename) - 1];
enum global_type type;
if (extension == 'o')
filename[strlen (filename) - 1] = 'c';
@ -693,6 +689,10 @@ scan_c_file (char *filename, const char *mode)
while (!feof (infile))
{
int doc_keyword = 0;
int defunflag = 0;
int defvarperbufferflag = 0;
int defvarflag = 0;
enum global_type type = INVALID;
if (c != '\n' && c != '\r')
{
@ -726,7 +726,6 @@ scan_c_file (char *filename, const char *mode)
continue;
defvarflag = 1;
defunflag = 0;
c = getc (infile);
defvarperbufferflag = (c == 'P');
@ -738,8 +737,6 @@ scan_c_file (char *filename, const char *mode)
type = LISP_OBJECT;
else if (c == 'B')
type = BOOLEAN;
else
type = INVALID;
}
c = getc (infile);
@ -758,8 +755,6 @@ scan_c_file (char *filename, const char *mode)
continue;
c = getc (infile);
defunflag = c == 'U';
defvarflag = 0;
defvarperbufferflag = 0;
}
else continue;