[vlc-commits] ttml: remove bogus casts
Rémi Denis-Courmont
git at videolan.org
Sun Apr 30 18:21:13 CEST 2017
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Apr 30 19:14:51 2017 +0300| [bebc99b7daf18274eff7f5d328da5610a3ce7f5f] | committer: Rémi Denis-Courmont
ttml: remove bogus casts
ptrdiff_t is the result type for a substraction of pointers, not the
operands type for the substraction. The cast made no sense.
To convert pointers to signed integers, intptr_t shall be used. But
there is no point in casting here: equality and inequality are always
well-defined for valid and/or NULL pointers.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bebc99b7daf18274eff7f5d328da5610a3ce7f5f
---
modules/demux/ttml.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/demux/ttml.c b/modules/demux/ttml.c
index 1d136bd701..6e9fc8e327 100644
--- a/modules/demux/ttml.c
+++ b/modules/demux/ttml.c
@@ -432,7 +432,7 @@ int OpenDemux( vlc_object_t* p_this )
/* Simplified probing. Valid TTML must have a namespace declaration */
const char *psz_tt = strnstr( psz_xml, "tt ", i_xml );
- if( !psz_tt || (ptrdiff_t)psz_tt == (ptrdiff_t)psz_xml ||
+ if( !psz_tt || psz_tt == psz_xml ||
(psz_tt[-1] != ':' && psz_tt[-1] != '<') )
{
free( psz_alloc );
More information about the vlc-commits
mailing list