Changeset a35b458 in mainline for uspace/lib/c/include


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.

Location:
uspace/lib/c/include
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/adt/hash_table.h

    r3061bc1 ra35b458  
    5151        /** Returns the hash of the key stored in the item (ie its lookup key). */
    5252        size_t (*hash)(const ht_link_t *item);
    53        
     53
    5454        /** Returns the hash of the key. */
    5555        size_t (*key_hash)(void *key);
    56        
     56
    5757        /** True if the items are equal (have the same lookup keys). */
    5858        bool (*equal)(const ht_link_t *item1, const ht_link_t *item2);
  • uspace/lib/c/include/adt/list.h

    r3061bc1 ra35b458  
    231231                link->prev->next = link->next;
    232232        }
    233        
     233
    234234        link_initialize(link);
    235235}
     
    314314        part1->prev->next = part2;
    315315        part2->prev->next = part1;
    316        
     316
    317317        link_t *hlp = part1->prev;
    318        
     318
    319319        part1->prev = part2->prev;
    320320        part2->prev = hlp;
     
    378378{
    379379        unsigned long cnt = 0;
    380        
     380
    381381        link_t *link = list_first(list);
    382382        while (link != NULL) {
    383383                if (cnt == n)
    384384                        return link;
    385                
     385
    386386                cnt++;
    387387                link = list_next(link, list);
    388388        }
    389        
     389
    390390        return NULL;
    391391}
  • uspace/lib/c/include/as.h

    r3061bc1 ra35b458  
    4646        if (size == 0)
    4747                return 0;
    48        
     48
    4949        return (size_t) ((size - 1) >> PAGE_WIDTH) + 1;
    5050}
  • uspace/lib/c/include/async.h

    r3061bc1 ra35b458  
    8282         */
    8383        EXCHANGE_ATOMIC = 0,
    84        
     84
    8585        /** Exchange management via mutual exclusion
    8686         *
     
    9090         */
    9191        EXCHANGE_SERIALIZE = 1,
    92        
     92
    9393        /** Exchange management via phone cloning
    9494         *
  • uspace/lib/c/include/bitops.h

    r3061bc1 ra35b458  
    6666{
    6767        unsigned int n = 0;
    68        
     68
    6969        if (arg >> 16) {
    7070                arg >>= 16;
    7171                n += 16;
    7272        }
    73        
     73
    7474        if (arg >> 8) {
    7575                arg >>= 8;
    7676                n += 8;
    7777        }
    78        
     78
    7979        if (arg >> 4) {
    8080                arg >>= 4;
    8181                n += 4;
    8282        }
    83        
     83
    8484        if (arg >> 2) {
    8585                arg >>= 2;
    8686                n += 2;
    8787        }
    88        
     88
    8989        if (arg >> 1) {
    9090                arg >>= 1;
    9191                n += 1;
    9292        }
    93        
     93
    9494        return n;
    9595}
     
    9898{
    9999        unsigned int n = 0;
    100        
     100
    101101        if (arg >> 32) {
    102102                arg >>= 32;
    103103                n += 32;
    104104        }
    105        
     105
    106106        return (n + fnzb32((uint32_t) arg));
    107107}
  • uspace/lib/c/include/device/hw_res.h

    r3061bc1 ra35b458  
    8282                        endianness_t endianness;
    8383                } mem_range;
    84                
     84
    8585                struct {
    8686                        uint64_t address;
     
    8989                        endianness_t endianness;
    9090                } io_range;
    91                
     91
    9292                struct {
    9393                        int irq;
    9494                } interrupt;
    95                
     95
    9696                union {
    9797                        unsigned int dma8;
     
    112112                hw_res->resources = NULL;
    113113        }
    114        
     114
    115115        hw_res->count = 0;
    116116}
  • uspace/lib/c/include/device/hw_res_parsed.h

    r3061bc1 ra35b458  
    6464        /** Start address */
    6565        address64_t address;
    66        
     66
    6767        /** Area size */
    6868        size_t size;
     
    8282        /** Irq count */
    8383        size_t count;
    84        
     84
    8585        /** Array of IRQs */
    8686        int *irqs;
     
    100100        /** Areas count */
    101101        size_t count;
    102        
     102
    103103        /** Array of areas */
    104104        addr_range_t *ranges;
     
    115115        /** List of IRQs */
    116116        irq_list_t irqs;
    117        
     117
    118118        /** List of DMA channels */
    119119        dma_list_t dma_channels;
    120        
     120
    121121        /** List of memory areas */
    122122        mem_range_list_t mem_ranges;
    123        
     123
    124124        /** List of IO areas */
    125125        io_range_list_t io_ranges;
     
    136136        if (list == NULL)
    137137                return;
    138        
     138
    139139        free(list->irqs.irqs);
    140140        free(list->io_ranges.ranges);
    141141        free(list->mem_ranges.ranges);
    142142        free(list->dma_channels.channels);
    143        
     143
    144144        memset(list, 0, sizeof(hw_res_list_parsed_t));
    145145}
  • uspace/lib/c/include/fibril.h

    r3061bc1 ra35b458  
    7373        errno_t (*func)(void *);
    7474        tcb_t *tcb;
    75        
     75
    7676        struct fibril *clean_after_me;
    7777        errno_t retval;
    7878        int flags;
    79        
     79
    8080        fibril_owner_info_t *waits_for;
    8181
  • uspace/lib/c/include/fibril_synch.h

    r3061bc1 ra35b458  
    6161                } \
    6262        }
    63        
     63
    6464#define FIBRIL_MUTEX_INITIALIZE(name) \
    6565        fibril_mutex_t name = FIBRIL_MUTEX_INITIALIZER(name)
  • uspace/lib/c/include/futex.h

    r3061bc1 ra35b458  
    8080        } \
    8181})
    82                
     82
    8383#define futex_unlock(fut) \
    8484({ \
     
    9191
    9292extern void futex_upgrade_all_and_wait(void);
    93                
     93
    9494#else
    9595
     
    9999#define futex_trylock(fut)  futex_trydown((fut))
    100100#define futex_unlock(fut)   (void) futex_up((fut))
    101                
     101
    102102#endif
    103103
     
    130130        if ((atomic_signed_t) atomic_predec(&futex->val) < 0)
    131131                return (errno_t) __SYSCALL1(SYS_FUTEX_SLEEP, (sysarg_t) &futex->val.count);
    132        
     132
    133133        return EOK;
    134134}
     
    147147        if ((atomic_signed_t) atomic_postinc(&futex->val) < 0)
    148148                return (errno_t) __SYSCALL1(SYS_FUTEX_WAKEUP, (sysarg_t) &futex->val.count);
    149        
     149
    150150        return EOK;
    151151}
  • uspace/lib/c/include/inet/addr.h

    r3061bc1 ra35b458  
    6666        /** IP version */
    6767        ip_ver_t version;
    68        
     68
    6969        /** Address */
    7070        union {
     
    7272                addr128_t addr6;
    7373        };
    74        
     74
    7575        /** Number of valid bits */
    7676        uint8_t prefix;
  • uspace/lib/c/include/io/charfield.h

    r3061bc1 ra35b458  
    8686        if (a1.type != a2.type)
    8787                return false;
    88        
     88
    8989        switch (a1.type) {
    9090        case CHAR_ATTR_STYLE:
     
    9898                    && (a1.val.rgb.fgcolor == a2.val.rgb.fgcolor);
    9999        }
    100        
     100
    101101        return false;
    102102}
  • uspace/lib/c/include/io/chargrid.h

    r3061bc1 ra35b458  
    4949        size_t size;            /**< Structure size */
    5050        chargrid_flag_t flags;  /**< Screenbuffer flags */
    51        
     51
    5252        sysarg_t cols;          /**< Number of columns */
    5353        sysarg_t rows;          /**< Number of rows */
    54        
     54
    5555        sysarg_t col;           /**< Current column */
    5656        sysarg_t row;           /**< Current row */
    5757        bool cursor_visible;    /**< Cursor visibility */
    58        
     58
    5959        char_attrs_t attrs;     /**< Current attributes */
    60        
     60
    6161        sysarg_t top_row;       /**< The first row in the cyclic buffer */
    6262        charfield_t data[];     /**< Screen contents (cyclic buffer) */
  • uspace/lib/c/include/io/console.h

    r3061bc1 ra35b458  
    4949        /** Console input file */
    5050        FILE *input;
    51        
     51
    5252        /** Console output file */
    5353        FILE *output;
    54        
     54
    5555        /** Console input session */
    5656        async_sess_t *input_sess;
    57        
     57
    5858        /** Console output session */
    5959        async_sess_t *output_sess;
    60        
     60
    6161        /** Input request call with timeout */
    6262        ipc_call_t input_call;
    63        
     63
    6464        /** Input response with timeout */
    6565        aid_t input_aid;
  • uspace/lib/c/include/io/kbd_event.h

    r3061bc1 ra35b458  
    4848        /** List handle */
    4949        link_t link;
    50        
     50
    5151        /** Press or release event. */
    5252        kbd_event_type_t type;
    53        
     53
    5454        /** Keycode of the key that was pressed or released. */
    5555        keycode_t key;
    56        
     56
    5757        /** Bitmask of modifiers held. */
    5858        keymod_t mods;
    59        
     59
    6060        /** The character that was generated or '\0' for none. */
    6161        wchar_t c;
  • uspace/lib/c/include/io/keycode.h

    r3061bc1 ra35b458  
    9393
    9494        KC_CAPS_LOCK,
    95        
     95
    9696        KC_A,
    9797        KC_S,
     
    199199        KC_N0,
    200200        KC_NPERIOD
    201        
     201
    202202} keycode_t;
    203203
     
    212212        KM_NUM_LOCK    = 0x080,
    213213        KM_SCROLL_LOCK = 0x100,
    214        
     214
    215215        KM_SHIFT       = KM_LSHIFT | KM_RSHIFT,
    216216        KM_CTRL        = KM_LCTRL | KM_RCTRL,
  • uspace/lib/c/include/io/mode.h

    r3061bc1 ra35b458  
    5555        sysarg_t index;
    5656        sysarg_t version;
    57        
     57
    5858        sysarg_t refresh_rate;
    5959        aspect_ratio_t screen_aspect;
    6060        sysarg_t screen_width;
    6161        sysarg_t screen_height;
    62        
     62
    6363        aspect_ratio_t cell_aspect;
    6464        cell_visual_t cell_visual;
  • uspace/lib/c/include/io/pixelmap.h

    r3061bc1 ra35b458  
    4747        /* Pixels outside of a pixmap are PIXEL(0, 0, 0, 0) */
    4848        PIXELMAP_EXTEND_TRANSPARENT_BLACK = 0,
    49        
     49
    5050        /* The pixmap is repeated infinetely */
    5151        PIXELMAP_EXTEND_TILE,
    52        
     52
    5353        /* If outside of a pixmap, return closest pixel from the edge */
    5454        PIXELMAP_EXTEND_SIDES,
    55        
     55
    5656        /* If outside of a pixmap, return closest pixel from the edge,
    5757         * with alpha = 0
     
    125125                        transparent = transparent_outside;
    126126                }
    127                
     127
    128128                if (y < 0) {
    129129                        y = 0;
     
    135135                }
    136136        }
    137        
     137
    138138        if (x < 0 || ((sysarg_t) x) >= pixmap->width ||
    139139            y < 0 || ((sysarg_t) y) >= pixmap->height)
     
    141141
    142142        pixel_t pixel = pixelmap_get_pixel(pixmap, x, y);
    143        
     143
    144144        if (transparent)
    145145                pixel = PIXEL(0, RED(pixel), GREEN(pixel), BLUE(pixel));
    146        
     146
    147147        return pixel;
    148148}
  • uspace/lib/c/include/io/printf_core.h

    r3061bc1 ra35b458  
    4343        /* String output function, returns number of printed characters or EOF */
    4444        int (*str_write)(const char *, size_t, void *);
    45        
     45
    4646        /* Wide string output function, returns number of printed characters or EOF */
    4747        int (*wstr_write)(const wchar_t *, size_t, void *);
    48        
     48
    4949        /* User data - output stream specification, state, locks, etc. */
    5050        void *data;
  • uspace/lib/c/include/ipc/devman.h

    r3061bc1 ra35b458  
    4646        /** Driver has not been started. */
    4747        DRIVER_NOT_STARTED = 0,
    48        
     48
    4949        /**
    5050         * Driver has been started, but has not registered as running and ready
     
    5252         */
    5353        DRIVER_STARTING,
    54        
     54
    5555        /** Driver is running and prepared to serve incomming requests. */
    5656        DRIVER_RUNNING
     
    110110        match_id_t *mid = NULL;
    111111        link_t *link = ids->ids.head.next;
    112        
     112
    113113        while (link != &ids->ids.head) {
    114114                mid = list_get_instance(link, match_id_t,link);
     
    118118                link = link->next;
    119119        }
    120        
     120
    121121        list_insert_before(&id->link, link);
    122122}
     
    131131        link_t *link = NULL;
    132132        match_id_t *id;
    133        
     133
    134134        while (!list_empty(&ids->ids)) {
    135135                link = list_first(&ids->ids);
  • uspace/lib/c/include/ipc/graph.h

    r3061bc1 ra35b458  
    4141        VISUALIZER_CLAIM = IPC_FIRST_USER_METHOD,
    4242        VISUALIZER_YIELD,
    43        
     43
    4444        VISUALIZER_ENUMERATE_MODES,
    4545        VISUALIZER_GET_DEFAULT_MODE,
     
    4747        VISUALIZER_GET_MODE,
    4848        VISUALIZER_SET_MODE,
    49        
     49
    5050        VISUALIZER_UPDATE_DAMAGED_REGION,
    51        
     51
    5252        VISUALIZER_SUSPEND,
    5353        VISUALIZER_WAKE_UP,
  • uspace/lib/c/include/ipc/output.h

    r3061bc1 ra35b458  
    4545        OUTPUT_GET_DIMENSIONS,
    4646        OUTPUT_GET_CAPS,
    47        
     47
    4848        OUTPUT_FRONTBUF_CREATE,
    4949        OUTPUT_FRONTBUF_DESTROY,
    50        
     50
    5151        OUTPUT_CURSOR_UPDATE,
    5252        OUTPUT_SET_STYLE,
    5353        OUTPUT_SET_COLOR,
    5454        OUTPUT_SET_RGB_COLOR,
    55        
     55
    5656        OUTPUT_UPDATE,
    5757        OUTPUT_DAMAGE
  • uspace/lib/c/include/ipc/vfs.h

    r3061bc1 ra35b458  
    170170        WALK_MAY_CREATE = (1 << 0),
    171171        WALK_MUST_CREATE = (1 << 1),
    172        
     172
    173173        WALK_REGULAR = (1 << 2),
    174174        WALK_DIRECTORY = (1 << 3),
    175175        WALK_MOUNT_POINT = (1 << 4),
    176        
     176
    177177        WALK_ALL_FLAGS = WALK_MAY_CREATE | WALK_MUST_CREATE | WALK_REGULAR |
    178178            WALK_DIRECTORY | WALK_MOUNT_POINT,
  • uspace/lib/c/include/loader/pcb.h

    r3061bc1 ra35b458  
    5555        /** Program entry point. */
    5656        entry_point_t entry;
    57        
     57
    5858        /** Current working directory. */
    5959        char *cwd;
    60        
     60
    6161        /** Number of command-line arguments. */
    6262        int argc;
    6363        /** Command-line arguments. */
    6464        char **argv;
    65        
     65
    6666        /** List of inbox files. */
    6767        struct pcb_inbox_entry *inbox;
    6868        int inbox_entries;
    69        
     69
    7070        /*
    7171         * ELF-specific data.
    7272         */
    73        
     73
    7474        /** Pointer to ELF dynamic section of the program. */
    7575        void *dynamic;
  • uspace/lib/c/include/nic/nic.h

    r3061bc1 ra35b458  
    218218
    219219        /* for cslip etc */
    220        
     220
    221221        /** Total compressed packets received. */
    222222        unsigned long receive_compressed;
Note: See TracChangeset for help on using the changeset viewer.