From 901402c99018422c994bdb297e3ba404969c88ea Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 30 Mar 2020 22:26:36 +0200 Subject: Added documentation for ht and lst --- src/ht/ft_htnew.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/ht/ft_htnew.c') diff --git a/src/ht/ft_htnew.c b/src/ht/ft_htnew.c index 465eabf..e28b544 100644 --- a/src/ht/ft_htnew.c +++ b/src/ht/ft_htnew.c @@ -13,10 +13,10 @@ #include "libft.h" #include "libft_ht.h" -/* -** Create a new hash table. -** `size` is the size of the underlying array of linked list (buckets) -** Return NULL is an allocation failed. +/** +** \brief Create a new hash table. +** \param size Size of the underlying array of linked list (buckets) +** \return Created hash table or NULL is an allocation failed */ t_ftht *ft_htnew(t_ftsize size) @@ -27,8 +27,8 @@ t_ftht *ft_htnew(t_ftsize size) return (NULL); if ((ht = (t_ftht*)malloc(sizeof(t_ftht))) == NULL) return (NULL); - ht->entries = (t_ftht_entry*)ft_calloc(size, sizeof(t_ftht_entry)); - if (ht->entries == NULL) + ht->buckets = (t_ftht_bucket*)ft_calloc(size, sizeof(t_ftht_entry)); + if (ht->buckets == NULL) { free(ht); return (NULL); -- cgit