[Commits] SDL: linux: removed IBus_utf8_strlen(), use SDL_utf8strlen() ins...

libsdl.org revision control commits-owner at libsdl.org
Mon May 29 00:05:50 PDT 2017


details:   https://hg.libsdl.org/SDL/rev/241410389057
changeset: 11051:241410389057
user:      Ryan C. Gordon <icculus at icculus.org>
date:      Mon May 29 00:51:02 2017 -0400
description:
linux: removed IBus_utf8_strlen(), use SDL_utf8strlen() instead.

diffstat:

 src/core/linux/SDL_ibus.c |  19 ++-----------------
 1 files changed, 2 insertions(+), 17 deletions(-)

diffs (36 lines):

diff -r 0b19d98c9a9d -r 241410389057 src/core/linux/SDL_ibus.c
--- a/src/core/linux/SDL_ibus.c	Mon May 29 00:54:08 2017 -0400
+++ b/src/core/linux/SDL_ibus.c	Mon May 29 00:51:02 2017 -0400
@@ -107,21 +107,6 @@
     return text;
 }
 
-static size_t 
-IBus_utf8_strlen(const char *str)
-{
-    size_t utf8_len = 0;
-    const char *p;
-    
-    for (p = str; *p; ++p) {
-        if (!((*p & 0x80) && !(*p & 0x40))) {
-            ++utf8_len;
-        }
-    }
-    
-    return utf8_len;
-}
-
 static DBusHandlerResult
 IBus_MessageHandler(DBusConnection *conn, DBusMessage *msg, void *user_data)
 {
@@ -162,8 +147,8 @@
             size_t cursor = 0;
             
             do {
-                size_t sz = SDL_utf8strlcpy(buf, text+i, sizeof(buf));
-                size_t chars = IBus_utf8_strlen(buf);
+                const size_t sz = SDL_utf8strlcpy(buf, text+i, sizeof(buf));
+                const size_t chars = SDL_utf8strlen(buf);
                 
                 SDL_SendEditingText(buf, cursor, chars);
 


More information about the commits mailing list