diff options
| author | 2022-10-08 07:00:05 +0200 | |
|---|---|---|
| committer | 2022-10-08 07:00:05 +0200 | |
| commit | 0f4779e2a095b72b7ec7fc0f2abe2cc57f152b76 (patch) | |
| tree | d9b945a8c84ba1441ad1563a78259e6ae95e4c1a /xs_set.h | |
| parent | More emoticons. (diff) | |
| download | penes-snac2-0f4779e2a095b72b7ec7fc0f2abe2cc57f152b76.tar.gz penes-snac2-0f4779e2a095b72b7ec7fc0f2abe2cc57f152b76.tar.xz penes-snac2-0f4779e2a095b72b7ec7fc0f2abe2cc57f152b76.zip | |
Backport from xs.
Diffstat (limited to 'xs_set.h')
| -rw-r--r-- | xs_set.h | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -13,7 +13,7 @@ typedef struct _xs_set { | |||
| 13 | 13 | ||
| 14 | xs_set *xs_set_new(int elems); | 14 | xs_set *xs_set_new(int elems); |
| 15 | void xs_set_free(xs_set *s); | 15 | void xs_set_free(xs_set *s); |
| 16 | int xs_set_add(xs_set *s, char *data); | 16 | int xs_set_add(xs_set *s, const char *data); |
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | #ifdef XS_IMPLEMENTATION | 19 | #ifdef XS_IMPLEMENTATION |
| @@ -40,7 +40,7 @@ void xs_set_free(xs_set *s) | |||
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | 42 | ||
| 43 | unsigned int _xs_set_hash(char *data, int size) | 43 | unsigned int _xs_set_hash(const char *data, int size) |
| 44 | { | 44 | { |
| 45 | unsigned int hash = 0x666; | 45 | unsigned int hash = 0x666; |
| 46 | int n; | 46 | int n; |
| @@ -54,7 +54,7 @@ unsigned int _xs_set_hash(char *data, int size) | |||
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | 56 | ||
| 57 | int xs_set_add(xs_set *s, char *data) | 57 | int xs_set_add(xs_set *s, const char *data) |
| 58 | /* adds the data to the set */ | 58 | /* adds the data to the set */ |
| 59 | /* returns: 1 if added, 0 if already there, -1 if it's full */ | 59 | /* returns: 1 if added, 0 if already there, -1 if it's full */ |
| 60 | { | 60 | { |