aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src/make-docfile.c
diff options
context:
space:
mode:
authorStefan Monnier2010-08-11 07:42:48 +0200
committerStefan Monnier2010-08-11 07:42:48 +0200
commitc566235d981eba73c88bbff00b6a1d88360b6e9f (patch)
treef8d653add3570fe750a83d1123ed35022e0bf4ef /lib-src/make-docfile.c
parent0bfdb86f425a88fe43ebc88851c6f9a6418e1862 (diff)
parent490b89acab3e759426ede25c31c94268df55e925 (diff)
downloademacs-c566235d981eba73c88bbff00b6a1d88360b6e9f.tar.gz
emacs-c566235d981eba73c88bbff00b6a1d88360b6e9f.zip
Merge from trunk
Diffstat (limited to 'lib-src/make-docfile.c')
-rw-r--r--lib-src/make-docfile.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index 51c30f91d8f..7fe63bed506 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -70,6 +70,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
70int scan_file (char *filename); 70int scan_file (char *filename);
71int scan_lisp_file (char *filename, char *mode); 71int scan_lisp_file (char *filename, char *mode);
72int scan_c_file (char *filename, char *mode); 72int scan_c_file (char *filename, char *mode);
73void fatal (char *s1, char *s2) NO_RETURN;
73 74
74#ifdef MSDOS 75#ifdef MSDOS
75/* s/msdos.h defines this as sys_chdir, but we're not linking with the 76/* s/msdos.h defines this as sys_chdir, but we're not linking with the
@@ -441,7 +442,7 @@ write_c_args (FILE *out, char *func, char *buf, int minargs, int maxargs)
441 register char *p; 442 register char *p;
442 int in_ident = 0; 443 int in_ident = 0;
443 char *ident_start; 444 char *ident_start;
444 int ident_length; 445 int ident_length = 0;
445 446
446 fprintf (out, "(fn"); 447 fprintf (out, "(fn");
447 448
@@ -475,6 +476,12 @@ write_c_args (FILE *out, char *func, char *buf, int minargs, int maxargs)
475 identifier. */ 476 identifier. */
476 if (c == ',' || c == ')') 477 if (c == ',' || c == ')')
477 { 478 {
479 if (ident_length == 0)
480 {
481 error ("empty arg list for `%s' should be (void), not ()", func);
482 continue;
483 }
484
478 if (strncmp (ident_start, "void", ident_length) == 0) 485 if (strncmp (ident_start, "void", ident_length) == 0)
479 continue; 486 continue;
480 487
@@ -488,7 +495,7 @@ write_c_args (FILE *out, char *func, char *buf, int minargs, int maxargs)
488 495
489 /* In C code, `default' is a reserved word, so we spell it 496 /* In C code, `default' is a reserved word, so we spell it
490 `defalt'; unmangle that here. */ 497 `defalt'; unmangle that here. */
491 if (strncmp (ident_start, "defalt", ident_length) == 0) 498 if (ident_length == 6 && strncmp (ident_start, "defalt", 6) == 0)
492 fprintf (out, "DEFAULT"); 499 fprintf (out, "DEFAULT");
493 else 500 else
494 while (ident_length-- > 0) 501 while (ident_length-- > 0)