Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/clui/tinput.c

    r28a5ebd r68f1254c  
    113113static void tinput_display_tail(tinput_t *ti, size_t start, size_t pad)
    114114{
    115         char32_t *dbuf = malloc((INPUT_MAX_SIZE + 1) * sizeof(char32_t));
     115        wchar_t *dbuf = malloc((INPUT_MAX_SIZE + 1) * sizeof(wchar_t));
    116116        if (!dbuf)
    117117                return;
     
    126126        size_t p = start;
    127127        if (p < sa) {
    128                 memcpy(dbuf, ti->buffer + p, (sa - p) * sizeof(char32_t));
     128                memcpy(dbuf, ti->buffer + p, (sa - p) * sizeof(wchar_t));
    129129                dbuf[sa - p] = '\0';
    130130                printf("%ls", dbuf);
     
    137137
    138138                memcpy(dbuf, ti->buffer + p,
    139                     (sb - p) * sizeof(char32_t));
     139                    (sb - p) * sizeof(wchar_t));
    140140                dbuf[sb - p] = '\0';
    141141                printf("%ls", dbuf);
     
    148148        if (p < ti->nc) {
    149149                memcpy(dbuf, ti->buffer + p,
    150                     (ti->nc - p) * sizeof(char32_t));
     150                    (ti->nc - p) * sizeof(wchar_t));
    151151                dbuf[ti->nc - p] = '\0';
    152152                printf("%ls", dbuf);
     
    154154
    155155        for (p = 0; p < pad; p++)
    156                 putuchar(' ');
     156                putwchar(' ');
    157157
    158158        console_flush(ti->console);
     
    192192        tinput_console_set_lpos(ti, ti->text_coord + ti->nc);
    193193        console_flush(ti->console);
    194         putuchar('\n');
     194        putwchar('\n');
    195195}
    196196
     
    212212}
    213213
    214 static void tinput_insert_char(tinput_t *ti, char32_t c)
     214static void tinput_insert_char(tinput_t *ti, wchar_t c)
    215215{
    216216        if (ti->nc == INPUT_MAX_SIZE)
     
    263263        size_t i = 0;
    264264        while (i < ilen) {
    265                 char32_t c = str_decode(str, &off, STR_NO_LIMIT);
     265                wchar_t c = str_decode(str, &off, STR_NO_LIMIT);
    266266                if (c == '\0')
    267267                        break;
     
    506506
    507507        memmove(ti->buffer + sa, ti->buffer + sb,
    508             (ti->nc - sb) * sizeof(char32_t));
     508            (ti->nc - sb) * sizeof(wchar_t));
    509509
    510510        ti->pos = ti->sel_start = sa;
     
    526526
    527527        if (sb < ti->nc) {
    528                 char32_t tmp_c = ti->buffer[sb];
     528                wchar_t tmp_c = ti->buffer[sb];
    529529                ti->buffer[sb] = '\0';
    530530                str = wstr_to_astr(ti->buffer + sa);
     
    602602        size_t i;
    603603        size_t a_off, b_off;
    604         char32_t ca, cb;
     604        wchar_t ca, cb;
    605605
    606606        i = 0;
     
    704704                        /* Extend array */
    705705                        compl_len = 2 * compl_len;
    706                         char **temp = realloc(compl, compl_len * sizeof(char *));
    707                         if (temp == NULL) {
    708                                 free(compl);
     706                        compl = realloc(compl, compl_len * sizeof(char *));
     707                        if (compl == NULL) {
    709708                                printf("Error: Out of memory.\n");
    710709                                break;
    711710                        }
    712                         compl = temp;
    713711                }
    714712
Note: See TracChangeset for help on using the changeset viewer.