Make return value mutable

Changes the return mutability for pgpu_glyph_provider_get()
This commit is contained in:
Chad Brokaw 2022-05-10 03:59:31 -04:00
parent 532b6ee808
commit 3ff87c88a7
2 changed files with 3 additions and 3 deletions

View file

@ -118,7 +118,7 @@ PgpuGlyphProvider *pgpu_glyph_provider_new(PgpuGlyphContext *gcx, const PgpuFont
/// Returns an encoded outline for the specified glyph provider and glyph id.
/// May return nullptr if the requested glyph is not available.
const PgpuGlyph *pgpu_glyph_provider_get(PgpuGlyphProvider *provider, uint16_t gid);
PgpuGlyph *pgpu_glyph_provider_get(PgpuGlyphProvider *provider, uint16_t gid);
/// Returns an encoded color outline for the specified glyph provider, color
/// palette index and glyph id. May return nullptr if the requested glyph is

View file

@ -172,11 +172,11 @@ pub unsafe extern "C" fn pgpu_glyph_provider_new(
pub unsafe extern "C" fn pgpu_glyph_provider_get(
provider: *mut PgpuGlyphProvider,
gid: u16,
) -> *const PgpuGlyph {
) -> *mut PgpuGlyph {
if let Some(glyph) = (*provider).get(gid) {
Box::into_raw(Box::new(glyph))
} else {
std::ptr::null()
std::ptr::null_mut()
}
}