Changeset b7fd2a0 in mainline for uspace/dist/src/c/demos/edit/edit.c


Ignore:
Timestamp:
2018-01-13T03:10:29Z (7 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/dist/src/c/demos/edit/edit.c

    r36f0738 rb7fd2a0  
    190190        cons_event_t ev;
    191191        bool new_file;
    192         int rc;
     192        errno_t rc;
    193193
    194194        con = console_init(stdin, stdout);
     
    580580{
    581581        spt_t sp, ep;
    582         int rc;
     582        errno_t rc;
    583583
    584584        status_display("Saving...");
     
    615615        }
    616616
    617         int rc = file_save(fname);
     617        errno_t rc = file_save(fname);
    618618        if (rc != EOK)
    619619                return;
     
    13301330       
    13311331        match_t match;
    1332         int rc = search_next_match(search, &match);
     1332        errno_t rc = search_next_match(search, &match);
    13331333        if (rc != EOK) {
    13341334                status_display("Failed searching.");
     
    14481448        size_t off;
    14491449        wchar_t c;
    1450         int rc;
     1450        errno_t rc;
    14511451
    14521452        rc = clipboard_get_str(&str);
Note: See TracChangeset for help on using the changeset viewer.