From 02aa80e9c214ab764a7b5f42c30a8d1e07f65c52 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 16 Jul 2021 08:16:43 +0000 Subject: [PATCH] set const on the first parameter to hawk_trim_uchars() and hawk_trim_bchars() --- hawk/lib/hawk-utl.h | 12 ++++++------ hawk/lib/utl-str.c | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hawk/lib/hawk-utl.h b/hawk/lib/hawk-utl.h index 36579604..aaf0e2c7 100644 --- a/hawk/lib/hawk-utl.h +++ b/hawk/lib/hawk-utl.h @@ -694,15 +694,15 @@ HAWK_EXPORT hawk_oow_t hawk_rotate_bchars ( ); HAWK_EXPORT hawk_uch_t* hawk_trim_uchars ( - hawk_uch_t* str, - hawk_oow_t* len, - int flags + const hawk_uch_t* str, + hawk_oow_t* len, + int flags ); HAWK_EXPORT hawk_bch_t* hawk_trim_bchars ( - hawk_bch_t* str, - hawk_oow_t* len, - int flags + const hawk_bch_t* str, + hawk_oow_t* len, + int flags ); HAWK_EXPORT int hawk_split_ucstr ( diff --git a/hawk/lib/utl-str.c b/hawk/lib/utl-str.c index 8562f446..b876d10c 100644 --- a/hawk/lib/utl-str.c +++ b/hawk/lib/utl-str.c @@ -942,9 +942,9 @@ hawk_oow_t hawk_rotate_bchars (hawk_bch_t* str, hawk_oow_t len, int dir, hawk_oo /* ------------------------------------------------------------------------ */ -hawk_uch_t* hawk_trim_uchars (hawk_uch_t* str, hawk_oow_t* len, int flags) +hawk_uch_t* hawk_trim_uchars (const hawk_uch_t* str, hawk_oow_t* len, int flags) { - hawk_uch_t* p = str, * end = str + *len; + const hawk_uch_t* p = str, * end = str + *len; if (p < end) { @@ -981,12 +981,12 @@ hawk_uch_t* hawk_trim_uchars (hawk_uch_t* str, hawk_oow_t* len, int flags) } } - return str; + return (hawk_uch_t*)str; } -hawk_bch_t* hawk_trim_bchars (hawk_bch_t* str, hawk_oow_t* len, int flags) +hawk_bch_t* hawk_trim_bchars (const hawk_bch_t* str, hawk_oow_t* len, int flags) { - hawk_bch_t* p = str, * end = str + *len; + const hawk_bch_t* p = str, * end = str + *len; if (p < end) { @@ -1023,7 +1023,7 @@ hawk_bch_t* hawk_trim_bchars (hawk_bch_t* str, hawk_oow_t* len, int flags) } } - return str; + return (hawk_bch_t*)str; } /* ------------------------------------------------------------------------ */