Changeset a35b458 in mainline for uspace/srv/hid/rfb/main.c


Ignore:
Timestamp:
2018-03-02T20:10:49Z (6 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/srv/hid/rfb/main.c

    r3061bc1 ra35b458  
    7878{
    7979        fibril_mutex_lock(&rfb.lock);
    80        
     80
    8181        if (x0 + width > rfb.width || y0 + height > rfb.height) {
    8282                fibril_mutex_unlock(&rfb.lock);
    8383                return EINVAL;
    8484        }
    85        
     85
    8686        /* TODO update surface_t and use it */
    8787        if (!rfb.damage_valid) {
     
    112112                }
    113113        }
    114        
     114
    115115        pixelmap_t *map = &vs->cells;
    116        
     116
    117117        for (sysarg_t y = y0; y < height + y0; ++y) {
    118118                for (sysarg_t x = x0; x < width + x0; ++x) {
     
    122122                }
    123123        }
    124        
     124
    125125        fibril_mutex_unlock(&rfb.lock);
    126126        return EOK;
     
    161161
    162162        const char *rfb_name = argv[1];
    163        
     163
    164164        char *endptr;
    165165        unsigned long width = strtoul(argv[2], &endptr, 0);
     
    169169                return 1;
    170170        }
    171        
     171
    172172        unsigned long height = strtoul(argv[3], &endptr, 0);
    173173        if (*endptr != 0) {
     
    176176                return 1;
    177177        }
    178        
     178
    179179        unsigned long port = 5900;
    180180        if (argc > 4) {
     
    186186                }
    187187        }
    188        
     188
    189189        rfb_init(&rfb, width, height, rfb_name);
    190        
     190
    191191        vis = malloc(sizeof(visualizer_t));
    192192        if (vis == NULL) {
     
    194194                return 3;
    195195        }
    196        
     196
    197197        graph_init_visualizer(vis);
    198        
     198
    199199        pixel_mode.mode.index = 0;
    200200        pixel_mode.mode.version = 0;
     
    207207        pixel_mode.mode.cell_aspect.height = 1;
    208208        pixel_mode.mode.cell_visual.pixel_visual = VISUAL_RGB_8_8_8;
    209        
     209
    210210        link_initialize(&pixel_mode.link);
    211211        list_append(&pixel_mode.link, &vis->modes);
    212        
     212
    213213        vis->def_mode_idx = 0;
    214        
     214
    215215        vis->ops = rfb_ops;
    216216        vis->dev_ctx = NULL;
     
    232232
    233233        service_id_t service_id;
    234        
     234
    235235        rc = loc_service_register(service_name, &service_id);
    236236        if (rc != EOK) {
     
    238238                return rc;
    239239        }
    240        
     240
    241241        free(service_name);
    242242
     
    247247                return 1;
    248248        }
    249        
     249
    250250        rc = loc_service_add_to_cat(service_id, visualizer_category);
    251251        if (rc != EOK) {
     
    253253                return 1;
    254254        }
    255        
     255
    256256        rc = rfb_listen(&rfb, port);
    257257        if (rc != EOK) {
     
    259259                return 2;
    260260        }
    261        
     261
    262262        printf("%s: Accepting connections\n", NAME);
    263263        task_retval(0);
Note: See TracChangeset for help on using the changeset viewer.