Changeset 1b20da0 in mainline for uspace/lib/c/include/adt


Ignore:
Timestamp:
2018-02-28T17:52:03Z (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:
3061bc1
Parents:
df6ded8
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:26:03)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:52:03)
Message:

style: Remove trailing whitespace on non-empty lines, in certain file types.

Command used: tools/srepl '\([^[:space:]]\)\s\+$' '\1' -- *.c *.h *.py *.sh *.s *.S *.ag

Location:
uspace/lib/c/include/adt
Files:
4 edited

Legend:

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

    rdf6ded8 r1b20da0  
    7878 *
    7979 * FIFO is allocated dynamically.
    80  * This macro is suitable for creating larger FIFOs. 
     80 * This macro is suitable for creating larger FIFOs.
    8181 *
    8282 * @param name Name of FIFO.
     
    113113 */
    114114#define fifo_push(name, value) \
    115         name.fifo[name.tail = (name.tail + 1) < name.items ? (name.tail + 1) : 0] = (value) 
     115        name.fifo[name.tail = (name.tail + 1) < name.items ? (name.tail + 1) : 0] = (value)
    116116
    117117/** Allocate memory for dynamic FIFO.
  • uspace/lib/c/include/adt/hash.h

    rdf6ded8 r1b20da0  
    4646         * Public domain.
    4747         */
    48         hash = ~hash + (hash << 15); 
     48        hash = ~hash + (hash << 15);
    4949        hash = hash ^ (hash >> 12);
    5050        hash = hash + (hash << 2);
    5151        hash = hash ^ (hash >> 4);
    52         hash = hash * 2057; 
     52        hash = hash * 2057;
    5353        hash = hash ^ (hash >> 16);
    54         return hash;   
     54        return hash;
    5555}
    5656
     
    6666        hash = hash ^ (hash >> 4);
    6767        hash = hash * 0x27d4eb2d;
    68         hash = hash ^ (hash >> 15);     
    69         /* 
     68        hash = hash ^ (hash >> 15);
     69        /*
    7070         * Lower order bits are mixed more thoroughly. Swap them with
    7171         * the higher order bits and make the resulting higher order bits
     
    7676
    7777/** Produces a uniform hash affecting all output bits from the skewed input. */
    78 static inline size_t hash_mix(size_t hash) 
     78static inline size_t hash_mix(size_t hash)
    7979{
    8080#ifdef __32_BITS__
     
    8888
    8989/** Use to create a hash from multiple values.
    90  * 
     90 *
    9191 * Typical usage:
    9292 * @code
     
    102102static inline size_t hash_combine(size_t seed, size_t hash)
    103103{
    104         /* 
     104        /*
    105105         * todo: use Bob Jenkin's proper mixing hash pass:
    106106         * http://burtleburtle.net/bob/c/lookup3.c
    107107         */
    108         seed ^= hash + 0x9e3779b9 
     108        seed ^= hash + 0x9e3779b9
    109109                + ((seed << 5) | (seed >> (sizeof(size_t) * 8 - 5)));
    110         return seed;   
     110        return seed;
    111111}
    112112
  • uspace/lib/c/include/adt/hash_table.h

    rdf6ded8 r1b20da0  
    22 * Copyright (c) 2006 Jakub Jermar
    33 * Copyright (c) 2012 Adam Hraska
    4  * 
     4 *
    55 * All rights reserved.
    66 *
     
    6262
    6363        /** Hash table item removal callback.
    64          * 
     64         *
    6565         * Must not invoke any mutating functions of the hash table.
    6666         *
  • uspace/lib/c/include/adt/list.h

    rdf6ded8 r1b20da0  
    6666
    6767/** Initializer for statically allocated list.
    68  * 
     68 *
    6969 * @code
    7070 * struct named_list {
    7171 *     const char *name;
    7272 *     list_t list;
    73  * } var = { 
    74  *     .name = "default name", 
    75  *     .list = LIST_INITIALIZER(name_list.list) 
     73 * } var = {
     74 *     .name = "default name",
     75 *     .list = LIST_INITIALIZER(name_list.list)
    7676 * };
    7777 * @endcode
     
    111111 *     link_t item_link;
    112112 * } item_t;
    113  * 
     113 *
    114114 * //..
    115  * 
     115 *
    116116 * // Print each list element's value and remove the element from the list.
    117117 * list_foreach_safe(mylist, cur_link, next_link) {
     
    121121 * }
    122122 * @endcode
    123  * 
     123 *
    124124 * @param list List to traverse.
    125125 * @param iterator Iterator to the current element of the list.
Note: See TracChangeset for help on using the changeset viewer.