mirror of
https://github.com/irssi/irssi.git
synced 2024-11-03 04:27:19 -05: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;
|
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 void read_settings(void)
|
||||||
{
|
{
|
||||||
static int choice = -1;
|
static int choice = -1;
|
||||||
@ -95,7 +104,7 @@ static void read_settings(void)
|
|||||||
|
|
||||||
#ifdef HAVE_LIBUTF8PROC
|
#ifdef HAVE_LIBUTF8PROC
|
||||||
case WCWIDTH_IMPL_JULIA:
|
case WCWIDTH_IMPL_JULIA:
|
||||||
wcwidth_impl_func = (WCWIDTH_FUNC) &utf8proc_charwidth;
|
wcwidth_impl_func = &julia_wcwidth;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user