configure: re-enable '-Wunused-parameter'
[babeltrace.git] / src / compat / memstream.h
index 35ffa643d852403071473d1040c2f1d7dd0c67d8..374a5e729a2a644058b6f8d6292ad534084023cb 100644 (file)
@@ -174,7 +174,10 @@ FILE *bt_open_memstream(char **ptr, size_t *sizeloc)
 }
 
 static inline
-int bt_close_memstream(char **buf, size_t *size, FILE *fp)
+int bt_close_memstream(
+               char **buf __attribute__((unused)),
+               size_t *size __attribute__((unused)),
+               FILE *fp)
 {
        return fclose(fp);
 }
@@ -194,7 +197,8 @@ int bt_close_memstream(char **buf, size_t *size, FILE *fp)
  * into the buffer (which we allocate).
  */
 static inline
-FILE *bt_open_memstream(char **ptr, size_t *sizeloc)
+FILE *bt_open_memstream(char **ptr __attribute__((unused)),
+               size_t *sizeloc __attribute__((unused)))
 {
        char *tmpname;
        FILE *fp;
@@ -224,6 +228,8 @@ error_free:
 
 #else /* __MINGW32__ */
 
+#include <unistd.h>
+
 /*
  * Fallback for systems which don't have open_memstream. Create FILE *
  * with bt_open_memstream, but require call to
@@ -231,7 +237,8 @@ error_free:
  * into the buffer (which we allocate).
  */
 static inline
-FILE *bt_open_memstream(char **ptr, size_t *sizeloc)
+FILE *bt_open_memstream(char **ptr __attribute__((unused)),
+               size_t *sizeloc __attribute__((unused)))
 {
        char *tmpname;
        int ret;
@@ -297,7 +304,7 @@ int bt_close_memstream(char **buf, size_t *size, FILE *fp)
        }
        *size = pos;
        /* add final \0 */
-       *buf = calloc(pos + 1, sizeof(char));
+       *buf = (char *) calloc(pos + 1, sizeof(char));
        if (!*buf) {
                return -ENOMEM;
        }
This page took 0.029625 seconds and 4 git commands to generate.