Move nowarn_snprintf.h to lib/
authorJens Axboe <axboe@kernel.dk>
Tue, 5 Jun 2018 17:11:03 +0000 (11:11 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 5 Jun 2018 17:11:03 +0000 (11:11 -0600)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fio.h
lib/nowarn_snprintf.h [new file with mode: 0644]
nowarn_snprintf.h [deleted file]
verify-state.h

diff --git a/fio.h b/fio.h
index b9a21782c7611c0756448c5fbf0a9e6c5382fa01..6c897fc6fe9e9a4cad5473e1c0641305772a4136 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -44,7 +44,7 @@
 #include "io_u_queue.h"
 #include "workqueue.h"
 #include "steadystate.h"
 #include "io_u_queue.h"
 #include "workqueue.h"
 #include "steadystate.h"
-#include "nowarn_snprintf.h"
+#include "lib/nowarn_snprintf.h"
 
 #ifdef CONFIG_SOLARISAIO
 #include <sys/asynch.h>
 
 #ifdef CONFIG_SOLARISAIO
 #include <sys/asynch.h>
diff --git a/lib/nowarn_snprintf.h b/lib/nowarn_snprintf.h
new file mode 100644 (file)
index 0000000..5c0f4d4
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef _NOWARN_SNPRINTF_H_
+#define _NOWARN_SNPRINTF_H_
+
+#include <stdio.h>
+#include <stdarg.h>
+
+static inline int nowarn_snprintf(char *str, size_t size, const char *format,
+                                 ...)
+{
+       va_list args;
+
+       va_start(args, format);
+#if __GNUC__ -0 >= 8
+#pragma GCC diagnostic push "-Wformat-truncation"
+#pragma GCC diagnostic ignored "-Wformat-truncation"
+#endif
+       return vsnprintf(str, size, format, args);
+#if __GNUC__ -0 >= 8
+#pragma GCC diagnostic pop "-Wformat-truncation"
+#endif
+       va_end(args);
+}
+
+#endif
diff --git a/nowarn_snprintf.h b/nowarn_snprintf.h
deleted file mode 100644 (file)
index 5c0f4d4..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef _NOWARN_SNPRINTF_H_
-#define _NOWARN_SNPRINTF_H_
-
-#include <stdio.h>
-#include <stdarg.h>
-
-static inline int nowarn_snprintf(char *str, size_t size, const char *format,
-                                 ...)
-{
-       va_list args;
-
-       va_start(args, format);
-#if __GNUC__ -0 >= 8
-#pragma GCC diagnostic push "-Wformat-truncation"
-#pragma GCC diagnostic ignored "-Wformat-truncation"
-#endif
-       return vsnprintf(str, size, format, args);
-#if __GNUC__ -0 >= 8
-#pragma GCC diagnostic pop "-Wformat-truncation"
-#endif
-       va_end(args);
-}
-
-#endif
index 39b0ed1a1a557a725d231f401a93f58b8dcd53e5..6da1585b24657a60d7357d4f04f6f445f01544f3 100644 (file)
@@ -4,7 +4,7 @@
 #include <stdint.h>
 #include <string.h>
 #include <limits.h>
 #include <stdint.h>
 #include <string.h>
 #include <limits.h>
-#include "nowarn_snprintf.h"
+#include "lib/nowarn_snprintf.h"
 
 struct thread_rand32_state {
        uint32_t s[4];
 
 struct thread_rand32_state {
        uint32_t s[4];