Changeset 08e103d4 in mainline for uspace/lib/pcut/src


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:
uspace/lib/pcut/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/pcut/src/assert.c

    rd066259 r08e103d4  
    7070
    7171        pcut_snprintf(current_buffer, MAX_MESSAGE_LENGTH, "%s:%d: ", filename, line);
    72         offset = pcut_str_size(current_buffer);
     72        offset = pcut_str_bytes(current_buffer);
    7373
    7474        if (offset + 1 < MAX_MESSAGE_LENGTH) {
  • uspace/lib/pcut/src/internal.h

    rd066259 r08e103d4  
    166166 * @return Size of @p s in bytes.
    167167 */
    168 int pcut_str_size(const char *s);
     168int pcut_str_bytes(const char *s);
    169169
    170170/** Convert string to integer.
  • uspace/lib/pcut/src/main.c

    rd066259 r08e103d4  
    6262 */
    6363int pcut_is_arg_with_number(const char *arg, const char *opt, int *value) {
    64         int opt_len = pcut_str_size(opt);
     64        int opt_len = pcut_str_bytes(opt);
    6565        if (! pcut_str_start_equals(arg, opt, opt_len)) {
    6666                return 0;
  • uspace/lib/pcut/src/os/helenos.c

    rd066259 r08e103d4  
    5555}
    5656
    57 int pcut_str_size(const char *s) {
    58         return str_size(s);
     57int pcut_str_bytes(const char *s) {
     58        return str_bytes(s);
    5959}
    6060
  • uspace/lib/pcut/src/os/stdc.c

    rd066259 r08e103d4  
    4646}
    4747
    48 int pcut_str_size(const char *s) {
     48int pcut_str_bytes(const char *s) {
    4949        return strlen(s);
    5050}
  • uspace/lib/pcut/src/report/report.c

    rd066259 r08e103d4  
    7878                return;
    7979        }
    80         if (pcut_str_size(msg) == 0) {
     80        if (pcut_str_bytes(msg) == 0) {
    8181                return;
    8282        }
     
    130130
    131131                /* Determine the length of the text after the zeros. */
    132                 message_length = pcut_str_size(full_output);
     132                message_length = pcut_str_bytes(full_output);
    133133
    134134                if (cont_zeros_count < 2) {
Note: See TracChangeset for help on using the changeset viewer.