• Andreas Rheinhardt's avatar
    avcodec/vlc: Use structure instead of VLC_TYPE array as VLC element · 2d764069
    Andreas Rheinhardt authored
    In C, qualifiers for arrays are broken:
    const VLC_TYPE (*foo)[2] is a pointer to an array of two const VLC_TYPE
    elements and unfortunately this is not compatible with a pointer
    to a const array of two VLC_TYPE, because the latter does not exist
    as array types are never qualified (the qualifier applies to the base
    type instead). This is the reason why get_vlc2() doesn't accept
    a const VLC table despite not modifying the table at all, as
    there is no automatic conversion from VLC_TYPE (*)[2] to
    const VLC_TYPE (*)[2].
    
    Fix this by using a structure VLCElem for the VLC table.
    This also has the advantage of making it clear which
    element is which.
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
    2d764069
faxcompr.c 15.7 KB