Module Name:    src
Committed By:   rillig
Date:           Sun Mar 14 00:33:25 UTC 2021

Modified Files:
        src/usr.bin/indent: indent.h

Log Message:
indent: give indent a try at formatting its own code

Formatting indent.h required the following manual corrections
afterwards:

The first tab in the comment in line 1 was replaced with a space but
shouldn't be.

The spacing around the '...' in function prototypes was completely
wrong.  It looked like 'const char *,...)__printflike', without any
spaces.

The '*' of the return type 'const char *' was tied to the function name,
even though this declaration was only for a single function.  In such a
case, it's more appropriate to line up the function names.

The function-like macros were not indented to -di.  This is something
that I would not expect from indent, so it's ok to do that manually.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/indent/indent.h

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/indent/indent.h
diff -u src/usr.bin/indent/indent.h:1.15 src/usr.bin/indent/indent.h:1.16
--- src/usr.bin/indent/indent.h:1.15	Sat Mar 13 23:42:23 2021
+++ src/usr.bin/indent/indent.h	Sun Mar 14 00:33:25 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: indent.h,v 1.15 2021/03/13 23:42:23 rillig Exp $	*/
+/*	$NetBSD: indent.h,v 1.16 2021/03/14 00:33:25 rillig Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
@@ -41,29 +41,30 @@ __FBSDID("$FreeBSD: head/usr.bin/indent/
 #define nitems(array) (sizeof (array) / sizeof (array[0]))
 #endif
 
-void	add_typename(const char *);
-void	alloc_typenames(void);
-int	compute_code_indent(void);
-int	compute_label_indent(void);
-int	indentation_after_range(int, const char *, const char *);
-int	indentation_after(int, const char *);
-void	init_constant_tt(void);
+void		add_typename(const char *);
+void		alloc_typenames(void);
+int		compute_code_indent(void);
+int		compute_label_indent(void);
+int		indentation_after_range(int, const char *, const char *);
+int		indentation_after(int, const char *);
+void		init_constant_tt(void);
 #ifdef debug
-void	debug_vis_range(const char *, const char *, const char *, const char *);
-void	debug_printf(const char *, ...) __printflike(1, 2);
-void	debug_println(const char *, ...) __printflike(1, 2);
-const char *token_type_name(token_type);
+void		debug_vis_range(const char *, const char *, const char *,
+		    const char *);
+void		debug_printf(const char *, ...) __printflike(1, 2);
+void		debug_println(const char *, ...) __printflike(1, 2);
+const char *	token_type_name(token_type);
 #else
-#define debug_printf(fmt, ...) do { } while (false)
-#define debug_println(fmt, ...) do { } while (false)
-#define debug_vis_range(prefix, s, e, suffix) do { } while (false)
+#define		debug_printf(fmt, ...) do { } while (false)
+#define		debug_println(fmt, ...) do { } while (false)
+#define		debug_vis_range(prefix, s, e, suffix) do { } while (false)
 #endif
-token_type lexi(struct parser_state *);
-void	diag(int, const char *, ...) __printflike(2, 3);
-void	dump_line(void);
-void	fill_buffer(void);
-void	parse(token_type);
-void	process_comment(void);
-void	set_defaults(void);
-void	set_option(char *);
-void	set_profile(const char *);
+token_type	lexi(struct parser_state *);
+void		diag(int, const char *, ...) __printflike(2, 3);
+void		dump_line(void);
+void		fill_buffer(void);
+void		parse(token_type);
+void		process_comment(void);
+void		set_defaults(void);
+void		set_option(char *);
+void		set_profile(const char *);

Reply via email to