Skip to contentSkip to conversation

double inclusions

PATCH Applied Nicolas Kaiser 3 participants 4 messages Nov 14, 2006 – Nov 28, 2006 Sparse checker

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 double inclusions

Remove two double inclusions.

---

 expression.c |    1 -
 symbol.c     |    1 -
 2 files changed, 2 deletions(-)
expression.c +0 -1
diff -uprN sparse-0.1.orig/expression.c sparse-0.1/expression.c
@@ -20,7 +20,6 @@
 
 #include "lib.h"
 #include "allocate.h"
-#include "allocate.h"
 #include "token.h"
 #include "parse.h"
 #include "symbol.h"
symbol.c +0 -1
diff -uprN sparse-0.1.orig/symbol.c sparse-0.1/symbol.c
@@ -8,7 +8,6 @@
  */
 #include <stdlib.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
 
 #include "lib.h"
maintainer
#2 lore raw

PATCH 1/1 Fix warning on self check.

Fix warning on self check

Sparse complain about the using do while without compound statment in pre-process.c. This trivial patch fixes that.

pre-process.c +16 -12
Index: sparse/pre-process.c
===================================================================
@@ -43,20 +43,24 @@
 static const char **angle_includepath = includepath + 1;
 static const char **sys_includepath   = includepath + 1;
 
-#define dirty_stream(stream)			\
-	do if (!stream->dirty) {		\
-		stream->dirty = 1;		\
-		if (!stream->ifndef)		\
-			stream->protect = NULL;	\
+#define dirty_stream(stream)				\
+	do {						\
+		if (!stream->dirty) {			\
+			stream->dirty = 1;		\
+			if (!stream->ifndef)		\
+				stream->protect = NULL;	\
+		}					\
 	} while(0)
 
-#define end_group(stream)				\
-	do if (stream->ifndef == stream->top_if) {	\
-		stream->ifndef = NULL;			\
-		if (!stream->dirty)			\
-			stream->protect = NULL;		\
-		else if (stream->protect)		\
-			stream->dirty = 0;		\
+#define end_group(stream)					\
+	do {							\
+		if (stream->ifndef == stream->top_if) {		\
+			stream->ifndef = NULL;			\
+			if (!stream->dirty)			\
+				stream->protect = NULL;		\
+			else if (stream->protect)		\
+				stream->dirty = 0;		\
+		}						\
 	} while(0)
 
 #define nesting_error(stream)		\
#3 lore raw

Re: [PATCH] Fix warning on self check.

Quoted 7 lines · Christopher Li

Fix warning on self check

Sparse complain about the using do while without compound statment in pre-process.c. This trivial patch fixes that.

Good catch, thanks! Merged.

One request for future patches: please don't duplicate the subject in the body. git-am forms the commit message from both the subject and the body, and thus duplicating the subject in the body will duplicate it in the commit message. I've manually fixed that for this patch.

- Josh Triplett