Changeset b7fd2a0 in mainline for uspace/drv/fb/kfb/port.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/drv/fb/kfb/port.c

    r36f0738 rb7fd2a0  
    8686static vslmode_list_element_t pixel_mode;
    8787
    88 static int kfb_claim(visualizer_t *vs)
     88static errno_t kfb_claim(visualizer_t *vs)
    8989{
    9090        return physmem_map(kfb.paddr + kfb.offset,
     
    9393}
    9494
    95 static int kfb_yield(visualizer_t *vs)
    96 {
    97         int rc;
     95static errno_t kfb_yield(visualizer_t *vs)
     96{
     97        errno_t rc;
    9898
    9999        if (vs->mode_set) {
     
    109109}
    110110
    111 static int kfb_handle_damage_pixels(visualizer_t *vs,
     111static errno_t kfb_handle_damage_pixels(visualizer_t *vs,
    112112    sysarg_t x0, sysarg_t y0, sysarg_t width, sysarg_t height,
    113113    sysarg_t x_offset, sysarg_t y_offset)
     
    137137}
    138138
    139 static int kfb_change_mode(visualizer_t *vs, vslmode_t new_mode)
     139static errno_t kfb_change_mode(visualizer_t *vs, vslmode_t new_mode)
    140140{
    141141        vs->ops.handle_damage = kfb_handle_damage_pixels;
     
    143143}
    144144
    145 static int kfb_suspend(visualizer_t *vs)
    146 {
    147         return EOK;
    148 }
    149 
    150 static int kfb_wakeup(visualizer_t *vs)
     145static errno_t kfb_suspend(visualizer_t *vs)
     146{
     147        return EOK;
     148}
     149
     150static errno_t kfb_wakeup(visualizer_t *vs)
    151151{
    152152        return EOK;
     
    165165{
    166166        visualizer_t *vsl;
    167         int rc;
     167        errno_t rc;
    168168
    169169        vsl = (visualizer_t *) ddf_fun_data_get((ddf_fun_t *)arg);
     
    177177}
    178178
    179 int port_init(ddf_dev_t *dev)
     179errno_t port_init(ddf_dev_t *dev)
    180180{
    181181        sysarg_t present;
    182         int rc = sysinfo_get_value("fb", &present);
     182        errno_t rc = sysinfo_get_value("fb", &present);
    183183        if (rc != EOK)
    184184                present = false;
Note: See TracChangeset for help on using the changeset viewer.