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


Ignore:
Timestamp:
2018-01-04T20:50:52Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
e211ea04
Parents:
facacc71
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:47:53)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:50:52)
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.

After this commit, HelenOS is free of code that mixes error codes with non-error
values on the assumption that error codes are negative.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/dist/src/c/demos/edit/edit.c

    rfacacc71 r46577995  
    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...");
     
    588588        rc = file_save_range(fname, &sp, &ep);
    589589
    590         switch (rc) {
    591         case EINVAL:
     590        switch ((case_errno_t) rc) {
     591        case (case_errno_t) EINVAL:
    592592                status_display("Error opening file!");
    593593                break;
    594         case EIO:
     594        case (case_errno_t) EIO:
    595595                status_display("Error writing data!");
    596596                break;
     
    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.