Chen-tao / webm

Automatically exported from code.google.com/p/webm
0 stars 0 forks source link

IWYU: vp8.h should include vpx_codec.h or more specific headers #598

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
At the very least, vp8.h uses types from vpx_image.h and macros from 
internal/vpx_codec_internal.h -- this causes compilation errors for clients if 
headers aren't included in the right order.  These headers should include what 
they use to avoid subtle compilation problems:

E.g., alphabetizing the headers in examples/decoder_tmpl.c causes the all 
target to fail:

$ git diff
diff --git a/examples/decoder_tmpl.c b/examples/decoder_tmpl.c
index 597fea2..3181aee 100644
--- a/examples/decoder_tmpl.c
+++ b/examples/decoder_tmpl.c
@@ -18,8 +18,8 @@
 #include <stdarg.h>
 #include <string.h>
 #define VPX_CODEC_DISABLE_COMPAT 1
-#include "vpx/vpx_decoder.h"
 #include "vpx/vp8dx.h"
+#include "vpx/vpx_decoder.h"
 #define interface (vpx_codec_vp8_dx())
 @EXTRA_INCLUDES

$ make all -j 64
make[1]: Nothing to be done for `all'.
    [LD] vpxdec
    [LD] vp8_scalable_patterns
    [LD] vpxenc
    [CC] postproc.c.o
    [CC] simple_decoder.c.o
    [LD] simple_encoder
    [CC] decode_to_md5.c.o
    [LD] force_keyframe
    [LD] twopass_encoder
    [CC] decode_with_drops.c.o
    [LD] error_resilient
    [LD] vp8_set_maps
    [LD] vp8cx_set_ref
In file included from decode_with_drops.c:23:
In file included from ./vpx/vp8dx.h:12:
./vpx/vp8.h:103:3: error: unknown type name 'vpx_image_t'
  vpx_image_t           img;          /**< reference frame data in image format */
  ^
./vpx/vp8.h:108:3: error: unknown type name 'vpx_image_t'
  vpx_image_t  img; /**< img structure to populate (output) */
  ^
./vpx/vp8.h:116:48: error: unexpected type name 'vpx_ref_frame_t': expected 
identifier
VPX_CTRL_USE_TYPE(VP8_SET_REFERENCE,           vpx_ref_frame_t *)

<snip>

Original issue reported on code.google.com by dalecurtis@chromium.org on 9 Aug 2013 at 6:26

GoogleCodeExporter commented 8 years ago

Original comment by fgalli...@google.com on 17 Oct 2013 at 10:12

GoogleCodeExporter commented 8 years ago

Original comment by ya...@google.com on 17 Oct 2013 at 11:10

GoogleCodeExporter commented 8 years ago
proposing a fix here:
https://gerrit.chromium.org/gerrit/#/c/67549/

Original comment by ya...@google.com on 18 Oct 2013 at 1:00

GoogleCodeExporter commented 8 years ago

Original comment by ya...@google.com on 4 Apr 2014 at 12:45