Changeset b7fd2a0 in mainline for uspace/app/rcutest/rcutest.c


Ignore:
Timestamp:
2018-01-13T03:10:29Z (8 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a53ed3a
Parents:
36f0738
Message:

Use errno_t in all uspace and kernel code.

Change type of every variable, parameter and return value that holds an
<errno.h> constant to either errno_t (the usual case), or sys_errno_t
(some places in kernel). This is for the purpose of self-documentation,
as well as for type-checking with a bit of type definition hackery.

Although this is a massive commit, it is a simple text replacement, and thus
is very easy to verify. Simply do the following:

`
git checkout <this commit's hash>
git reset HEAD
git add .
tools/srepl '\berrno_t\b' int
git add .
tools/srepl '\bsys_errno_t\b' sysarg_t
git reset
git diff
`

While this doesn't ensure that the replacements are correct, it does ensure
that the commit doesn't do anything except those replacements. Since errno_t
is typedef'd to int in the usual case (and sys_errno_t to sysarg_t), even if
incorrect, this commit cannot change behavior.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/rcutest/rcutest.c

    r36f0738 rb7fd2a0  
    168168
    169169
    170 typedef int (*fibril_func_t)(void *);
    171 
    172 static bool create_fibril(int (*func)(void*), void *arg)
     170typedef errno_t (*fibril_func_t)(void *);
     171
     172static bool create_fibril(errno_t (*func)(void*), void *arg)
    173173{
    174174        fid_t fid = fibril_create(func, arg);
     
    308308
    309309
    310 static int sleeping_reader(one_reader_info_t *arg)
     310static errno_t sleeping_reader(one_reader_info_t *arg)
    311311{
    312312        rcu_register_fibril();
     
    390390
    391391
    392 static int preexisting_reader(two_reader_info_t *arg)
     392static errno_t preexisting_reader(two_reader_info_t *arg)
    393393{
    394394        rcu_register_fibril();
     
    430430}
    431431
    432 static int new_reader(two_reader_info_t *arg)
     432static errno_t new_reader(two_reader_info_t *arg)
    433433{
    434434        rcu_register_fibril();
     
    551551
    552552
    553 static int exiting_locked_reader(exit_reader_info_t *arg)
     553static errno_t exiting_locked_reader(exit_reader_info_t *arg)
    554554{
    555555        rcu_register_fibril();
     
    647647}
    648648
    649 static int seq_reader(seq_test_info_t *arg)
     649static errno_t seq_reader(seq_test_info_t *arg)
    650650{
    651651        rcu_register_fibril();
     
    690690}
    691691
    692 static int seq_updater(seq_test_info_t *arg)
     692static errno_t seq_updater(seq_test_info_t *arg)
    693693{
    694694        rcu_register_fibril();
     
    779779                thread_id_t tid;
    780780               
    781                 int ret = thread_create(dummy_fibril, NULL, "urcu-test-worker", &tid);
     781                errno_t ret = thread_create(dummy_fibril, NULL, "urcu-test-worker", &tid);
    782782                if (EOK != ret) {
    783783                        printf("Failed to create thread '%zu' (error: %s)\n", k + 1, str_error_name(ret));
     
    862862        if (argc == 3) {
    863863                uint32_t thread_cnt = 0;
    864                 int ret = str_uint32_t(argv[2], NULL, 0, true, &thread_cnt);
     864                errno_t ret = str_uint32_t(argv[2], NULL, 0, true, &thread_cnt);
    865865               
    866866                if (ret == EOK && 1 <= thread_cnt && thread_cnt <= 64) {
Note: See TracChangeset for help on using the changeset viewer.