Internals: Replace unsigned short with ImWchar when dealing with character storage (missing cases) + in imgui_impl_ file keep using neutral type everywhere, added missing explicit cast in three bindings. (#2078)
diff --git a/examples/imgui_impl_freeglut.cpp b/examples/imgui_impl_freeglut.cpp
index b265226..8884905 100644
--- a/examples/imgui_impl_freeglut.cpp
+++ b/examples/imgui_impl_freeglut.cpp
@@ -97,7 +97,7 @@
     //printf("char_down_func %d '%c'\n", c, c);
     ImGuiIO& io = ImGui::GetIO();
     if (c >= 32)
-        io.AddInputCharacter(c);
+        io.AddInputCharacter((unsigned short)c);
 
     // Store letters in KeysDown[] array as both uppercase and lowercase + Handle GLUT translating CTRL+A..CTRL+Z as 1..26. 
     // This is a hacky mess but GLUT is unable to distinguish e.g. a TAB key from CTRL+I so this is probably the best we can do here.
diff --git a/examples/imgui_impl_osx.mm b/examples/imgui_impl_osx.mm
index 07494d6..edfd454 100644
--- a/examples/imgui_impl_osx.mm
+++ b/examples/imgui_impl_osx.mm
@@ -188,7 +188,7 @@
         {
             int c = [str characterAtIndex:i];
             if (c < 0xF700 && !io.KeyCtrl)
-                io.AddInputCharacter(c);
+                io.AddInputCharacter((unsigned short)c);
 
             // We must reset in case we're pressing a sequence of special keys while keeping the command pressed
             int key = mapCharacterToKey(c);
diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp
index 44e7d02..56cbf33 100644
--- a/imgui_widgets.cpp
+++ b/imgui_widgets.cpp
@@ -2844,7 +2844,7 @@
         if (c == '\r')
             continue;
 
-        const float char_width = font->GetCharAdvance((unsigned short)c) * scale;
+        const float char_width = font->GetCharAdvance((ImWchar)c) * scale;
         line_width += char_width;
     }
 
@@ -3697,7 +3697,7 @@
                 else
                 {
                     ImVec2 rect_size = InputTextCalcTextSizeW(p, text_selected_end, &p, NULL, true);
-                    if (rect_size.x <= 0.0f) rect_size.x = (float)(int)(g.Font->GetCharAdvance((unsigned short)' ') * 0.50f); // So we can see selected empty lines
+                    if (rect_size.x <= 0.0f) rect_size.x = (float)(int)(g.Font->GetCharAdvance((ImWchar)' ') * 0.50f); // So we can see selected empty lines
                     ImRect rect(rect_pos + ImVec2(0.0f, bg_offy_up - g.FontSize), rect_pos +ImVec2(rect_size.x, bg_offy_dn));
                     rect.ClipWith(clip_rect);
                     if (rect.Overlaps(clip_rect))
diff --git a/misc/freetype/imgui_freetype.cpp b/misc/freetype/imgui_freetype.cpp
index 89aa23f..33bdb14 100644
--- a/misc/freetype/imgui_freetype.cpp
+++ b/misc/freetype/imgui_freetype.cpp
@@ -337,7 +337,7 @@
         {
             for (uint32_t codepoint = in_range[0]; codepoint <= in_range[1]; ++codepoint) 
             {
-                if (cfg.MergeMode && dst_font->FindGlyphNoFallback((unsigned short)codepoint))
+                if (cfg.MergeMode && dst_font->FindGlyphNoFallback((ImWchar)codepoint))
                     continue;
 
                 FT_Glyph ft_glyph = NULL;