]> granicus.if.org Git - libass/commitdiff
fontselect: silence warnings about discarding const
authorOleg Oshmyan <chortos@inbox.lv>
Wed, 28 Oct 2015 22:19:20 +0000 (00:19 +0200)
committerOleg Oshmyan <chortos@inbox.lv>
Wed, 28 Oct 2015 22:20:51 +0000 (00:20 +0200)
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.

libass/ass_fontselect.c

index 2259265d67f44ad4fae4c9786fa1e5bc3fd87f96..e4be338dc1b9443625b0ad1282256949e611f08c 100644 (file)
@@ -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);