Commit 4e1c0e8fba456b2050c672c9c2c876987f03a3e6

Ben Wagner 2023-06-05T11:53:34

Mark FT_Renderer_Class::raster_class as pointer to const The `FT_DEFINE_RASTER_FUNCS` macro declares a `const FT_Raster_Funcs`. The address of the definition is taken and assigned to `FT_Renderer_Class::raster_class` which is currently `FT_Raster_Funcs*`. Until recently the `const` was cast away and with the removal of the cast there are now warnings about dropping this `const`. Instead of adding back the casts, make `FT_Renderer_Class::raster_class` a pointer to const, as is done with pointers in other interfaces. * include/freetype/ftrender.h (FT_Renderer_Class_): mark `raster_class` as const.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/include/freetype/ftrender.h b/include/freetype/ftrender.h
index a8576da..0b6fad3 100644
--- a/include/freetype/ftrender.h
+++ b/include/freetype/ftrender.h
@@ -158,7 +158,7 @@ FT_BEGIN_HEADER
     FT_Renderer_GetCBoxFunc    get_glyph_cbox;
     FT_Renderer_SetModeFunc    set_mode;
 
-    FT_Raster_Funcs*           raster_class;
+    const FT_Raster_Funcs*     raster_class;
 
   } FT_Renderer_Class;