]> granicus.if.org Git - handbrake/commitdiff
fix warnings when compiling with clang.
authorDamiano Galassi <damiog@gmail.com>
Tue, 24 Sep 2019 12:14:29 +0000 (14:14 +0200)
committerDamiano Galassi <galad87@users.noreply.github.com>
Thu, 26 Sep 2019 08:40:53 +0000 (10:40 +0200)
contrib/libdvdread/A01-clang-warnings.patch [new file with mode: 0644]
libhb/encavcodec.c
libhb/stream.c
macosx/HandBrake.xcodeproj/project.pbxproj

diff --git a/contrib/libdvdread/A01-clang-warnings.patch b/contrib/libdvdread/A01-clang-warnings.patch
new file mode 100644 (file)
index 0000000..2ecc2ce
--- /dev/null
@@ -0,0 +1,13 @@
+diff --git a/src/dvdread/ifo_types.h b/src/dvdread/ifo_types.h
+index f679d29..699853f 100644
+--- a/src/dvdread/ifo_types.h
++++ b/src/dvdread/ifo_types.h
+@@ -30,7 +30,7 @@
+ #undef PRAGMA_PACK_BEGIN
+ #undef PRAGMA_PACK_END
+-#if defined(__GNUC__)
++#if defined(__GNUC__) && !defined(__clang__)
+ #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+ #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+ #define ATTRIBUTE_PACKED __attribute__ ((packed,gcc_struct))
\ No newline at end of file
index 1c949249c4e93ceef0ca3601c0bce9f3051c24a9..75c6c679b64fa13ae1d0b418f8669e257ca13ae1 100644 (file)
@@ -863,7 +863,7 @@ static void Encode( hb_work_object_t *w, hb_buffer_t *in,
                     hb_buffer_list_t *list )
 {
     hb_work_private_t * pv = w->private_data;
-    AVFrame             frame = {0};
+    AVFrame             frame = {{0}};
     int                 ret;
 
     frame.width       = in->f.width;
index feb390c07f5da731b9d61564fe20b02588852214..77a09e8b118166ab5936a296fa829dd5294225f5 100644 (file)
@@ -278,8 +278,6 @@ static int ffmpeg_seek_ts( hb_stream_t *stream, int64_t ts );
 static inline unsigned int bits_get(bitbuf_t *bb, int bits);
 static inline void bits_init(bitbuf_t *bb, uint8_t* buf, int bufsize, int clear);
 static inline unsigned int bits_peek(bitbuf_t *bb, int bits);
-static inline int bits_eob(bitbuf_t *bb);
-static inline int bits_read_ue(bitbuf_t *bb );
 static void pes_add_audio_to_title(hb_stream_t *s, int i, hb_title_t *t, int sort);
 static int hb_parse_ps( hb_stream_t *stream, uint8_t *buf, int len, hb_pes_info_t *pes_info );
 static void hb_ts_resolve_pid_types(hb_stream_t *stream);
@@ -2487,11 +2485,6 @@ static inline int bits_bytes_left(bitbuf_t *bb)
     return bb->size - (bb->pos >> 3);
 }
 
-static inline int bits_eob(bitbuf_t *bb)
-{
-    return bb->pos >> 3 == bb->size;
-}
-
 static inline unsigned int bits_peek(bitbuf_t *bb, int bits)
 {
     unsigned int val;
@@ -2551,17 +2544,6 @@ static inline unsigned int bits_get(bitbuf_t *bb, int bits)
     return val;
 }
 
-static inline int bits_read_ue(bitbuf_t *bb )
-{
-    int ii = 0;
-
-    while( bits_get( bb, 1 ) == 0 && !bits_eob( bb ) && ii < 32 )
-    {
-        ii++;
-    }
-    return( ( 1 << ii) - 1 + bits_get( bb, ii ) );
-}
-
 static inline int bits_skip(bitbuf_t *bb, int bits)
 {
     if (bits <= 0)
index aa075fd512a75322329b50f33de9e2e094101433..b9ddabf9e60f519368fa839f3a0afd4bf2085fec 100644 (file)
                                        HBKitLocalizedString,
                                );
                                MACOSX_DEPLOYMENT_TARGET = 10.11;
-                               OTHER_CFLAGS = "-Wno-duplicate-decl-specifier ";
                                OTHER_LDFLAGS = (
                                        "-filelist",
                                        "$(EXTERNAL_BUILD)/macosx/osl.filelist.txt",
                                        HBKitLocalizedString,
                                );
                                MACOSX_DEPLOYMENT_TARGET = 10.11;
-                               OTHER_CFLAGS = "-Wno-duplicate-decl-specifier ";
                                OTHER_LDFLAGS = (
                                        "-filelist",
                                        "$(EXTERNAL_BUILD)/macosx/osl.filelist.txt",
                                        HBKitLocalizedString,
                                );
                                MACOSX_DEPLOYMENT_TARGET = 10.11;
-                               OTHER_CFLAGS = "-Wno-duplicate-decl-specifier ";
                                OTHER_LDFLAGS = (
                                        "-filelist",
                                        "$(EXTERNAL_BUILD)/macosx/osl.filelist.txt",
                                        HBKitLocalizedString,
                                );
                                MACOSX_DEPLOYMENT_TARGET = 10.11;
-                               OTHER_CFLAGS = "-Wno-duplicate-decl-specifier ";
                                OTHER_LDFLAGS = (
                                        "-filelist",
                                        "$(EXTERNAL_BUILD)/macosx/osl.filelist.txt",
                                        "-lc++",
+                                       "-w",
                                );
                                SDKROOT = macosx;
                                SHARED_PRECOMPS_DIR = "$(CONFIGURATION_TEMP_DIR)/PrecompiledHeaders";