diff --git a/C/load_foreign.c b/C/load_foreign.c index d4d3d351e..b0d39fad8 100644 --- a/C/load_foreign.c +++ b/C/load_foreign.c @@ -90,7 +90,7 @@ p_load_foreign( USES_REGS1 ) ForeignObj *f_code = (ForeignObj *)Yap_AllocCodeSpace(sizeof(ForeignObj)); f_code->objs = ofiles; f_code->libs = libs; - f_code->f = InitProcName; + f_code->f = AtomOfTerm(t1); f_code->next = ForeignCodeLoaded; f_code->module = CurrentModule; ForeignCodeLoaded = f_code; @@ -248,7 +248,7 @@ Yap_ReOpenLoadForeign(void) YapInitProc InitProc = NULL; CurrentModule = f_code->module; - if(Yap_ReLoadForeign(f_code->objs,f_code->libs,f_code->f,&InitProc)==LOAD_SUCCEEDED) { + if(Yap_ReLoadForeign(f_code->objs,f_code->libs,RepAtom(f_code->f)->StrOfAE,&InitProc)==LOAD_SUCCEEDED) { if (InitProc) (*InitProc)(); } diff --git a/H/Foreign.h b/H/Foreign.h index c4a649cb4..a4aa88632 100644 --- a/H/Foreign.h +++ b/H/Foreign.h @@ -92,7 +92,7 @@ typedef struct StringListItem { typedef struct ForeignLoadItem { StringList objs; StringList libs; - char *f; + Atom f; Term module; struct ForeignLoadItem *next; } ForeignObj; diff --git a/H/rheap.h b/H/rheap.h index 568616597..64851cf87 100644 --- a/H/rheap.h +++ b/H/rheap.h @@ -994,8 +994,9 @@ RestoreForeignCode__( USES_REGS1 ) libs->name = AtomAdjust(libs->name); libs = libs->next; } - if (f_code->f != NULL) - f_code->f = (char *)AddrAdjust((ADDR)f_code->f); + if (f_code->f != NULL) { + f_code->f = AtomAdjust(f_code->f); + } if (f_code->next != NULL) f_code->next = (ForeignObj *)AddrAdjust((ADDR)f_code->next); f_code = f_code->next; diff --git a/packages/CLPBN/clpbn/ground_factors.yap b/packages/CLPBN/clpbn/ground_factors.yap index 77b211c42..4fb4a7dbb 100644 --- a/packages/CLPBN/clpbn/ground_factors.yap +++ b/packages/CLPBN/clpbn/ground_factors.yap @@ -61,6 +61,7 @@ ground_all_keys([], _). ground_all_keys([V|GVars], AllKeys) :- clpbn:get_atts(V,[key(Key)]), \+ ground(Key), !, +wroteln(g:Key), member(Key, AllKeys), ground_all_keys(GVars, AllKeys). ground_all_keys([_V|GVars], AllKeys) :-