changeset 1575:e75dab5bec71

some linting after fuzz merge (#60) * fix prototype * remove extra comma * use m_free after m_strdup
author François Perrad <francois.perrad@gadz.org>
date Sat, 03 Mar 2018 04:06:45 +0100
parents 56ec2214144f
children 0c8c2552b2f2
files dbhelpers.c dbutil.c fuzz-wrapfd.c fuzz-wrapfd.h
diffstat 4 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/dbhelpers.c	Fri Mar 02 00:11:27 2018 +0800
+++ b/dbhelpers.c	Sat Mar 03 04:06:45 2018 +0100
@@ -9,8 +9,9 @@
 #elif defined(HAVE_EXPLICIT_BZERO)
 	explicit_bzero(data, len);
 #else
+	/* This must be volatile to avoid compiler optimisation */
 	volatile void *p = data;
-    memset((void*)p, 0x0, len);
+	memset((void*)p, 0x0, len);
 #endif
 }
 
--- a/dbutil.c	Fri Mar 02 00:11:27 2018 +0800
+++ b/dbutil.c	Sat Mar 03 04:06:45 2018 +0100
@@ -687,6 +687,6 @@
 		TRACE(("error opening directory %s for fsync: %s", dir, strerror(errno)))
 	}
 
-	free(fn_dir);
+	m_free(fn_dir);
 #endif
 }
--- a/fuzz-wrapfd.c	Fri Mar 02 00:11:27 2018 +0800
+++ b/fuzz-wrapfd.c	Sat Mar 03 04:06:45 2018 +0100
@@ -26,7 +26,7 @@
 static unsigned int nused;
 static unsigned short rand_state[3];
 
-void wrapfd_setup() {
+void wrapfd_setup(void) {
 	TRACE(("wrapfd_setup"))
 	nused = 0;
 	memset(wrap_fds, 0x0, sizeof(wrap_fds));
--- a/fuzz-wrapfd.h	Fri Mar 02 00:11:27 2018 +0800
+++ b/fuzz-wrapfd.h	Sat Mar 03 04:06:45 2018 +0100
@@ -7,10 +7,10 @@
     UNUSED = 0,
     PLAIN,
     INPROGRESS,
-    RANDOMIN,
+    RANDOMIN
 };
 
-void wrapfd_setup();
+void wrapfd_setup(void);
 void wrapfd_setseed(uint32_t seed);
 // doesn't take ownership of buf. buf is optional.
 void wrapfd_add(int fd, buffer *buf, enum wrapfd_mode mode);