Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 7fad9712 in mainline


Ignore:
Timestamp:
2020-05-17T17:22:04Z (7 days ago)
Author:
GitHub <noreply@…>
Parents:
807be7e (diff), d864b0e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Matthieu Riolo <matthieu.riolo@…> (2020-05-17 17:22:04)
git-committer:
GitHub <noreply@…> (2020-05-17 17:22:04)
Message:

Merge d864b0e5e6b11025da58cb22871435828ad39165 into 807be7ee42522e194eac3944cc4b65503a2f8c26

Location:
uspace/lib
Files:
12 added
4 edited

Legend:

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

    r807be7e r7fad9712  
    111111}
    112112
     113/** Calculate hash of NULL-terminated string
     114 *
     115 * TODO Modify also same file in kernel subtree?
     116 *
     117 * @param[in]  str     NULL-terminated string (not NULL)
     118 */
     119static inline size_t hash_string(const char *str)
     120{
     121        /*
     122         * Using djb2 function
     123         * http://www.cse.yorku.ca/~oz/hash.html
     124         */
     125        size_t hash = 5381;
     126        char c;
     127        while ((c = *str++)) {
     128                hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
     129        }
     130        return hash;
     131}
     132
    113133#endif
  • uspace/lib/c/meson.build

    r807be7e r7fad9712  
    163163        'generic/adt/checksum.c',
    164164        'generic/adt/circ_buf.c',
     165        'generic/adt/array.c',
    165166        'generic/adt/list.c',
    166167        'generic/adt/hash_table.c',
     
    203204test_src = files(
    204205        'test/adt/circ_buf.c',
     206        'test/adt/array.c',
    205207        'test/adt/odict.c',
    206208        'test/capa.c',
  • uspace/lib/c/test/main.c

    r807be7e r7fad9712  
    3232PCUT_INIT;
    3333
     34PCUT_IMPORT(array);
    3435PCUT_IMPORT(capa);
    3536PCUT_IMPORT(casting);
  • uspace/lib/meson.build

    r807be7e r7fad9712  
    4949        'clui',
    5050        'compress',
     51        'conf',
    5152        'cpp',
    5253        'crypto',
Note: See TracChangeset for help on using the changeset viewer.