Changeset b7fd2a0 in mainline for uspace/lib/c/include/io/con_srv.h


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/lib/c/include/io/con_srv.h

    r36f0738 rb7fd2a0  
    6767
    6868struct con_ops {
    69         int (*open)(con_srvs_t *, con_srv_t *);
    70         int (*close)(con_srv_t *);
    71         int (*read)(con_srv_t *, void *, size_t, size_t *);
    72         int (*write)(con_srv_t *, void *, size_t, size_t *);
     69        errno_t (*open)(con_srvs_t *, con_srv_t *);
     70        errno_t (*close)(con_srv_t *);
     71        errno_t (*read)(con_srv_t *, void *, size_t, size_t *);
     72        errno_t (*write)(con_srv_t *, void *, size_t, size_t *);
    7373        void (*sync)(con_srv_t *);
    7474        void (*clear)(con_srv_t *);
    7575        void (*set_pos)(con_srv_t *, sysarg_t col, sysarg_t row);
    76         int (*get_pos)(con_srv_t *, sysarg_t *, sysarg_t *);
    77         int (*get_size)(con_srv_t *, sysarg_t *, sysarg_t *);
    78         int (*get_color_cap)(con_srv_t *, console_caps_t *);
     76        errno_t (*get_pos)(con_srv_t *, sysarg_t *, sysarg_t *);
     77        errno_t (*get_size)(con_srv_t *, sysarg_t *, sysarg_t *);
     78        errno_t (*get_color_cap)(con_srv_t *, console_caps_t *);
    7979        void (*set_style)(con_srv_t *, console_style_t);
    8080        void (*set_color)(con_srv_t *, console_color_t, console_color_t,
     
    8282        void (*set_rgb_color)(con_srv_t *, pixel_t, pixel_t);
    8383        void (*set_cursor_visibility)(con_srv_t *, bool);
    84         int (*get_event)(con_srv_t *, cons_event_t *);
     84        errno_t (*get_event)(con_srv_t *, cons_event_t *);
    8585};
    8686
    8787extern void con_srvs_init(con_srvs_t *);
    8888
    89 extern int con_conn(ipc_callid_t, ipc_call_t *, con_srvs_t *);
     89extern errno_t con_conn(ipc_callid_t, ipc_call_t *, con_srvs_t *);
    9090
    9191#endif
Note: See TracChangeset for help on using the changeset viewer.