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/lib/draw/font/bitmap_backend.c

    r36f0738 rb7fd2a0  
    5959} bitmap_backend_data_t;
    6060
    61 static int bb_get_font_metrics(void *backend_data, font_metrics_t *font_metrics)
     61static errno_t bb_get_font_metrics(void *backend_data, font_metrics_t *font_metrics)
    6262{
    6363        bitmap_backend_data_t *data = (bitmap_backend_data_t *) backend_data;
     
    6868}
    6969
    70 static int bb_resolve_glyph(void *backend_data, wchar_t c, glyph_id_t *glyph_id)
     70static errno_t bb_resolve_glyph(void *backend_data, wchar_t c, glyph_id_t *glyph_id)
    7171{
    7272        bitmap_backend_data_t *data = (bitmap_backend_data_t *) backend_data;
     
    7474}
    7575
    76 static int bb_get_glyph_metrics(void *backend_data, glyph_id_t glyph_id,
     76static errno_t bb_get_glyph_metrics(void *backend_data, glyph_id_t glyph_id,
    7777    glyph_metrics_t *glyph_metrics)
    7878{
     
    8989        glyph_metrics_t gm;
    9090       
    91         int rc = data->decoder->load_glyph_metrics(data->decoder_data, glyph_id,
     91        errno_t rc = data->decoder->load_glyph_metrics(data->decoder_data, glyph_id,
    9292            &gm);
    9393        if (rc != EOK)
     
    115115}
    116116
    117 static int get_glyph_surface(bitmap_backend_data_t *data, glyph_id_t glyph_id,
     117static errno_t get_glyph_surface(bitmap_backend_data_t *data, glyph_id_t glyph_id,
    118118    surface_t **result)
    119119{
     
    127127       
    128128        surface_t *raw_surface;
    129         int rc = data->decoder->load_glyph_surface(data->decoder_data, glyph_id,
     129        errno_t rc = data->decoder->load_glyph_surface(data->decoder_data, glyph_id,
    130130            &raw_surface);
    131131        if (rc != EOK)
     
    173173}
    174174
    175 static int bb_render_glyph(void *backend_data, drawctx_t *context,
     175static errno_t bb_render_glyph(void *backend_data, drawctx_t *context,
    176176    source_t *source, sysarg_t ox, sysarg_t oy, glyph_id_t glyph_id)
    177177{
     
    179179       
    180180        glyph_metrics_t glyph_metrics;
    181         int rc = bb_get_glyph_metrics(backend_data, glyph_id, &glyph_metrics);
     181        errno_t rc = bb_get_glyph_metrics(backend_data, glyph_id, &glyph_metrics);
    182182        if (rc != EOK)
    183183                return rc;
     
    224224};
    225225
    226 int bitmap_font_create(bitmap_font_decoder_t *decoder, void *decoder_data,
     226errno_t bitmap_font_create(bitmap_font_decoder_t *decoder, void *decoder_data,
    227227    uint32_t glyph_count, font_metrics_t font_metrics, uint16_t points,
    228228    font_t **out_font)
Note: See TracChangeset for help on using the changeset viewer.