Changeset b7fd2a0 in mainline for uspace/app/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/app/edit/edit.c

    r36f0738 rb7fd2a0  
    132132static void pos_handle(pos_event_t *ev);
    133133
    134 static int file_save(char const *fname);
     134static errno_t file_save(char const *fname);
    135135static void file_save_as(void);
    136 static int file_insert(char *fname);
    137 static int file_save_range(char const *fname, spt_t const *spos,
     136static errno_t file_insert(char *fname);
     137static errno_t file_save_range(char const *fname, spt_t const *spos,
    138138    spt_t const *epos);
    139139static char *range_get_str(spt_t const *spos, spt_t const *epos);
     
    191191        cons_event_t ev;
    192192        bool new_file;
    193         int rc;
     193        errno_t rc;
    194194
    195195        con = console_init(stdin, stdout);
     
    578578
    579579/** Save the document. */
    580 static int file_save(char const *fname)
     580static errno_t file_save(char const *fname)
    581581{
    582582        spt_t sp, ep;
    583         int rc;
     583        errno_t rc;
    584584
    585585        status_display("Saving...");
     
    616616        }
    617617
    618         int rc = file_save(fname);
     618        errno_t rc = file_save(fname);
    619619        if (rc != EOK)
    620620                return;
     
    697697 * of the caret.
    698698 */
    699 static int file_insert(char *fname)
     699static errno_t file_insert(char *fname)
    700700{
    701701        FILE *f;
     
    735735
    736736/** Save a range of text into a file. */
    737 static int file_save_range(char const *fname, spt_t const *spos,
     737static errno_t file_save_range(char const *fname, spt_t const *spos,
    738738    spt_t const *epos)
    739739{
     
    12831283
    12841284/* Search operations */
    1285 static int search_spt_producer(void *data, wchar_t *ret)
     1285static errno_t search_spt_producer(void *data, wchar_t *ret)
    12861286{
    12871287        assert(data != NULL);
     
    12921292}
    12931293
    1294 static int search_spt_reverse_producer(void *data, wchar_t *ret)
     1294static errno_t search_spt_reverse_producer(void *data, wchar_t *ret)
    12951295{
    12961296        assert(data != NULL);
     
    13011301}
    13021302
    1303 static int search_spt_mark(void *data, void **mark)
     1303static errno_t search_spt_mark(void *data, void **mark)
    13041304{
    13051305        assert(data != NULL);
     
    13971397       
    13981398        match_t match;
    1399         int rc = search_next_match(search, &match);
     1399        errno_t rc = search_next_match(search, &match);
    14001400        if (rc != EOK) {
    14011401                status_display("Failed searching.");
     
    15151515        size_t off;
    15161516        wchar_t c;
    1517         int rc;
     1517        errno_t rc;
    15181518
    15191519        rc = clipboard_get_str(&str);
Note: See TracChangeset for help on using the changeset viewer.