Changeset 08e103d4 in mainline for kernel/generic/src/debug


Ignore:
Timestamp:
2019-02-05T18:26:05Z (7 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/debug/symtab.c

    rd066259 r08e103d4  
    120120static const char *symtab_search_one(const char *name, size_t *startpos)
    121121{
    122         size_t namelen = str_length(name);
     122        size_t namelen = str_code_points(name);
    123123
    124124        size_t pos;
     
    131131                        continue;
    132132
    133                 if (str_length(curname) < namelen)
     133                if (str_code_points(curname) < namelen)
    134134                        continue;
    135135
    136136                if (str_lcmp(name, curname, namelen) == 0) {
    137137                        *startpos = pos;
    138                         return (curname + str_lsize(curname, namelen));
     138                        return (curname + str_lbytes(curname, namelen));
    139139                }
    140140        }
     
    164164
    165165        while ((hint = symtab_search_one(name, &pos))) {
    166                 if (str_length(hint) == 0) {
     166                if (str_code_points(hint) == 0) {
    167167                        *addr = uint64_t_le2host(symbol_table[pos].address_le);
    168168                        found++;
     
    206206{
    207207#ifdef CONFIG_SYMTAB
    208         size_t len = str_length(input);
     208        size_t len = str_code_points(input);
    209209        struct symtab_entry **entry = (struct symtab_entry **)ctx;
    210210
     
    220220                        continue;
    221221
    222                 if (str_length(curname) < len)
     222                if (str_code_points(curname) < len)
    223223                        continue;
    224224
     
    227227                        if (help)
    228228                                *help = NULL;
    229                         return (curname + str_lsize(curname, len));
     229                        return (curname + str_lbytes(curname, len));
    230230                }
    231231        }
Note: See TracChangeset for help on using the changeset viewer.