doc: fix typo
[platform/upstream/isl.git] / isl_union_map.c
index 3e88c55..5472261 100644 (file)
@@ -8,12 +8,12 @@
  * 91893 Orsay, France 
  */
 
+#include <isl_map_private.h>
 #include <isl/ctx.h>
 #include <isl/hash.h>
 #include <isl/map.h>
 #include <isl/set.h>
 #include <isl_dim_private.h>
-#include <isl_map_private.h>
 #include <isl_union_map_private.h>
 #include <isl/union_set.h>
 
@@ -996,10 +996,11 @@ __isl_give isl_union_set *isl_union_set_simple_hull(
 
 static int inplace_entry(void **entry, void *user)
 {
-       __isl_give isl_map *(*fn)(__isl_take isl_map *) = user;
+       __isl_give isl_map *(*fn)(__isl_take isl_map *);
        isl_map **map = (isl_map **)entry;
        isl_map *copy;
 
+       fn = *(__isl_give isl_map *(**)(__isl_take isl_map *)) user;
        copy = fn(isl_map_copy(*map));
        if (!copy)
                return -1;
@@ -1017,7 +1018,7 @@ static __isl_give isl_union_map *inplace(__isl_take isl_union_map *umap,
                return NULL;
 
        if (isl_hash_table_foreach(umap->dim->ctx, &umap->table,
-                                   &inplace_entry, fn) < 0)
+                                   &inplace_entry, &fn) < 0)
                goto error;
 
        return umap;
@@ -1398,6 +1399,9 @@ __isl_give isl_basic_map *isl_union_map_sample(__isl_take isl_union_map *umap)
            !sample)
                goto error;
 
+       if (!sample)
+               sample = isl_basic_map_empty(isl_union_map_get_dim(umap));
+
        isl_union_map_free(umap);
 
        return sample;