Ignore:
Timestamp:
2018-03-02T20:10:49Z (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:
f1380b7
Parents:
3061bc1
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
Message:

style: Remove trailing whitespace on _all_ lines, including empty ones, for particular file types.

Command used: tools/srepl '\s\+$' '' -- *.c *.h *.py *.sh *.s *.S *.ag

Currently, whitespace on empty lines is very inconsistent.
There are two basic choices: Either remove the whitespace, or keep empty lines
indented to the level of surrounding code. The former is AFAICT more common,
and also much easier to do automatically.

Alternatively, we could write script for automatic indentation, and use that
instead. However, if such a script exists, it's possible to use the indented
style locally, by having the editor apply relevant conversions on load/save,
without affecting remote repository. IMO, it makes more sense to adopt
the simpler rule.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/draw/font/bitmap_backend.c

    r3061bc1 ra35b458  
    6262{
    6363        bitmap_backend_data_t *data = (bitmap_backend_data_t *) backend_data;
    64        
     64
    6565        *font_metrics = data->font_metrics;
    66        
     66
    6767        return EOK;
    6868}
     
    7878{
    7979        bitmap_backend_data_t *data = (bitmap_backend_data_t *) backend_data;
    80        
     80
    8181        if (glyph_id >= data->glyph_count)
    8282                return ENOENT;
    83        
     83
    8484        if (data->glyph_cache[glyph_id].metrics_loaded) {
    8585                *glyph_metrics = data->glyph_cache[glyph_id].metrics;
    8686                return EOK;
    8787        }
    88        
     88
    8989        glyph_metrics_t gm;
    90        
     90
    9191        errno_t rc = data->decoder->load_glyph_metrics(data->decoder_data, glyph_id,
    9292            &gm);
    9393        if (rc != EOK)
    9494                return rc;
    95        
     95
    9696        if (data->scale) {
    9797                gm.left_side_bearing = (metric_t)
     
    106106                    (data->scale_ratio * gm.height + 0.5);
    107107        }
    108        
    109        
    110        
     108
     109
     110
    111111        data->glyph_cache[glyph_id].metrics = gm;
    112112        data->glyph_cache[glyph_id].metrics_loaded = true;
     
    120120        if (glyph_id >= data->glyph_count)
    121121                return ENOENT;
    122        
     122
    123123        if (data->glyph_cache[glyph_id].surface != NULL) {
    124124                *result = data->glyph_cache[glyph_id].surface;
    125125                return EOK;
    126126        }
    127        
     127
    128128        surface_t *raw_surface;
    129129        errno_t rc = data->decoder->load_glyph_surface(data->decoder_data, glyph_id,
     
    131131        if (rc != EOK)
    132132                return rc;
    133        
     133
    134134        sysarg_t w;
    135135        sysarg_t h;
    136136        surface_get_resolution(raw_surface, &w, &h);
    137        
     137
    138138        if (!data->scale) {
    139139                *result = raw_surface;
    140140                return EOK;
    141141        }
    142        
     142
    143143        source_t source;
    144144        source_init(&source);
     
    167167
    168168        surface_destroy(raw_surface);
    169        
     169
    170170        data->glyph_cache[glyph_id].surface = scaled_surface;
    171171        *result = scaled_surface;
     
    177177{
    178178        bitmap_backend_data_t *data = (bitmap_backend_data_t *) backend_data;
    179        
     179
    180180        glyph_metrics_t glyph_metrics;
    181181        errno_t rc = bb_get_glyph_metrics(backend_data, glyph_id, &glyph_metrics);
    182182        if (rc != EOK)
    183183                return rc;
    184        
     184
    185185        surface_t *glyph_surface;
    186186        rc = get_glyph_surface(data, glyph_id, &glyph_surface);
    187187        if (rc != EOK)
    188188                return rc;
    189        
     189
    190190        native_t x = ox + glyph_metrics.left_side_bearing;
    191191        native_t y = oy - glyph_metrics.ascender;
    192        
     192
    193193        transform_t transform;
    194194        transform_identity(&transform);
     
    230230        if (glyph_count == 0)
    231231                return EINVAL;
    232        
     232
    233233        bitmap_backend_data_t *data = malloc(sizeof(bitmap_backend_data_t));
    234234        if (data == NULL)
     
    275275                return ENOMEM;
    276276        }
    277        
     277
    278278        *out_font = font;
    279279        return EOK;
Note: See TracChangeset for help on using the changeset viewer.