mirror of
https://github.com/irssi/irssi.git
synced 2024-09-01 04:14:16 -04:00
wcwidth-wrapper: avoid cast with a tiny wrapper, julia_wcwidth()
This commit is contained in:
parent
92804cb1aa
commit
7b70d051da
@ -71,6 +71,15 @@ static int system_wcwidth(unichar ucs)
|
||||
return retval;
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBUTF8PROC
|
||||
/* wrapper because the function signatures are different
|
||||
* (the parameter is unsigned for us, signed for them) */
|
||||
static int julia_wcwidth(unichar ucs)
|
||||
{
|
||||
return utf8proc_charwidth(ucs);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void read_settings(void)
|
||||
{
|
||||
static int choice = -1;
|
||||
@ -95,7 +104,7 @@ static void read_settings(void)
|
||||
|
||||
#ifdef HAVE_LIBUTF8PROC
|
||||
case WCWIDTH_IMPL_JULIA:
|
||||
wcwidth_impl_func = (WCWIDTH_FUNC) &utf8proc_charwidth;
|
||||
wcwidth_impl_func = &julia_wcwidth;
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user