Fix functions of the form "name(void)"

pull/193/head
Michael R Sweet 19 years ago
parent ebf38e0fb5
commit 8406ab7c2c
  1. 19
      mxmldoc.c
  2. 11
      test/function.cxx

@ -363,6 +363,11 @@ add_variable(mxml_node_t *parent, /* I - Parent node */
*bufptr; /* Pointer into buffer */
#ifdef DEBUG
fprintf(stderr, "add_variable(parent=%p, name=\"%s\", type=%p)\n",
parent, name, type);
#endif /* DEBUG */
/*
* Range check input...
*/
@ -932,7 +937,15 @@ scan_file(const char *filename, /* I - Filename */
if (function && type && !parens)
{
/*
* Check for "void" argument...
*/
if (type->child && type->child->next)
variable = add_variable(function, "argument", type);
else
mxmlDelete(type);
type = NULL;
}
@ -1557,6 +1570,8 @@ scan_file(const char *filename, /* I - Filename */
* Argument definition...
*/
if (strcmp(buffer, "void"))
{
mxmlNewText(type, type->child != NULL &&
type->last_child->value.text.string[0] != '(' &&
type->last_child->value.text.string[0] != '*',
@ -1567,6 +1582,10 @@ scan_file(const char *filename, /* I - Filename */
#endif /* DEBUG */
variable = add_variable(function, "argument", type);
}
else
mxmlDelete(type);
type = NULL;
}
else if (type->child && !function && (ch == ';' || ch == ','))

@ -74,3 +74,14 @@ foo_default_int(int one, /* I - Integer */
return (2);
}
/*
* 'foo_void_func()' - Function taking no arguments.
*/
void
foo_void_func(void)
{
puts("foo_void_func()");
}

Loading…
Cancel
Save