]> granicus.if.org Git - handbrake/commitdiff
Fix gcc 9 compiler warnings
authorJohn Stebbins <jstebbins.hb@gmail.com>
Wed, 19 Jun 2019 21:13:14 +0000 (14:13 -0700)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Fri, 28 Jun 2019 19:06:03 +0000 (12:06 -0700)
gcc 9 is quite a lot chattier and clutters the build log with useless
information :\

contrib/ffmpeg/A01-avutil-mem-Fix-invalid-use-of-av_alloc_size.patch [new file with mode: 0644]
gtk/module.rules
libhb/decavcodec.c
libhb/dvd.c
libhb/dvdnav.c
make/include/gcc.defs

diff --git a/contrib/ffmpeg/A01-avutil-mem-Fix-invalid-use-of-av_alloc_size.patch b/contrib/ffmpeg/A01-avutil-mem-Fix-invalid-use-of-av_alloc_size.patch
new file mode 100644 (file)
index 0000000..e6fe7c1
--- /dev/null
@@ -0,0 +1,33 @@
+From 4361293fcf59edb56879c36edcd25f0a91e0edf8 Mon Sep 17 00:00:00 2001
+From: Mark Harris <mark.hsj@gmail.com>
+Date: Sat, 24 Nov 2018 13:02:02 -0800
+Subject: [PATCH] avutil/mem: Fix invalid use of av_alloc_size
+
+The alloc_size attribute is valid only on functions that return a
+pointer.  GCC 9 (not yet released) warns about invalid usage:
+
+./libavutil/mem.h:342:1: warning: 'alloc_size' attribute ignored on a function returning int' [-Wattributes]
+  342 | av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
+      | ^~~~~~~~~~~~~
+
+Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
+---
+ libavutil/mem.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libavutil/mem.h b/libavutil/mem.h
+index 55ae573ac9..5fb1a02dd9 100644
+--- a/libavutil/mem.h
++++ b/libavutil/mem.h
+@@ -339,7 +339,7 @@ av_alloc_size(2, 3) void *av_realloc_array(void *ptr, size_t nmemb, size_t size)
+  * @warning Unlike av_malloc(), the allocated memory is not guaranteed to be
+  *          correctly aligned.
+  */
+-av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
++int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
+ /**
+  * Reallocate the given buffer if it is not large enough, otherwise do nothing.
+-- 
+2.21.0
+
index 09d99b4666254b07e856e8469c34363cbb624bf6..579f4d08a23b98558be513e69740440f3d4ddfbb 100644 (file)
@@ -19,7 +19,7 @@ $(GTK.CONFIGURE.stamp): $(GTK.src/)configure.ac $(GTK.src/)src/Makefile.am
                PKG_CONFIG_PATH=$(BUILD/)contrib/lib/pkgconfig:$(PKG_CONFIG_PATH) \
                CC="$(GCC.gcc)" \
                CXX="$(GCC.gxx)" \
-               CFLAGS="$(call fn.ARGS,GTK.GCC,.g .O *D ?extra)" \
+               CFLAGS="$(call fn.ARGS,GTK.GCC,.g .O *D *W ?extra)" \
                LDFLAGS="$(call fn.ARGS,GTK.GCC,?strip .g .O ?extra.exe)" \
                PYTHON="$(PYTHON.exe)" \
                --prefix=$(PREFIX) \
index 34006636410396fdf20f1068cc3aa676b5c3dcbf..0b851e842b354e5390858aa4349215e7fd578bbe 100644 (file)
@@ -418,7 +418,7 @@ static void audioParserFlush(hb_work_object_t * w)
     hb_work_private_t * pv = w->private_data;
     uint8_t * pout = NULL;
     int       pout_len = 0;
-    int64_t   parser_pts;
+    int64_t   parser_pts = AV_NOPTS_VALUE;
 
     do
     {
@@ -1647,7 +1647,8 @@ static void videoParserFlush(hb_work_object_t * w)
     int       result;
     uint8_t * pout = NULL;
     int       pout_len = 0;
-    int64_t   parser_pts, parser_dts;
+    int64_t   parser_pts = AV_NOPTS_VALUE;
+    int64_t   parser_dts = AV_NOPTS_VALUE;
 
     do
     {
index 5708934bfa93aa96cd93ab8bb904a161d53fd200..12611d3977801bfa3fc7bd4b809c3b6ca9a3879a 100644 (file)
@@ -175,7 +175,7 @@ static int hb_dvdread_title_count( hb_dvd_t * e )
 
 static void add_subtitle( hb_list_t * list_subtitle, int position,
                           iso639_lang_t * lang, int lang_extension,
-                          uint32_t * palette, int style )
+                          uint8_t * palette, int style )
 {
     hb_subtitle_t * subtitle;
     int ii, count;
@@ -616,8 +616,8 @@ static hb_title_t * hb_dvdread_title_scan( hb_dvd_t * e, int t, uint64_t min_dur
             // Add Wide Screen subtitle.
             pos = (spu_control >> 16) & 0x1F;
             add_subtitle(title->list_subtitle, pos, lang, lang_ext,
-                       vts->vts_pgcit->pgci_srp[pgc_id-1].pgc->palette,
-                       HB_VOBSUB_STYLE_WIDE);
+                (uint8_t*)vts->vts_pgcit->pgci_srp[pgc_id-1].pgc->palette,
+                HB_VOBSUB_STYLE_WIDE);
 
             // permitted_df
             // 1 - Letterbox not permitted
@@ -628,24 +628,24 @@ static hb_title_t * hb_dvdread_title_scan( hb_dvd_t * e, int t, uint64_t min_dur
                 // Letterbox permitted.  Add Letterbox subtitle.
                 pos = (spu_control >> 8) & 0x1F;
                 add_subtitle(title->list_subtitle, pos, lang, lang_ext,
-                           vts->vts_pgcit->pgci_srp[pgc_id-1].pgc->palette,
-                           HB_VOBSUB_STYLE_LETTERBOX);
+                    (uint8_t*)vts->vts_pgcit->pgci_srp[pgc_id-1].pgc->palette,
+                    HB_VOBSUB_STYLE_LETTERBOX);
             }
             if (!(vts->vtsi_mat->vts_video_attr.permitted_df & 2))
             {
                 // Pan&Scan permitted.  Add Pan&Scan subtitle.
                 pos = spu_control & 0x1F;
                 add_subtitle(title->list_subtitle, pos, lang, lang_ext,
-                           vts->vts_pgcit->pgci_srp[pgc_id-1].pgc->palette,
-                           HB_VOBSUB_STYLE_PANSCAN);
+                    (uint8_t*)vts->vts_pgcit->pgci_srp[pgc_id-1].pgc->palette,
+                    HB_VOBSUB_STYLE_PANSCAN);
             }
         }
         else
         {
             pos = (spu_control >> 24) & 0x1F;
             add_subtitle(title->list_subtitle, pos, lang, lang_ext,
-                       vts->vts_pgcit->pgci_srp[pgc_id-1].pgc->palette,
-                       HB_VOBSUB_STYLE_4_3);
+                (uint8_t*)vts->vts_pgcit->pgci_srp[pgc_id-1].pgc->palette,
+                HB_VOBSUB_STYLE_4_3);
         }
     }
 
index 9eb5534ed9b4ab58bc8265404172a7fc82981bb2..6e165024b4a9e98481a928a36fc99f75e227d6b6 100644 (file)
@@ -319,7 +319,7 @@ PttDuration(ifo_handle_t *ifo, int ttn, int pttn, int *blocks, int *last_pgcn)
 
 static void add_subtitle( hb_list_t * list_subtitle, int position,
                           iso639_lang_t * lang, int lang_extension,
-                          uint32_t * palette, int style )
+                          uint8_t * palette, int style )
 {
     hb_subtitle_t * subtitle;
     int ii, count;
@@ -797,8 +797,8 @@ static hb_title_t * hb_dvdnav_title_scan( hb_dvd_t * e, int t, uint64_t min_dura
             // Add Wide Screen subtitle.
             pos = (spu_control >> 16) & 0x1F;
             add_subtitle(title->list_subtitle, pos, lang, lang_ext,
-                       ifo->vts_pgcit->pgci_srp[title_pgcn-1].pgc->palette,
-                       HB_VOBSUB_STYLE_WIDE);
+                (uint8_t*)ifo->vts_pgcit->pgci_srp[title_pgcn-1].pgc->palette,
+                HB_VOBSUB_STYLE_WIDE);
 
             // permitted_df
             // 1 - Letterbox not permitted
@@ -809,24 +809,24 @@ static hb_title_t * hb_dvdnav_title_scan( hb_dvd_t * e, int t, uint64_t min_dura
                 // Letterbox permitted.  Add Letterbox subtitle.
                 pos = (spu_control >> 8) & 0x1F;
                 add_subtitle(title->list_subtitle, pos, lang, lang_ext,
-                           ifo->vts_pgcit->pgci_srp[title_pgcn-1].pgc->palette,
-                           HB_VOBSUB_STYLE_LETTERBOX);
+                    (uint8_t*)ifo->vts_pgcit->pgci_srp[title_pgcn-1].pgc->palette,
+                    HB_VOBSUB_STYLE_LETTERBOX);
             }
             if (!(ifo->vtsi_mat->vts_video_attr.permitted_df & 2))
             {
                 // Pan&Scan permitted.  Add Pan&Scan subtitle.
                 pos = spu_control & 0x1F;
                 add_subtitle(title->list_subtitle, pos, lang, lang_ext,
-                           ifo->vts_pgcit->pgci_srp[title_pgcn-1].pgc->palette,
-                           HB_VOBSUB_STYLE_PANSCAN);
+                    (uint8_t*)ifo->vts_pgcit->pgci_srp[title_pgcn-1].pgc->palette,
+                    HB_VOBSUB_STYLE_PANSCAN);
             }
         }
         else
         {
             pos = (spu_control >> 24) & 0x1F;
             add_subtitle(title->list_subtitle, pos, lang, lang_ext,
-                       ifo->vts_pgcit->pgci_srp[title_pgcn-1].pgc->palette,
-                           HB_VOBSUB_STYLE_4_3);
+                (uint8_t*)ifo->vts_pgcit->pgci_srp[title_pgcn-1].pgc->palette,
+                HB_VOBSUB_STYLE_4_3);
         }
     }
 
index bd2d82dd0d732559f9862a4f81f56b0c752efd5f..e670c8cd975ebfad3711b1bbc4596f2664dccdca 100644 (file)
@@ -8,7 +8,7 @@ GCC.c_std   = 1
 GCC.cxx_std = 0
 GCC.ML      = 1
 GCC.H       = 0
-GCC.W       = all
+GCC.W       = all no-format-truncation
 GCC.archs   =
 GCC.sysroot =
 GCC.minver  =