Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/libunicode/capi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ int u32_gc_width(u32_char_t const* codepoints, size_t size, int mode)
while (segmenter.codepointsAvailable())
{
auto const cluster = *segmenter;
int thisWidth = unicode::width(cluster.front());
int thisWidth = static_cast<int>(unicode::width(cluster.front()));
if (mode != GC_WIDTH_MODE_NON_MODIFIABLE)
{
for (size_t i = 1; i < size; ++i)
Expand All @@ -60,7 +60,7 @@ int u32_gc_width(u32_char_t const* codepoints, size_t size, int mode)
{
case 0xFE0E: return 1;
case 0xFE0F: return 2;
default: return unicode::width(codepoint);
default: return static_cast<int>(unicode::width(codepoint));
}
}();
if (width && width != thisWidth)
Expand Down
2 changes: 1 addition & 1 deletion src/libunicode/width.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
namespace unicode
{

int width(char32_t codepoint) noexcept
unsigned width(char32_t codepoint) noexcept
{
return codepoint_properties::get(codepoint).char_width;
}
Expand Down
2 changes: 1 addition & 1 deletion src/libunicode/width.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ namespace unicode
{

/// Returns the number of text columns the given codepoint would need to be displayed.
int width(char32_t codepoint) noexcept;
unsigned width(char32_t codepoint) noexcept;

} // namespace unicode