Function is waiting for a pointer but I want to return an integer in the function lookup (i can't modify the return type of the function), what can i do to solve this problem ?
int hashtable_insert(HashTable ** ptable, void *data, void (*delete) (void *))
{
if(hashtable_lookup(*ptable, data) != -1){
return -1;
}
data = malloc(sizeof(size_t));
list_append((*ptable)->list, data, (*ptable)->size);
_hashtable_resize(ptable);
return 0;
}
warning: comparison between pointer and integer if(hashtable_lookup(*ptable, data) != -1){
void * hashtable_lookup(HashTable * table, void *data)
{
for(int i = 0; i < (table)->length; i++){
if((table)->list[i] == data){
return data;
}
}
return -1;
}
warning: return makes pointer from integer without a cast [-Wint-conversion] return -1;