From f82ab9bc2b8a976414eddc8cebd9aa58c96c9d1a Mon Sep 17 00:00:00 2001 From: KitsuneAlex Date: Fri, 3 May 2024 23:46:44 +0200 Subject: [PATCH] More const correctness --- core/msdfgen_c.cpp | 16 ++++++++-------- msdfgen_c.h | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/core/msdfgen_c.cpp b/core/msdfgen_c.cpp index bc6122c..952123d 100644 --- a/core/msdfgen_c.cpp +++ b/core/msdfgen_c.cpp @@ -262,15 +262,15 @@ MSDF_API int msdf_shape_validate(msdf_shape_handle shape, int* result) { return MSDF_SUCCESS; } -MSDF_API int msdf_shape_bound(msdf_shape_handle shape, msdf_bounds_t* bounds) { +MSDF_API int msdf_shape_bound(msdf_shape_const_handle shape, msdf_bounds_t* bounds) { if(shape == nullptr || bounds == nullptr) { return MSDF_ERR_INVALID_ARG; } - reinterpret_cast(shape)->bound(bounds->l, bounds->b, bounds->r, bounds->t); + reinterpret_cast(shape)->bound(bounds->l, bounds->b, bounds->r, bounds->t); return MSDF_SUCCESS; } -MSDF_API int msdf_shape_bound_miters(msdf_shape_handle shape, +MSDF_API int msdf_shape_bound_miters(msdf_shape_const_handle shape, msdf_bounds_t* bounds, const double border, const double miter_limit, @@ -278,7 +278,7 @@ MSDF_API int msdf_shape_bound_miters(msdf_shape_handle shape, if(shape == nullptr || bounds == nullptr) { return MSDF_ERR_INVALID_ARG; } - reinterpret_cast(shape)->boundMiters(bounds->l, bounds->b, bounds->r, bounds->t, border, miter_limit, polarity); + reinterpret_cast(shape)->boundMiters(bounds->l, bounds->b, bounds->r, bounds->t, border, miter_limit, polarity); return MSDF_SUCCESS; } @@ -322,15 +322,15 @@ MSDF_API int msdf_contour_get_edge(msdf_contour_const_handle contour, const size return MSDF_SUCCESS; } -MSDF_API int msdf_contour_bound(msdf_contour_handle contour, msdf_bounds_t* bounds) { +MSDF_API int msdf_contour_bound(msdf_contour_const_handle contour, msdf_bounds_t* bounds) { if(contour == nullptr || bounds == nullptr) { return MSDF_ERR_INVALID_ARG; } - reinterpret_cast(contour)->bound(bounds->l, bounds->b, bounds->r, bounds->t); + reinterpret_cast(contour)->bound(bounds->l, bounds->b, bounds->r, bounds->t); return MSDF_SUCCESS; } -MSDF_API int msdf_contour_bound_miters(msdf_contour_handle contour, +MSDF_API int msdf_contour_bound_miters(msdf_contour_const_handle contour, msdf_bounds_t* bounds, const double border, const double miter_limit, @@ -338,7 +338,7 @@ MSDF_API int msdf_contour_bound_miters(msdf_contour_handle contour, if(contour == nullptr || bounds == nullptr) { return MSDF_ERR_INVALID_ARG; } - reinterpret_cast(contour)->boundMiters(bounds->l, bounds->b, bounds->r, bounds->t, border, miter_limit, polarity); + reinterpret_cast(contour)->boundMiters(bounds->l, bounds->b, bounds->r, bounds->t, border, miter_limit, polarity); return MSDF_SUCCESS; } diff --git a/msdfgen_c.h b/msdfgen_c.h index dc36243..9077118 100644 --- a/msdfgen_c.h +++ b/msdfgen_c.h @@ -149,16 +149,16 @@ MSDF_API int msdf_shape_get_edge_count(msdf_shape_const_handle shape, size_t* ed MSDF_API int msdf_shape_has_inverse_y_axis(msdf_shape_const_handle shape, int* inverse_y_axis); MSDF_API int msdf_shape_normalize(msdf_shape_handle shape); MSDF_API int msdf_shape_validate(msdf_shape_handle shape, int* result); -MSDF_API int msdf_shape_bound(msdf_shape_handle shape, msdf_bounds_t* bounds); -MSDF_API int msdf_shape_bound_miters(msdf_shape_handle shape, msdf_bounds_t* bounds, double border, double miter_limit, int polarity); +MSDF_API int msdf_shape_bound(msdf_shape_const_handle shape, msdf_bounds_t* bounds); +MSDF_API int msdf_shape_bound_miters(msdf_shape_const_handle shape, msdf_bounds_t* bounds, double border, double miter_limit, int polarity); MSDF_API void msdf_shape_free(msdf_shape_handle shape); MSDF_API int msdf_contour_alloc(msdf_contour_handle* contour); MSDF_API int msdf_contour_add_edge(msdf_contour_handle contour, msdf_segment_handle* segment); MSDF_API int msdf_contour_get_edge_count(msdf_contour_const_handle contour, size_t* edge_count); MSDF_API int msdf_contour_get_edge(msdf_contour_const_handle contour, size_t index, msdf_segment_const_handle* segment); -MSDF_API int msdf_contour_bound(msdf_contour_handle contour, msdf_bounds_t* bounds); -MSDF_API int msdf_contour_bound_miters(msdf_contour_handle contour, msdf_bounds_t* bounds, double border, double miter_limit, int polarity); +MSDF_API int msdf_contour_bound(msdf_contour_const_handle contour, msdf_bounds_t* bounds); +MSDF_API int msdf_contour_bound_miters(msdf_contour_const_handle contour, msdf_bounds_t* bounds, double border, double miter_limit, int polarity); MSDF_API int msdf_contour_get_winding(msdf_contour_const_handle contour, int* winding); MSDF_API int msdf_contour_reverse(msdf_contour_handle contour); MSDF_API void msdf_contour_free(msdf_contour_handle contour);