Changeset ad9178bf in mainline for common


Ignore:
Timestamp:
2023-10-27T18:20:03Z (20 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, topic/msim-upgrade, topic/simplify-dev-export
Children:
694ca3d6
Parents:
55c5cb05
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-10-27 18:14:50)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-10-27 18:20:03)
Message:

Deduplicate ADT

Location:
common
Files:
17 moved

Legend:

Unmodified
Added
Removed
  • common/adt/hash_table.c

    r55c5cb05 rad9178bf  
    5252#include <adt/list.h>
    5353#include <assert.h>
    54 #include <member.h>
    5554#include <stdlib.h>
    5655#include <str.h>
  • common/include/adt/hash.h

    r55c5cb05 rad9178bf  
    3535#define _LIBC_ADT_HASH_H_
    3636
     37#include <stddef.h>
    3738#include <stdint.h>
    38 #include <types/common.h>
    3939
    4040/** Produces a uniform hash affecting all output bits from the skewed input. */
     
    7878static inline size_t hash_mix(size_t hash)
    7979{
    80 #ifdef __32_BITS__
    81         return hash_mix32(hash);
    82 #elif defined(__64_BITS__)
    83         return hash_mix64(hash);
    84 #else
    85 #error Unknown size_t size - cannot select proper hash mix function.
    86 #endif
     80        if (sizeof(long) == 4)
     81                return hash_mix32(hash);
     82        else
     83                return hash_mix64(hash);
    8784}
    8885
Note: See TracChangeset for help on using the changeset viewer.