Commit 10e10e1ab467c4cf093c21d17657e609906392c6

Thomas de Grivel 2023-12-18T17:04:44

fix casts

diff --git a/lib/c3/0.1/ptr_free.facts b/lib/c3/0.1/ptr_free.facts
index b426783..7b6da65 100644
--- a/lib/c3/0.1/ptr_free.facts
+++ b/lib/c3/0.1/ptr_free.facts
@@ -2,4 +2,4 @@
   version: 1}
 replace {PtrFree, :is_a, :module}
 replace {PtrFree, :symbol, PtrFree.cast}
-replace {PtrFree.cast, :cfn, cfn PtrFree "ptr_free_cast" (Tag, Result)}
+replace {PtrFree.cast, :cfn, cfn PtrFree "ptr_free_init_cast" (Result, Tag)}
diff --git a/lib/c3/0.1/uw.facts b/lib/c3/0.1/uw.facts
index c4a25a5..3f7eb24 100644
--- a/lib/c3/0.1/uw.facts
+++ b/lib/c3/0.1/uw.facts
@@ -2,4 +2,4 @@
   version: 1}
 replace {Uw, :is_a, :module}
 replace {Uw, :symbol, Uw.cast}
-replace {Uw.cast, :cfn, cfn Uw "uw_cast" (Tag, Result)}
+replace {Uw.cast, :cfn, cfn Uw "uw_init_cast" (Result, Tag)}
diff --git a/libc3/cfn.c b/libc3/cfn.c
index 14a7661..2c6d20b 100644
--- a/libc3/cfn.c
+++ b/libc3/cfn.c
@@ -211,6 +211,7 @@ s_cfn * cfn_link (s_cfn *cfn)
   assert(cfn);
   if (! (cfn->ptr.p = dlsym(RTLD_DEFAULT, cfn->name->str.ptr.ps8))) {
     warnx("cfn_link: %s: %s", cfn->name->str.ptr.ps8, dlerror());
+    assert(! "cfn_link: dlsym failed");
     return NULL;
   }
   return cfn;