Ignore:
Timestamp:
2019-02-05T18:26:05Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
1d2f85e
Parents:
d066259
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-05 16:16:55)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-05 18:26:05)
Message:

Use clearer naming for string length functions

This and the following commit change the names of functions, as well as
their documentation, to use unambiguous terms "bytes" and "code points"
instead of ambiguous terms "size", "length", and "characters".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/printf/printf_core.c

    rd066259 r08e103d4  
    156156{
    157157        if (str == NULL)
    158                 return printf_putnchars(nullstr, str_size(nullstr), ps);
    159 
    160         return ps->str_write((void *) str, str_size(str), ps->data);
     158                return printf_putnchars(nullstr, str_bytes(nullstr), ps);
     159
     160        return ps->str_write((void *) str, str_bytes(str), ps->data);
    161161}
    162162
     
    285285
    286286        /* Print leading spaces. */
    287         size_t strw = str_length(str);
     287        size_t strw = str_code_points(str);
    288288        if ((precision == 0) || (precision > strw))
    289289                precision = strw;
     
    301301        /* Part of @a str fitting into the alloted space. */
    302302        int retval;
    303         size_t size = str_lsize(str, precision);
     303        size_t size = str_lbytes(str, precision);
    304304        if ((retval = printf_putnchars(str, size, ps)) < 0)
    305305                return -counter;
     
    333333
    334334        /* Print leading spaces. */
    335         size_t strw = wstr_length(str);
     335        size_t strw = wstr_code_points(str);
    336336        if ((precision == 0) || (precision > strw))
    337337                precision = strw;
     
    349349        /* Part of @a wstr fitting into the alloted space. */
    350350        int retval;
    351         size_t size = wstr_lsize(str, precision);
     351        size_t size = wstr_lbytes(str, precision);
    352352        if ((retval = printf_wputnchars(str, size, ps)) < 0)
    353353                return -counter;
Note: See TracChangeset for help on using the changeset viewer.