diff --git a/extree.c b/extree.c index e291970..e42d256 100644 --- a/extree.c +++ b/extree.c @@ -18,13 +18,18 @@ to go away. Hopefully the compiler will realize when it's dead, and eliminate it. */ -static void print_tree( +void print_tree( FILE *printfile, EX_TREE *tp, int depth) { SYMBOL *sym; + if (tp == NULL) { + fprintf(printfile, "(null)"); + return; + } + switch (tp->type) { case EX_LIT: fprintf(printfile, "%o", tp->data.lit & 0177777); diff --git a/macro11.c b/macro11.c index 448a042..2bb74d0 100644 --- a/macro11.c +++ b/macro11.c @@ -279,6 +279,8 @@ int main( } else if (!stricmp(cp, "yl1")) { /* list the first pass, in addition to the second */ list_pass_0++; + } else if (!stricmp(cp, "yd")) { + enabl_debug++; } else { fprintf(stderr, "Unknown option %s\n", argv[arg]); print_help(); @@ -332,7 +334,7 @@ int main( list_symbol_table(); } #if 0 - if (enabl_debug) + if (enabl_debug > 1) dump_all_macros(); #endif diff --git a/macros.c b/macros.c index dd2af72..0537050 100644 --- a/macros.c +++ b/macros.c @@ -506,7 +506,7 @@ STREAM *expandmacro( /* dump_all_macros is a diagnostic function that's currently not used. I used it while debugging, and I haven't removed it. */ -static void dump_all_macros( +void dump_all_macros( void) { MACRO *mac; @@ -515,7 +515,7 @@ static void dump_all_macros( for (mac = (MACRO *) first_sym(¯o_st, &iter); mac != NULL; mac = (MACRO *) next_sym(¯o_st, &iter)) { dumpmacro(mac, lstfile); - printf("\n\n"); + fprintf(lstfile, "\n\n"); } }