From 3ff87c88a7bd3293046e40849a33293782ef85f4 Mon Sep 17 00:00:00 2001 From: Chad Brokaw Date: Tue, 10 May 2022 03:59:31 -0400 Subject: [PATCH] Make return value mutable Changes the return mutability for pgpu_glyph_provider_get() --- pgpu-render/pgpu.h | 2 +- pgpu-render/src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pgpu-render/pgpu.h b/pgpu-render/pgpu.h index 7f93625..93d3d5c 100644 --- a/pgpu-render/pgpu.h +++ b/pgpu-render/pgpu.h @@ -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 diff --git a/pgpu-render/src/lib.rs b/pgpu-render/src/lib.rs index 2036f57..7d4c60b 100644 --- a/pgpu-render/src/lib.rs +++ b/pgpu-render/src/lib.rs @@ -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() } }