Module Name: src Committed By: rillig Date: Tue Dec 21 21:04:08 UTC 2021
Modified Files: src/usr.bin/xlint/lint1: debug.c externs1.h init.c Log Message: lint: rename debug_indent to debug_print_indent The previous name could be mistaken to mean "increase the indentation of the debug output". Instead, the function prints the current indentation. In externs1.h, the macro definition was a duplicate, the macros were sorted differently than the functions a few lines above. No binary change. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/usr.bin/xlint/lint1/debug.c cvs rdiff -u -r1.143 -r1.144 src/usr.bin/xlint/lint1/externs1.h cvs rdiff -u -r1.225 -r1.226 src/usr.bin/xlint/lint1/init.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/xlint/lint1/debug.c diff -u src/usr.bin/xlint/lint1/debug.c:1.6 src/usr.bin/xlint/lint1/debug.c:1.7 --- src/usr.bin/xlint/lint1/debug.c:1.6 Mon Dec 20 00:10:07 2021 +++ src/usr.bin/xlint/lint1/debug.c Tue Dec 21 21:04:08 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: debug.c,v 1.6 2021/12/20 00:10:07 rillig Exp $ */ +/* $NetBSD: debug.c,v 1.7 2021/12/21 21:04:08 rillig Exp $ */ /*- * Copyright (c) 2021 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: debug.c,v 1.6 2021/12/20 00:10:07 rillig Exp $"); +__RCSID("$NetBSD: debug.c,v 1.7 2021/12/21 21:04:08 rillig Exp $"); #endif #include <stdlib.h> @@ -59,7 +59,7 @@ debug_printf(const char *fmt, ...) } void -debug_indent(void) +debug_print_indent(void) { debug_printf("%*s", 2 * debug_indentation, ""); @@ -91,7 +91,7 @@ debug_step(const char *fmt, ...) { va_list va; - debug_indent(); + debug_print_indent(); va_start(va, fmt); vfprintf(stdout, fmt, va); va_end(va); @@ -116,7 +116,7 @@ debug_node(const tnode_t *tn) } op = tn->tn_op; - debug_indent(); + debug_print_indent(); debug_printf("'%s' with type '%s'%s%s%s", op == CVT && !tn->tn_cast ? "convert" : modtab[op].m_name, type_name(tn->tn_type), tn->tn_lvalue ? ", lvalue" : "", Index: src/usr.bin/xlint/lint1/externs1.h diff -u src/usr.bin/xlint/lint1/externs1.h:1.143 src/usr.bin/xlint/lint1/externs1.h:1.144 --- src/usr.bin/xlint/lint1/externs1.h:1.143 Mon Dec 20 19:34:01 2021 +++ src/usr.bin/xlint/lint1/externs1.h Tue Dec 21 21:04:08 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: externs1.h,v 1.143 2021/12/20 19:34:01 rillig Exp $ */ +/* $NetBSD: externs1.h,v 1.144 2021/12/21 21:04:08 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -118,7 +118,7 @@ extern void expr_restore_memory(struct m #ifdef DEBUG void debug_node(const tnode_t *); void debug_printf(const char *fmt, ...) __printflike(1, 2); -void debug_indent(void); +void debug_print_indent(void); void debug_indent_inc(void); void debug_indent_dec(void); void debug_enter(const char *); @@ -130,12 +130,11 @@ void debug_leave(const char *); #define debug_noop() do { } while (false) #define debug_node(tn) debug_noop() #define debug_printf(...) debug_noop() -#define debug_indent() debug_noop() -#define debug_step(...) debug_noop() -#define debug_indent() debug_noop() +#define debug_print_indent() debug_noop() #define debug_indent_inc() debug_noop() #define debug_indent_dec() debug_noop() #define debug_enter() debug_noop() +#define debug_step(...) debug_noop() #define debug_leave() debug_noop() #endif Index: src/usr.bin/xlint/lint1/init.c diff -u src/usr.bin/xlint/lint1/init.c:1.225 src/usr.bin/xlint/lint1/init.c:1.226 --- src/usr.bin/xlint/lint1/init.c:1.225 Tue Dec 21 16:50:11 2021 +++ src/usr.bin/xlint/lint1/init.c Tue Dec 21 21:04:08 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: init.c,v 1.225 2021/12/21 16:50:11 rillig Exp $ */ +/* $NetBSD: init.c,v 1.226 2021/12/21 21:04:08 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -38,7 +38,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: init.c,v 1.225 2021/12/21 16:50:11 rillig Exp $"); +__RCSID("$NetBSD: init.c,v 1.226 2021/12/21 21:04:08 rillig Exp $"); #endif #include <stdlib.h> @@ -436,7 +436,7 @@ designation_debug(const designation *dn) if (dn->dn_len == 0) return; - debug_indent(); + debug_print_indent(); debug_printf("designation: "); for (i = 0; i < dn->dn_len; i++) { const designator *dr = dn->dn_items + i; @@ -680,7 +680,7 @@ initialization_debug(const initializatio i = 0; for (bl = in->in_brace_level; bl != NULL; bl = bl->bl_enclosing) { - debug_indent(); + debug_print_indent(); debug_printf("brace level %zu: ", i); brace_level_debug(bl); i++;