Merge branch 'refs/heads/t/format-signedness'
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 28 Dec 2016 19:38:34 +0000 (20:38 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Wed, 28 Dec 2016 19:42:12 +0000 (20:42 +0100)
This series fixes all warnings produced by compiling with
-Wformat-signedness and adds the flag to CFLAGS if the compiler
supports it.

* refs/heads/t/format-signedness (cooking for ~2 weeks):
  gcrypt: Fix a few format-signedness issues.
  Compile with -Wformat-signedness if possible.
  Fix signedness issues in format strings.

13 files changed:
1  2 
NEWS.md
aac_afh.c
aac_common.c
aacdec_filter.c
afs.c
aft.c
crypt_common.c
fade.c
gcrypt.c
play.c
server.c
wma_common.c
wmadec_filter.c

diff --cc NEWS.md
+++ b/NEWS.md
@@@ -1,22 -1,6 +1,23 @@@
  NEWS
  ====
  
 +------------------------------------------
 +0.5.7 (to be announced) "semantic density"
 +------------------------------------------
 +- Speedup of the base64 decoder.
 +- One of the two source browsers has been removed from the web pages.
 +  The doxygen API reference still contains an HTML version of each
 +  source file.
 +- Two race conditions in para_server have been fixed.
 +- ls -p is now deprecated in favor of -F or -b. See the help text of
 +  the ls command for details.
 +- The openssl code has been adjusted to work also with openssl-1.1.
 +- The wma decoder and audio format handler now correctly decodes
 +  files with unusual block sizes.
++- We now compile with -Wformat-signedness if possible.
 +
 +Download: [tarball](./releases/paraslash-git.tar.bz2)
 +
  ---------------------------------------
  0.5.6 (2016-07-10) "cascading gradient"
  ---------------------------------------
diff --cc aac_afh.c
+++ b/aac_afh.c
@@@ -33,12 -32,12 +33,12 @@@ static int aac_find_stsz(char *buf, siz
                        continue;
                PARA_DEBUG_LOG("found stsz@%d\n", i);
                i += 8;
 -              sample_size = aac_read_int32(buf + i);
 +              sample_size = read_u32_be(buf + i);
-               PARA_DEBUG_LOG("sample size: %d\n", sample_size);
+               PARA_DEBUG_LOG("sample size: %u\n", sample_size);
                i += 4;
 -              sample_count = aac_read_int32(buf + i);
 +              sample_count = read_u32_be(buf + i);
                i += 4;
-               PARA_DEBUG_LOG("sample count: %d\n", sample_count);
+               PARA_DEBUG_LOG("sample count: %u\n", sample_count);
                *skip = i;
                return sample_count;
        }
diff --cc aac_common.c
@@@ -73,18 -72,18 +73,18 @@@ int aac_find_esds(char *buf, size_t buf
                        continue;
                i += 8;
                p = buf + i;
--              PARA_INFO_LOG("found esds@%zu, next: %x\n", i, *p);
++              PARA_INFO_LOG("found esds@%zu, next: %x\n", i, (unsigned)*p);
                if (*p == 3)
                        i += 8;
                else
                        i += 6;
                p = buf + i;
--              PARA_INFO_LOG("next: %x\n", *p);
++              PARA_INFO_LOG("next: %x\n", (unsigned)*p);
                if (*p != 4)
                        continue;
                i += 18;
                p = buf + i;
--              PARA_INFO_LOG("next: %x\n", *p);
++              PARA_INFO_LOG("next: %x\n", (unsigned)*p);
                if (*p != 5)
                        continue;
                i++;
diff --cc aacdec_filter.c
Simple merge
diff --cc afs.c
Simple merge
diff --cc aft.c
Simple merge
diff --cc crypt_common.c
Simple merge
diff --cc fade.c
Simple merge
diff --cc gcrypt.c
Simple merge
diff --cc play.c
Simple merge
diff --cc server.c
Simple merge
diff --cc wma_common.c
@@@ -42,17 -42,6 +42,17 @@@ const char *search_pattern(const char *
        return NULL;
  }
  
-       PARA_DEBUG_LOG("found file property guid@%0x\n", (int)(p - buf));
 +static int find_file_properties(const char *buf, int len)
 +{
 +      const char pattern[] = {0xa1, 0xdc, 0xab, 0x8c};
 +      const char *p = search_pattern(pattern, sizeof(pattern), buf, len);
 +
 +      if (!p)
 +              return -E_WMA_NO_GUID;
++      PARA_DEBUG_LOG("found file property guid@%0x\n", (unsigned)(p - buf));
 +      return p - buf + 16;
 +}
 +
  /*
     40 9e 69 f8 4d 5b cf 11  a8 fd 00 80 5f 5c 44 2b
   */
@@@ -118,7 -107,7 +118,7 @@@ int read_asf_header(const char *buf, in
  
        ahi->flags1 = read_u32(start + 56);
        ahi->flags2 = read_u16(start + 60);
-       PARA_INFO_LOG("read_asf_header: flags1: %d, flags2: %d\n",
 -      PARA_INFO_LOG("read_asf_header: flags1: %u, flag2: %u\n",
++      PARA_INFO_LOG("read_asf_header: flags1: %u, flags2: %u\n",
                ahi->flags1, ahi->flags2);
        ahi->use_exp_vlc = ahi->flags2 & 0x0001;
        ahi->use_bit_reservoir = ahi->flags2 & 0x0002;
diff --cc wmadec_filter.c
Simple merge