(wrong string) ée

From: <git_AT_suckless.org>
Date: Wed, 10 May 2017 23:47:39 +0200 (CEST)

commit c22007cc4be9b731d97006b983538388c4b36033
Author: Mattias Andrée <maandree_AT_kth.se>
AuthorDate: Wed May 10 21:36:00 2017 +0200
Commit: Mattias Andrée <maandree_AT_kth.se>
CommitDate: Wed May 10 21:37:20 2017 +0200

    Fix warnings
    
    Signed-off-by: Mattias Andrée <maandree_AT_kth.se>

diff --git a/src/blind-arithm.c b/src/blind-arithm.c
index 1c2c11b..5dc3cd9 100644
--- a/src/blind-arithm.c
+++ b/src/blind-arithm.c
_AT_@ -31,6 +31,11 @@ typedef void (*process_func)(struct stream *left, struct stream *right, size_t n
                         rh = ((TYPE *)(right->buf + i))[CHI],\
                         (ALGO)), 0) : 0)
 
+#if defined(__GNUC__) && !defined(__clang__)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
+#endif
+
 #define X(NAME, ALGO, PIXFMT, TYPE)\
         static void\
         process_##PIXFMT##_##NAME(struct stream *left, struct stream *right, size_t n)\
_AT_@ -48,6 +53,10 @@ LIST_OPERATORS(xyza, double,)
 LIST_OPERATORS(xyzaf, float, f)
 #undef X
 
+#if defined(__GNUC__) && !defined(__clang__)
+# pragma GCC diagnostic pop
+#endif
+
 static process_func
 get_process_xyza(const char *operation)
 {
diff --git a/src/blind-concat.c b/src/blind-concat.c
index f7d31e3..25cf19d 100644
--- a/src/blind-concat.c
+++ b/src/blind-concat.c
_AT_@ -48,7 +48,7 @@ concat_to_file(int argc, char *argv[], char *output_file)
         int fd = eopen(output_file, O_RDWR | O_CREAT | O_TRUNC, 0666);
         char head[STREAM_HEAD_MAX];
         ssize_t headlen;
- size_t size = 0;
+ size_t size;
         off_t pos;
         char *data;
 
_AT_@ -72,9 +72,9 @@ concat_to_file(int argc, char *argv[], char *output_file)
         SPRINTF_HEAD_ZN(head, stream.frames, stream.width, stream.height, stream.pixfmt, &headlen);
         ewriteall(fd, head, (size_t)headlen, output_file);
 
- if ((pos = elseek(fd, 0, SEEK_CUR, output_file)) > SIZE_MAX)
+ size = (size_t)(pos = elseek(fd, 0, SEEK_CUR, output_file));
+ if ((uintmax_t)pos > SIZE_MAX)
                 eprintf("%s\n", strerror(EFBIG));
- size = pos;
 
         data = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
         if (data == MAP_FAILED)
diff --git a/src/util.h b/src/util.h
index 24fc2c4..4f94a88 100644
--- a/src/util.h
+++ b/src/util.h
_AT_@ -6,7 +6,7 @@
 #define MAX(A, B) ((A) > (B) ? (A) : (B))
 #define CLIP(A, B, C) ((B) < (A) ? (A) : (B) > (C) ? (C) : (B))
 #define STRLEN(STR) (sizeof(STR) - 1)
-#define INTSTRLEN(TYPE) ((sizeof(TYPE) == 1 ? 3 : (5 * sizeof(TYPE) / 2)) + ((TYPE)-1 < 0))
+#define INTSTRLEN(TYPE) ((sizeof(TYPE) == 1 ? 3 : (5 * sizeof(TYPE) / 2)) + ((TYPE)-1 < 1))
 
 #define USAGE(SYNOPSIS)\
         static void usage(void)\
Received on Wed May 10 2017 - 23:47:39 CEST

This archive was generated by hypermail 2.3.0 : Wed May 10 2017 - 23:48:29 CEST