Changeset 08e103d4 in mainline for kernel/genarch/src/ofw/ofw_tree.c


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/genarch/src/ofw/ofw_tree.c

    rd066259 r08e103d4  
    250250        size_t j;
    251251
    252         for (size_t i = 1; (i < str_size(path)) && (node); i = j + 1) {
     252        for (size_t i = 1; (i < str_bytes(path)) && (node); i = j + 1) {
    253253                j = i;
    254                 while (j < str_size(path) && path[j] != '/')
     254                while (j < str_bytes(path) && path[j] != '/')
    255255                        j++;
    256256
     
    342342        *size = 0;
    343343        for (size_t i = 0; i < node->properties; i++)
    344                 *size += str_size(node->property[i].name) + 1 +
     344                *size += str_bytes(node->property[i].name) + 1 +
    345345                    sizeof(node->property[i].size) + node->property[i].size;
    346346
     
    359359                /* Property name */
    360360                str_cpy(dump + pos, *size - pos, node->property[i].name);
    361                 pos += str_size(node->property[i].name) + 1;
     361                pos += str_bytes(node->property[i].name) + 1;
    362362
    363363                /* Value size */
     
    393393                if ((cur->parent) && (path))
    394394                        snprintf(cur_path, PATH_MAX_LEN, "%s.%s", path, cur->da_name);
    395                 else if (!str_size(cur->da_name))
     395                else if (!str_bytes(cur->da_name))
    396396                        snprintf(cur_path, PATH_MAX_LEN, "firmware.ofw");
    397397                else
Note: See TracChangeset for help on using the changeset viewer.