diff options
author | Gabriel Dume | 2014-08-14 16:31:25 -0400 |
---|---|---|
committer | Diego Biurrun | 2014-08-15 05:34:13 -0700 |
commit | 4b1f5e5090abed6c618c8ba380cd7d28d140f867 (patch) | |
tree | d5281695ec758c21ed6c0df8e3c03433bca28d18 /libavcodec/qdm2.c | |
parent | f929ab0569ff31ed5a59b0b0adb7ce09df3fca39 (diff) |
cosmetics: Write NULL pointer inequality checks more compactly
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavcodec/qdm2.c')
-rw-r--r-- | libavcodec/qdm2.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index 3041182e25..94bda9169a 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -455,7 +455,7 @@ static void qdm2_decode_sub_packet_header(GetBitContext *gb, static QDM2SubPNode *qdm2_search_subpacket_type_in_list(QDM2SubPNode *list, int type) { - while (list != NULL && list->packet != NULL) { + while (list && list->packet) { if (list->packet->type == type) return list; list = list->next; @@ -1211,23 +1211,23 @@ static void process_synthesis_subpackets(QDM2Context *q, QDM2SubPNode *list) QDM2SubPNode *nodes[4]; nodes[0] = qdm2_search_subpacket_type_in_list(list, 9); - if (nodes[0] != NULL) + if (nodes[0]) process_subpacket_9(q, nodes[0]); nodes[1] = qdm2_search_subpacket_type_in_list(list, 10); - if (nodes[1] != NULL) + if (nodes[1]) process_subpacket_10(q, nodes[1]); else process_subpacket_10(q, NULL); nodes[2] = qdm2_search_subpacket_type_in_list(list, 11); - if (nodes[0] != NULL && nodes[1] != NULL && nodes[2] != NULL) + if (nodes[0] && nodes[1] && nodes[2]) process_subpacket_11(q, nodes[2]); else process_subpacket_11(q, NULL); nodes[3] = qdm2_search_subpacket_type_in_list(list, 12); - if (nodes[0] != NULL && nodes[1] != NULL && nodes[3] != NULL) + if (nodes[0] && nodes[1] && nodes[3]) process_subpacket_12(q, nodes[3]); else process_subpacket_12(q, NULL); @@ -1352,7 +1352,7 @@ static void qdm2_decode_super_block(QDM2Context *q) } } // Packet bytes loop - if (q->sub_packet_list_D[0].packet != NULL) { + if (q->sub_packet_list_D[0].packet) { process_synthesis_subpackets(q, q->sub_packet_list_D); q->do_synth_filter = 1; } else if (q->do_synth_filter) { @@ -1939,7 +1939,7 @@ static int qdm2_decode(QDM2Context *q, const uint8_t *in, int16_t *out) for (ch = 0; ch < q->channels; ch++) { qdm2_calculate_fft(q, ch, q->sub_packet); - if (!q->has_errors && q->sub_packet_list_C[0].packet != NULL) { + if (!q->has_errors && q->sub_packet_list_C[0].packet) { SAMPLES_NEEDED_2("has errors, and C list is not empty") return -1; } |