Changeset 08e103d4 in mainline for kernel/genarch


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".

Location:
kernel/genarch/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/multiboot/multiboot.c

    rd066259 r08e103d4  
    5151        const char *end = str_chr(cmd_line, ' ');
    5252        if (end == NULL)
    53                 end = cmd_line + str_size(cmd_line);
     53                end = cmd_line + str_bytes(cmd_line);
    5454
    5555        /*
     
    8888        }
    8989
    90         const char *end = cmd_line + str_size(cmd_line);
     90        const char *end = cmd_line + str_bytes(cmd_line);
    9191
    9292        /* Skip the space(s). */
  • 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.