]> git.lizzy.rs Git - dragonstd.git/blobdiff - test/test_refcount_map.c
Rework get,add,del return values
[dragonstd.git] / test / test_refcount_map.c
index 642f15b6bd799eb2f8de73db17ad80e2b765cb0b..84dc1abecf7d55b5c0c8c895af56c370d12fc2b6 100644 (file)
@@ -16,11 +16,10 @@ typedef struct {
        Refcount rc;
 } DataObject;
 
-void *data_object_delete(DataObject *obj)
+void data_object_delete(DataObject *obj)
 {
        refcount_dst(&obj->rc);
        free(obj);
-       return obj;
 }
 
 int rand_id()
@@ -50,7 +49,7 @@ static void *thread_create(unsigned int *result)
 
                refcount_ini(&obj->rc, obj, (void *) &data_object_delete);
 
-               if (map_add(&map, &obj->rc, &data_object_compare, &refcount_inc) == &obj->rc)
+               if (map_add(&map, &obj->rc, &data_object_compare, &refcount_inc))
                        (*result)++;
 
                refcount_drp(&obj->rc);