diff options
| author | Paul Eggert | 2011-02-25 14:21:01 -0800 |
|---|---|---|
| committer | Paul Eggert | 2011-02-25 14:21:01 -0800 |
| commit | 8dfa32f6a5c8570ab2eb0f379491209a3d4494c9 (patch) | |
| tree | ea255fdf88741a619f93f717e172d328c73e5e34 /lib-src | |
| parent | 564ff1f20ced473e10179fc5a4cc1c85cb572b2b (diff) | |
| download | emacs-8dfa32f6a5c8570ab2eb0f379491209a3d4494c9.tar.gz emacs-8dfa32f6a5c8570ab2eb0f379491209a3d4494c9.zip | |
* make-docfile.c (scan_c_file): Refactor local variable decls to make their scope
more accurate and to avoid a GCC -Wuninitialized diagnostic.
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/ChangeLog | 2 | ||||
| -rw-r--r-- | lib-src/make-docfile.c | 13 |
2 files changed, 6 insertions, 9 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 61480cfaec0..928e8621c27 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -3,6 +3,8 @@ | |||
| 3 | * make-docfile.c (write_globals): Change char * to char const * | 3 | * make-docfile.c (write_globals): Change char * to char const * |
| 4 | to avoid a GCC "assignment discards qualifiers" diagnostic | 4 | to avoid a GCC "assignment discards qualifiers" diagnostic |
| 5 | in some configurations. | 5 | in some configurations. |
| 6 | (scan_c_file): Refactor local variable decls to make their scope | ||
| 7 | more accurate and to avoid a GCC -Wuninitialized diagnostic. | ||
| 6 | 8 | ||
| 7 | 2011-02-22 Eli Zaretskii <eliz@gnu.org> | 9 | 2011-02-22 Eli Zaretskii <eliz@gnu.org> |
| 8 | 10 | ||
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index 12dbdbee219..f900ea42e91 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c | |||
| @@ -658,12 +658,8 @@ scan_c_file (char *filename, const char *mode) | |||
| 658 | FILE *infile; | 658 | FILE *infile; |
| 659 | register int c; | 659 | register int c; |
| 660 | register int commas; | 660 | register int commas; |
| 661 | register int defunflag; | ||
| 662 | register int defvarperbufferflag; | ||
| 663 | register int defvarflag; | ||
| 664 | int minargs, maxargs; | 661 | int minargs, maxargs; |
| 665 | int extension = filename[strlen (filename) - 1]; | 662 | int extension = filename[strlen (filename) - 1]; |
| 666 | enum global_type type; | ||
| 667 | 663 | ||
| 668 | if (extension == 'o') | 664 | if (extension == 'o') |
| 669 | filename[strlen (filename) - 1] = 'c'; | 665 | filename[strlen (filename) - 1] = 'c'; |
| @@ -693,6 +689,10 @@ scan_c_file (char *filename, const char *mode) | |||
| 693 | while (!feof (infile)) | 689 | while (!feof (infile)) |
| 694 | { | 690 | { |
| 695 | int doc_keyword = 0; | 691 | int doc_keyword = 0; |
| 692 | int defunflag = 0; | ||
| 693 | int defvarperbufferflag = 0; | ||
| 694 | int defvarflag = 0; | ||
| 695 | enum global_type type = INVALID; | ||
| 696 | 696 | ||
| 697 | if (c != '\n' && c != '\r') | 697 | if (c != '\n' && c != '\r') |
| 698 | { | 698 | { |
| @@ -726,7 +726,6 @@ scan_c_file (char *filename, const char *mode) | |||
| 726 | continue; | 726 | continue; |
| 727 | 727 | ||
| 728 | defvarflag = 1; | 728 | defvarflag = 1; |
| 729 | defunflag = 0; | ||
| 730 | 729 | ||
| 731 | c = getc (infile); | 730 | c = getc (infile); |
| 732 | defvarperbufferflag = (c == 'P'); | 731 | defvarperbufferflag = (c == 'P'); |
| @@ -738,8 +737,6 @@ scan_c_file (char *filename, const char *mode) | |||
| 738 | type = LISP_OBJECT; | 737 | type = LISP_OBJECT; |
| 739 | else if (c == 'B') | 738 | else if (c == 'B') |
| 740 | type = BOOLEAN; | 739 | type = BOOLEAN; |
| 741 | else | ||
| 742 | type = INVALID; | ||
| 743 | } | 740 | } |
| 744 | 741 | ||
| 745 | c = getc (infile); | 742 | c = getc (infile); |
| @@ -758,8 +755,6 @@ scan_c_file (char *filename, const char *mode) | |||
| 758 | continue; | 755 | continue; |
| 759 | c = getc (infile); | 756 | c = getc (infile); |
| 760 | defunflag = c == 'U'; | 757 | defunflag = c == 'U'; |
| 761 | defvarflag = 0; | ||
| 762 | defvarperbufferflag = 0; | ||
| 763 | } | 758 | } |
| 764 | else continue; | 759 | else continue; |
| 765 | 760 | ||