Commit d8b179e2 authored by Filip Roséen's avatar Filip Roséen Committed by Jean-Baptiste Kempf

mkv: Introduced MKV_CHECKED_PTR_DECL

`MKV_IS_ID` is a macro to check whether the object hiding behind a pointer
has a certain dynamic type and it is being used all over the module.

There are however a lot of cases that is followed by a static_cast to the
appropriate type; `MKV_CHECKED_PTR_DECL` has been introduced to shorten
code that has such usage.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <>
parent 553febf4
......@@ -112,6 +112,7 @@ enum
#define MKVD_TIMECODESCALE 1000000
#define MKV_IS_ID( el, C ) ( el != NULL && typeid( *el ) == typeid( C ) )
#define MKV_CHECKED_PTR_DECL( name, type, src ) type * name = MKV_IS_ID(src, type) ? static_cast<type*>(src) : NULL
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment