Skip to content
Snippets Groups Projects
Commit 5214c939 authored by Matthieu Dien's avatar Matthieu Dien
Browse files

htbl fixes

parent 84c3d114
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,7 @@ hash_tbl htbl_empty(size_t (*h)(void*),
int htbl_add(hash_tbl htbl, void* x){
}
int htbl_in(hash_tbl htbl, void* x){
void* htbl_in(hash_tbl htbl, void* x){
}
void htbl_destroy(hash_tbl htbl){
......
......@@ -18,7 +18,7 @@ hash_tbl htbl_empty(size_t (*h)(void*),
int (*eq)(void*, void*),
void (*free)(void*));
int htbl_add(hash_tbl, void*);
int htbl_in(hash_tbl, void*);
void* htbl_in(hash_tbl, void*);
void htbl_destroy(hash_tbl);
#endif
......
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "hash_tbl.h"
......@@ -54,8 +55,8 @@ void test_in() {
}
void test_destroy() {
char a[] = "Coucou 1";
char b[] = "Coucou 2";
char* a = strdup("Coucou 1");
char* b = strdup("Coucou 2");
hash_tbl htbl = htbl_empty(&hash, &eq, &free);
htbl_add(htbl, a);
htbl_add(htbl, b);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment