Changeset 08e103d4 in mainline for uspace/srv/hid


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/srv/hid
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/console/console.c

    rd066259 r08e103d4  
    373373                                wchar_t tmp[2] = { event->c, 0 };
    374374                                wstr_to_str(cons->char_remains, UTF8_CHAR_BUFFER_SIZE, tmp);
    375                                 cons->char_remains_len = str_size(cons->char_remains);
     375                                cons->char_remains_len = str_bytes(cons->char_remains);
    376376                        }
    377377
  • uspace/srv/hid/isdv4_tablet/main.c

    rd066259 r08e103d4  
    191191
    192192        if (argc > arg && str_test_prefix(argv[arg], "--baud=")) {
    193                 size_t arg_offset = str_lsize(argv[arg], 7);
     193                size_t arg_offset = str_lbytes(argv[arg], 7);
    194194                char *arg_str = argv[arg] + arg_offset;
    195                 if (str_length(arg_str) == 0) {
     195                if (str_code_points(arg_str) == 0) {
    196196                        fprintf(stderr, "--baud requires an argument\n");
    197197                        syntax_print();
  • uspace/srv/hid/rfb/rfb.c

    rd066259 r08e103d4  
    655655        /* Server init */
    656656        fibril_mutex_lock(&rfb->lock);
    657         size_t name_length = str_length(rfb->name);
     657        size_t name_length = str_code_points(rfb->name);
    658658        size_t msg_length = sizeof(rfb_server_init_t) + name_length;
    659659        rfb_server_init_t *server_init = malloc(msg_length);
Note: See TracChangeset for help on using the changeset viewer.