From bc956b757dfaa36223051d4a249b067b73d88c14 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 16 Jul 2021 08:12:01 +0000 Subject: [PATCH] set const on the first parameter to mio_trim_uchars() and mio_trim_bchars() --- mio/lib/mio-utl.h | 13 ++++++------- mio/lib/utl.c | 12 ++++++------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/mio/lib/mio-utl.h b/mio/lib/mio-utl.h index 9fcffa1..da99392 100644 --- a/mio/lib/mio-utl.h +++ b/mio/lib/mio-utl.h @@ -469,18 +469,17 @@ MIO_EXPORT mio_bch_t* mio_find_bchar_in_bcstr ( ); MIO_EXPORT mio_uch_t* mio_trim_uchars ( - mio_uch_t* str, - mio_oow_t* len, - int flags + const mio_uch_t* str, + mio_oow_t* len, + int flags ); MIO_EXPORT mio_bch_t* mio_trim_bchars ( - mio_bch_t* str, - mio_oow_t* len, - int flags + const mio_bch_t* str, + mio_oow_t* len, + int flags ); - MIO_EXPORT int mio_split_ucstr ( mio_uch_t* s, const mio_uch_t* delim, diff --git a/mio/lib/utl.c b/mio/lib/utl.c index fc3678f..69fd591 100644 --- a/mio/lib/utl.c +++ b/mio/lib/utl.c @@ -639,9 +639,9 @@ const mio_uch_t* mio_find_ucstr_word_in_ucstr (const mio_uch_t* str, const mio_u /* ========================================================================= */ -mio_uch_t* mio_trim_uchars (mio_uch_t* str, mio_oow_t* len, int flags) +mio_uch_t* mio_trim_uchars (const mio_uch_t* str, mio_oow_t* len, int flags) { - mio_uch_t* p = str, * end = str + *len; + const mio_uch_t* p = str, * end = str + *len; if (p < end) { @@ -678,12 +678,12 @@ mio_uch_t* mio_trim_uchars (mio_uch_t* str, mio_oow_t* len, int flags) } } - return str; + return (mio_uch_t*)str; } -mio_bch_t* mio_trim_bchars (mio_bch_t* str, mio_oow_t* len, int flags) +mio_bch_t* mio_trim_bchars (const mio_bch_t* str, mio_oow_t* len, int flags) { - mio_bch_t* p = str, * end = str + *len; + const mio_bch_t* p = str, * end = str + *len; if (p < end) { @@ -720,7 +720,7 @@ mio_bch_t* mio_trim_bchars (mio_bch_t* str, mio_oow_t* len, int flags) } } - return str; + return (mio_bch_t*)str; } /* ========================================================================= */