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; } /* ------------------------------------------------------------------------ */