cleanup db_print_pnode_tree()

This commit is contained in:
rlar 2012-09-27 19:49:42 +02:00
parent 44e7f7f7bd
commit ae5de92c69
1 changed files with 3 additions and 4 deletions

View File

@ -27,7 +27,7 @@ static struct pnode *mksnode(const char *string);
#include "parse-bison.c" #include "parse-bison.c"
char *db_print_pnode_tree(struct pnode *p, char *print); void db_print_pnode_tree(struct pnode *p, char *print);
struct pnode * struct pnode *
@ -545,13 +545,12 @@ db_print_pnode(FILE *fdst, struct pnode *p)
} }
char * void
db_print_pnode_tree(struct pnode *p, char *print) db_print_pnode_tree(struct pnode *p, char *print)
{ {
#if 1 #if 1
NG_IGNORE(print); NG_IGNORE(print);
db_print_pnode(stdout, p); db_print_pnode(stdout, p);
return NULL;
#else #else
char *buf; char *buf;
size_t buf_size; size_t buf_size;
@ -560,7 +559,7 @@ db_print_pnode_tree(struct pnode *p, char *print)
fclose(db_stream); fclose(db_stream);
if (print) if (print)
printf("%s:%d: %s {%s}\n%s\n", __FILE__, __LINE__, __func__, print, buf); printf("%s:%d: %s {%s}\n%s\n", __FILE__, __LINE__, __func__, print, buf);
return buf; free(buf);
#endif #endif
} }