diff options
author | Gabriel Dume <gabriel.ddx84@gmail.com> | 2014-08-14 16:31:25 -0400 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2014-08-15 05:34:13 -0700 |
commit | 4b1f5e5090abed6c618c8ba380cd7d28d140f867 (patch) | |
tree | d5281695ec758c21ed6c0df8e3c03433bca28d18 /libavformat | |
parent | f929ab0569ff31ed5a59b0b0adb7ce09df3fca39 (diff) | |
download | ffmpeg-4b1f5e5090abed6c618c8ba380cd7d28d140f867.tar.gz |
cosmetics: Write NULL pointer inequality checks more compactly
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/avio.c | 2 | ||||
-rw-r--r-- | libavformat/format.c | 4 | ||||
-rw-r--r-- | libavformat/http.c | 2 | ||||
-rw-r--r-- | libavformat/matroskadec.c | 6 | ||||
-rw-r--r-- | libavformat/movenc.c | 2 | ||||
-rw-r--r-- | libavformat/rtmpproto.c | 2 | ||||
-rw-r--r-- | libavformat/segment.c | 2 | ||||
-rw-r--r-- | libavformat/tls.c | 2 | ||||
-rw-r--r-- | libavformat/url.c | 2 |
9 files changed, 12 insertions, 12 deletions
diff --git a/libavformat/avio.c b/libavformat/avio.c index 80863da9e3..7f6449c087 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -98,7 +98,7 @@ int ffurl_register_protocol(URLProtocol *protocol) { URLProtocol **p; p = &first_protocol; - while (*p != NULL) + while (*p) p = &(*p)->next; *p = protocol; protocol->next = NULL; diff --git a/libavformat/format.c b/libavformat/format.c index bdc90446fa..c5a57d5451 100644 --- a/libavformat/format.c +++ b/libavformat/format.c @@ -56,7 +56,7 @@ void av_register_input_format(AVInputFormat *format) { AVInputFormat **p = &first_iformat; - while (*p != NULL) + while (*p) p = &(*p)->next; *p = format; @@ -67,7 +67,7 @@ void av_register_output_format(AVOutputFormat *format) { AVOutputFormat **p = &first_oformat; - while (*p != NULL) + while (*p) p = &(*p)->next; *p = format; diff --git a/libavformat/http.c b/libavformat/http.c index e970786312..f82002cb86 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -151,7 +151,7 @@ static int http_open_cnx_internal(URLContext *h, AVDictionary **options) proxy_path = getenv("http_proxy"); use_proxy = !ff_http_match_no_proxy(getenv("no_proxy"), hostname) && - proxy_path != NULL && av_strstart(proxy_path, "http://", NULL); + proxy_path && av_strstart(proxy_path, "http://", NULL); if (!strcmp(proto, "https")) { lower_proto = "tls"; diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index b168bdf9a6..42204a4acf 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1583,7 +1583,7 @@ static int matroska_parse_tracks(AVFormatContext *s) if (!strcmp(track->codec_id, "V_MS/VFW/FOURCC") && track->codec_priv.size >= 40 && - track->codec_priv.data != NULL) { + track->codec_priv.data) { track->ms_compat = 1; track->video.fourcc = AV_RL32(track->codec_priv.data + 16); codec_id = ff_codec_get_id(ff_codec_bmp_tags, @@ -1591,7 +1591,7 @@ static int matroska_parse_tracks(AVFormatContext *s) extradata_offset = 40; } else if (!strcmp(track->codec_id, "A_MS/ACM") && track->codec_priv.size >= 14 && - track->codec_priv.data != NULL) { + track->codec_priv.data) { int ret; ffio_init_context(&b, track->codec_priv.data, track->codec_priv.size, @@ -1603,7 +1603,7 @@ static int matroska_parse_tracks(AVFormatContext *s) extradata_offset = FFMIN(track->codec_priv.size, 18); } else if (!strcmp(track->codec_id, "V_QUICKTIME") && (track->codec_priv.size >= 86) && - (track->codec_priv.data != NULL)) { + (track->codec_priv.data)) { track->video.fourcc = AV_RL32(track->codec_priv.data); codec_id = ff_codec_get_id(ff_codec_movvideo_tags, track->video.fourcc); diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 72dcf0a725..8af3c3419f 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -3369,7 +3369,7 @@ static int mov_write_header(AVFormatContext *s) /* Default mode == MP4 */ mov->mode = MODE_MP4; - if (s->oformat != NULL) { + if (s->oformat) { if (!strcmp("3gp", s->oformat->name)) mov->mode = MODE_3GP; else if (!strcmp("3g2", s->oformat->name)) mov->mode = MODE_3GP|MODE_3G2; else if (!strcmp("mov", s->oformat->name)) mov->mode = MODE_MOV; diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index de09486dd7..4aaa420dd5 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -375,7 +375,7 @@ static int gen_connect(URLContext *s, RTMPContext *rt) char *param = rt->conn; // Write arbitrary AMF data to the Connect message. - while (param != NULL) { + while (param) { char *sep; param += strspn(param, " "); if (!*param) diff --git a/libavformat/segment.c b/libavformat/segment.c index 3e0eb3960e..9c757e4359 100644 --- a/libavformat/segment.c +++ b/libavformat/segment.c @@ -101,7 +101,7 @@ static int segment_hls_window(AVFormatContext *s, int last) for (i = FFMAX(0, seg->number - seg->size); i < seg->number; i++) { avio_printf(seg->pb, "#EXTINF:%d,\n", (int)seg->time); - if (seg->entry_prefix != NULL) { + if (seg->entry_prefix) { avio_printf(seg->pb, "%s", seg->entry_prefix); } av_get_frame_filename(buf, sizeof(buf), s->filename, i); diff --git a/libavformat/tls.c b/libavformat/tls.c index 1baecf4db0..7c78fda285 100644 --- a/libavformat/tls.c +++ b/libavformat/tls.c @@ -164,7 +164,7 @@ static int tls_open(URLContext *h, const char *uri, int flags) proxy_path = getenv("http_proxy"); use_proxy = !ff_http_match_no_proxy(getenv("no_proxy"), host) && - proxy_path != NULL && av_strstart(proxy_path, "http://", NULL); + proxy_path && av_strstart(proxy_path, "http://", NULL); if (use_proxy) { char proxy_host[200], proxy_auth[200], dest[200]; diff --git a/libavformat/url.c b/libavformat/url.c index eeda1f0297..92cd5f183a 100644 --- a/libavformat/url.c +++ b/libavformat/url.c @@ -111,7 +111,7 @@ void ff_make_absolute_url(char *buf, int size, const char *base, /* Strip off any query string from base */ path_query = strchr(buf, '?'); - if (path_query != NULL) + if (path_query) *path_query = '\0'; /* Is relative path just a new query part? */ |