diff options
| author | Thomas Schmucker <ts@its1.de> | 2024-09-06 21:10:21 +0200 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2024-09-06 21:10:21 +0200 |
| commit | 9e8caf1e06ba7510160305da11a30d91dcfc23e5 (patch) | |
| tree | 30da0c941191d0907abe829feb1bf75f0fca4b3a /src/hash-table.c | |
| parent | 4ecdad9462c4447c1370cf1dd1341b2289c28566 (diff) | |
| download | data-structures-9e8caf1e06ba7510160305da11a30d91dcfc23e5.tar.gz data-structures-9e8caf1e06ba7510160305da11a30d91dcfc23e5.tar.bz2 data-structures-9e8caf1e06ba7510160305da11a30d91dcfc23e5.zip | |
reformat source code
Diffstat (limited to 'src/hash-table.c')
| -rw-r--r-- | src/hash-table.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/hash-table.c b/src/hash-table.c index 256fac9..8c93bc6 100644 --- a/src/hash-table.c +++ b/src/hash-table.c | |||
| @@ -11,7 +11,7 @@ typedef int T; | |||
| 11 | 11 | ||
| 12 | struct hash_item { | 12 | struct hash_item { |
| 13 | struct hash_item *next; | 13 | struct hash_item *next; |
| 14 | char * key; | 14 | char *key; |
| 15 | T data; | 15 | T data; |
| 16 | }; | 16 | }; |
| 17 | 17 | ||
| @@ -48,7 +48,7 @@ static struct hash_item * | |||
| 48 | hash_add(struct hash_item *next, const char *key, T data) | 48 | hash_add(struct hash_item *next, const char *key, T data) |
| 49 | { | 49 | { |
| 50 | struct hash_item *new_item; | 50 | struct hash_item *new_item; |
| 51 | char * new_key; | 51 | char *new_key; |
| 52 | 52 | ||
| 53 | new_key = strdup(key); // strdup: not standard but commonly used... | 53 | new_key = strdup(key); // strdup: not standard but commonly used... |
| 54 | new_item = malloc(sizeof *new_item); | 54 | new_item = malloc(sizeof *new_item); |
| @@ -199,7 +199,7 @@ print(const char *key, T data, void *cl) | |||
| 199 | } | 199 | } |
| 200 | 200 | ||
| 201 | int | 201 | int |
| 202 | main() | 202 | main(void) |
| 203 | { | 203 | { |
| 204 | struct hash_tab ht[1]; | 204 | struct hash_tab ht[1]; |
| 205 | char word[100]; | 205 | char word[100]; |
