From: Oleg Oshmyan Date: Wed, 28 Oct 2015 22:19:20 +0000 (+0200) Subject: fontselect: silence warnings about discarding const X-Git-Tag: 0.13.1~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bf8524fe5c8eb20c03f0732c3c782a330e97594e;p=libass fontselect: silence warnings about discarding const Fixing this properly involves constifying ASS_FontProviderMetaData and refactoring code that allocates and frees strings stored in it. This seems easy on the surface but turns out to be nontrivial when you actually try to do it. This may still be done at a later date, but for now, just add explicit casts. --- diff --git a/libass/ass_fontselect.c b/libass/ass_fontselect.c index 2259265..e4be338 100644 --- a/libass/ass_fontselect.c +++ b/libass/ass_fontselect.c @@ -603,7 +603,7 @@ static char *select_font(ASS_FontSelector *priv, ASS_Library *library, ASS_FontProviderMetaData default_meta = { .n_fullname = 1, - .fullnames = &family, + .fullnames = (char **)&family, }; // Get a list of substitutes if applicable, and use it for matching. @@ -787,7 +787,7 @@ get_font_info(FT_Library lib, FT_Face face, ASS_FontProviderMetaData *info) info->weight = weight; info->width = 100; // FIXME, should probably query the OS/2 table - info->postscript_name = FT_Get_Postscript_Name(face); + info->postscript_name = (char *)FT_Get_Postscript_Name(face); info->is_postscript = !FT_Get_PS_Font_Info(face, &postscript_info); info->families = calloc(sizeof(char *), num_family);