changeset 103:343af355df1b

Pass -Wunused.
author David A. Holland
date Tue, 11 Jun 2013 11:00:01 -0400
parents 9b859d40640a
children 91f600e6647b
files CHANGES directive.c output.c
diffstat 3 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES	Tue Jun 11 10:51:30 2013 -0400
+++ b/CHANGES	Tue Jun 11 11:00:01 2013 -0400
@@ -1,5 +1,6 @@
 pending
    - auto-recognize more builtin PowerPC and mips macros
+   - pass -Wunused (partly from Baptiste Daroussin)
 
 release 0.1 (20130610)
    - first release, works with at least some imake templates
--- a/directive.c	Tue Jun 11 10:51:30 2013 -0400
+++ b/directive.c	Tue Jun 11 11:00:01 2013 -0400
@@ -240,6 +240,9 @@
 void
 d_else(struct place *p, struct place *p2, char *line)
 {
+	(void)p2;
+	(void)line;
+
 	if (ifstate->seenelse) {
 		complain(p, "Multiple #else directives in one conditional");
 		complain_fail();
@@ -254,6 +257,9 @@
 void
 d_endif(struct place *p, struct place *p2, char *line)
 {
+	(void)p2;
+	(void)line;
+
 	if (ifstate->prev == NULL) {
 		complain(p, "Unmatched #endif");
 		complain_fail();
@@ -272,6 +278,8 @@
 	size_t pos, argpos;
 	struct place p3, p4;
 
+	(void)p;
+
 	/*
 	 * line may be:
 	 *    macro expansion
@@ -332,6 +340,8 @@
 void
 d_undef(struct place *p, struct place *p2, char *line)
 {
+	(void)p;
+
 	uncomment(line);
 	oneword("#undef", p2, line);
 	macro_undef(line);
@@ -395,6 +405,9 @@
 void
 d_line(struct place *p, struct place *p2, char *line)
 {
+	(void)p2;
+	(void)line;
+
 	/* XXX */
 	complain(p, "Sorry, no #line yet");
 }
@@ -435,6 +448,8 @@
 void
 d_pragma(struct place *p, struct place *p2, char *line)
 {
+	(void)p2;
+
 	complain(p, "#pragma %s", line);
 	complain_fail();
 }
--- a/output.c	Tue Jun 11 10:51:30 2013 -0400
+++ b/output.c	Tue Jun 11 11:00:01 2013 -0400
@@ -96,7 +96,7 @@
 
 static
 void
-filter_output(const struct place *p, const char *buf, size_t len)
+filter_output(const char *buf, size_t len)
 {
 	size_t pos, start;
 	bool inesc = false;
@@ -171,7 +171,7 @@
 	linebufpos += len;
 
 	if (len == 1 && buf[0] == '\n') {
-		filter_output(&linebufplace, linebuf, linebufpos);
+		filter_output(linebuf, linebufpos);
 		linebufpos = 0;
 	}
 }