Add compiler warning flag -Wextra and fix related warnings.

Note: some of these warnings are enabled by a combination of -Wunused
(added earlier) and -Wextra.

Cherry-picked from aomedia/master: 4790a69

Change-Id: I322a1366bd4fd6c0dec9e758c2d5e88e003b1cbf
This commit is contained in:
Urvang Joshi
2016-07-14 12:33:48 -07:00
parent bffc0b5748
commit d71a231c49
21 changed files with 85 additions and 48 deletions

View File

@@ -191,8 +191,7 @@ static void find_mismatch(const aom_image_t *const img1,
}
static void testing_decode(aom_codec_ctx_t *encoder, aom_codec_ctx_t *decoder,
aom_codec_enc_cfg_t *cfg, unsigned int frame_out,
int *mismatch_seen) {
unsigned int frame_out, int *mismatch_seen) {
aom_image_t enc_img, dec_img;
struct av1_ref_frame ref_enc, ref_dec;
@@ -226,11 +225,10 @@ static void testing_decode(aom_codec_ctx_t *encoder, aom_codec_ctx_t *decoder,
aom_img_free(&dec_img);
}
static int encode_frame(aom_codec_ctx_t *ecodec, aom_codec_enc_cfg_t *cfg,
aom_image_t *img, unsigned int frame_in,
AvxVideoWriter *writer, int test_decode,
aom_codec_ctx_t *dcodec, unsigned int *frame_out,
int *mismatch_seen) {
static int encode_frame(aom_codec_ctx_t *ecodec, aom_image_t *img,
unsigned int frame_in, AvxVideoWriter *writer,
int test_decode, aom_codec_ctx_t *dcodec,
unsigned int *frame_out, int *mismatch_seen) {
int got_pkts = 0;
aom_codec_iter_t iter = NULL;
const aom_codec_cx_pkt_t *pkt = NULL;
@@ -271,7 +269,7 @@ static int encode_frame(aom_codec_ctx_t *ecodec, aom_codec_enc_cfg_t *cfg,
// Mismatch checking
if (got_data && test_decode) {
testing_decode(ecodec, dcodec, cfg, *frame_out, mismatch_seen);
testing_decode(ecodec, dcodec, *frame_out, mismatch_seen);
}
return got_pkts;
@@ -280,12 +278,12 @@ static int encode_frame(aom_codec_ctx_t *ecodec, aom_codec_enc_cfg_t *cfg,
int main(int argc, char **argv) {
FILE *infile = NULL;
// Encoder
aom_codec_ctx_t ecodec = { 0 };
aom_codec_enc_cfg_t cfg = { 0 };
aom_codec_ctx_t ecodec;
aom_codec_enc_cfg_t cfg;
unsigned int frame_in = 0;
aom_image_t raw;
aom_codec_err_t res;
AvxVideoInfo info = { 0 };
AvxVideoInfo info;
AvxVideoWriter *writer = NULL;
const AvxInterface *encoder = NULL;
@@ -311,6 +309,12 @@ int main(int argc, char **argv) {
unsigned int limit = 0;
exec_name = argv[0];
// Clear explicitly, as simply assigning "{ 0 }" generates
// "missing-field-initializers" warning in some compilers.
memset(&ecodec, 0, sizeof(ecodec));
memset(&cfg, 0, sizeof(cfg));
memset(&info, 0, sizeof(info));
if (argc < 7) die("Invalid number of arguments");
codec_arg = argv[1];
@@ -404,7 +408,7 @@ int main(int argc, char **argv) {
}
}
encode_frame(&ecodec, &cfg, &raw, frame_in, writer, test_decode, &dcodec,
encode_frame(&ecodec, &raw, frame_in, writer, test_decode, &dcodec,
&frame_out, &mismatch_seen);
frame_in++;
if (mismatch_seen) break;
@@ -412,8 +416,8 @@ int main(int argc, char **argv) {
// Flush encoder.
if (!mismatch_seen)
while (encode_frame(&ecodec, &cfg, NULL, frame_in, writer, test_decode,
&dcodec, &frame_out, &mismatch_seen)) {
while (encode_frame(&ecodec, NULL, frame_in, writer, test_decode, &dcodec,
&frame_out, &mismatch_seen)) {
}
printf("\n");