Changeset 46577995 in mainline for uspace/lib/gui/terminal.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/lib/gui/terminal.c

    rfacacc71 r46577995  
    6262static LIST_INITIALIZE(terms);
    6363
    64 static int term_open(con_srvs_t *, con_srv_t *);
    65 static int term_close(con_srv_t *);
    66 static int term_read(con_srv_t *, void *, size_t, size_t *);
    67 static int term_write(con_srv_t *, void *, size_t, size_t *);
     64static errno_t term_open(con_srvs_t *, con_srv_t *);
     65static errno_t term_close(con_srv_t *);
     66static errno_t term_read(con_srv_t *, void *, size_t, size_t *);
     67static errno_t term_write(con_srv_t *, void *, size_t, size_t *);
    6868static void term_sync(con_srv_t *);
    6969static void term_clear(con_srv_t *);
    7070static void term_set_pos(con_srv_t *, sysarg_t col, sysarg_t row);
    71 static int term_get_pos(con_srv_t *, sysarg_t *, sysarg_t *);
    72 static int term_get_size(con_srv_t *, sysarg_t *, sysarg_t *);
    73 static int term_get_color_cap(con_srv_t *, console_caps_t *);
     71static errno_t term_get_pos(con_srv_t *, sysarg_t *, sysarg_t *);
     72static errno_t term_get_size(con_srv_t *, sysarg_t *, sysarg_t *);
     73static errno_t term_get_color_cap(con_srv_t *, console_caps_t *);
    7474static void term_set_style(con_srv_t *, console_style_t);
    7575static void term_set_color(con_srv_t *, console_color_t, console_color_t,
     
    7777static void term_set_rgb_color(con_srv_t *, pixel_t, pixel_t);
    7878static void term_set_cursor_visibility(con_srv_t *, bool);
    79 static int term_get_event(con_srv_t *, cons_event_t *);
     79static errno_t term_get_event(con_srv_t *, cons_event_t *);
    8080
    8181static con_ops_t con_ops = {
     
    376376}
    377377
    378 static int term_open(con_srvs_t *srvs, con_srv_t *srv)
     378static errno_t term_open(con_srvs_t *srvs, con_srv_t *srv)
    379379{
    380380        return EOK;
    381381}
    382382
    383 static int term_close(con_srv_t *srv)
     383static errno_t term_close(con_srv_t *srv)
    384384{
    385385        return EOK;
    386386}
    387387
    388 static int term_read(con_srv_t *srv, void *buf, size_t size, size_t *nread)
     388static errno_t term_read(con_srv_t *srv, void *buf, size_t size, size_t *nread)
    389389{
    390390        terminal_t *term = srv_to_terminal(srv);
     
    463463}
    464464
    465 static int term_write(con_srv_t *srv, void *data, size_t size, size_t *nwritten)
     465static errno_t term_write(con_srv_t *srv, void *data, size_t size, size_t *nwritten)
    466466{
    467467        terminal_t *term = srv_to_terminal(srv);
     
    504504}
    505505
    506 static int term_get_pos(con_srv_t *srv, sysarg_t *col, sysarg_t *row)
     506static errno_t term_get_pos(con_srv_t *srv, sysarg_t *col, sysarg_t *row)
    507507{
    508508        terminal_t *term = srv_to_terminal(srv);
     
    515515}
    516516
    517 static int term_get_size(con_srv_t *srv, sysarg_t *cols, sysarg_t *rows)
     517static errno_t term_get_size(con_srv_t *srv, sysarg_t *cols, sysarg_t *rows)
    518518{
    519519        terminal_t *term = srv_to_terminal(srv);
     
    527527}
    528528
    529 static int term_get_color_cap(con_srv_t *srv, console_caps_t *caps)
     529static errno_t term_get_color_cap(con_srv_t *srv, console_caps_t *caps)
    530530{
    531531        (void) srv;
     
    575575}
    576576
    577 static int term_get_event(con_srv_t *srv, cons_event_t *event)
     577static errno_t term_get_event(con_srv_t *srv, cons_event_t *event)
    578578{
    579579        terminal_t *term = srv_to_terminal(srv);
     
    751751        term->srvs.sarg = term;
    752752       
    753         int rc = loc_server_register(NAME);
     753        errno_t rc = loc_server_register(NAME);
    754754        if (rc != EOK) {
    755755                widget_deinit(&term->widget);
Note: See TracChangeset for help on using the changeset viewer.