1 --- a/interfaces/Prolog/Ciao/ciao_cfli.hh
2 +++ b/interfaces/Prolog/Ciao/ciao_cfli.hh
3 @@ -296,7 +296,7 @@ Prolog_get_atom_name(Prolog_term_ref t,
4 The behavior is undefined if \p t is not a Prolog compound term.
7 -Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) {
8 +Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, size_t* ip) {
9 assert(Prolog_is_compound(t));
10 *ap = ciao_structure_name(t);
11 *ip = ciao_structure_arity(t);
12 --- a/interfaces/Prolog/GNU/gprolog_cfli.hh
13 +++ b/interfaces/Prolog/GNU/gprolog_cfli.hh
14 @@ -420,9 +420,11 @@ Prolog_get_atom_name(Prolog_term_ref t,
15 The behavior is undefined if \p t is not a Prolog compound term.
18 -Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) {
19 +Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, size_t* ip) {
21 assert(Prolog_is_compound(t));
22 - Rd_Compound_Check(t, ap, ip);
23 + Rd_Compound_Check(t, ap, &i);
28 --- a/interfaces/Prolog/ppl_interface_generator_prolog_cc_code.m4
29 +++ b/interfaces/Prolog/ppl_interface_generator_prolog_cc_code.m4
30 @@ -1934,7 +1934,7 @@ m4_define(`ppl_@CLASS@_map_space_dimensi
31 while (Prolog_is_cons(t_pfunc)) {
32 Prolog_get_cons(t_pfunc, t_pair, t_pfunc);
36 Prolog_get_compound_name_arity(t_pair, &functor, &arity);
37 if (arity != 2 || functor != a_minus)
38 return PROLOG_FAILURE;
39 --- a/interfaces/Prolog/ppl_prolog_common.cc
40 +++ b/interfaces/Prolog/ppl_prolog_common.cc
41 @@ -937,7 +937,7 @@ build_linear_expression(Prolog_term_ref
42 return Linear_Expression(integer_term_to_Coefficient(t));
43 else if (Prolog_is_compound(t)) {
47 Prolog_get_compound_name_arity(t, &functor, &arity);
50 @@ -1000,7 +1000,7 @@ Constraint
51 build_constraint(Prolog_term_ref t, const char* where) {
52 if (Prolog_is_compound(t)) {
56 Prolog_get_compound_name_arity(t, &functor, &arity);
58 Prolog_term_ref arg1 = Prolog_new_term_ref();
59 @@ -1073,7 +1073,7 @@ Congruence
60 build_congruence(Prolog_term_ref t, const char* where) {
61 if (Prolog_is_compound(t)) {
65 Prolog_get_compound_name_arity(t, &functor, &arity);
67 Prolog_term_ref arg1 = Prolog_new_term_ref();
68 @@ -1084,7 +1084,7 @@ build_congruence(Prolog_term_ref t, cons
70 if (Prolog_is_integer(arg2)) {
74 Prolog_get_compound_name_arity(arg1, &functor1, &arity1);
76 if (functor1 == a_is_congruent_to) {
77 @@ -1137,7 +1137,7 @@ Generator
78 build_generator(Prolog_term_ref t, const char* where) {
79 if (Prolog_is_compound(t)) {
83 Prolog_get_compound_name_arity(t, &functor, &arity);
85 Prolog_term_ref arg = Prolog_new_term_ref();
86 @@ -1174,7 +1174,7 @@ Grid_Generator
87 build_grid_generator(Prolog_term_ref t, const char* where) {
88 if (Prolog_is_compound(t)) {
92 Prolog_get_compound_name_arity(t, &functor, &arity);
94 Prolog_term_ref arg = Prolog_new_term_ref();
95 @@ -1406,7 +1406,7 @@ Variable
96 term_to_Variable(Prolog_term_ref t, const char* where) {
97 if (Prolog_is_compound(t)) {
101 Prolog_get_compound_name_arity(t, &functor, &arity);
102 if (functor == a_dollar_VAR && arity == 1) {
103 Prolog_term_ref arg = Prolog_new_term_ref();
104 @@ -1554,7 +1554,7 @@ term_to_boundary(Prolog_term_ref t_b, Bo
111 Prolog_get_compound_name_arity(t_b, &functor, &arity);
112 // A boundary term is either of the form c(Limit) or o(Limit).
113 --- a/interfaces/Prolog/SICStus/sicstus_cfli.h
114 +++ b/interfaces/Prolog/SICStus/sicstus_cfli.h
115 @@ -134,7 +134,7 @@ Prolog_get_atom_name(Prolog_term_ref t,
118 Prolog_get_compound_name_arity(Prolog_term_ref t,
119 - Prolog_atom& name, int& arity);
120 + Prolog_atom& name, size_t& arity);
123 Prolog_get_arg(int i, Prolog_term_ref t, Prolog_term_ref a);
124 --- a/interfaces/Prolog/SICStus/sicstus_cfli.ic
125 +++ b/interfaces/Prolog/SICStus/sicstus_cfli.ic
126 @@ -262,9 +262,12 @@ Prolog_get_atom_name(Prolog_term_ref t,
127 The behavior is undefined if \p t is not a Prolog compound term.
129 PCFLI_EXTERN_INLINE int
130 -Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) {
131 +Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, size_t* ip) {
133 assert(Prolog_is_compound(t));
134 - return SP_get_functor(t, ap, ip);
135 + ret = SP_get_functor(t, ap, &i);
141 --- a/interfaces/Prolog/SWI/swi_cfli.hh
142 +++ b/interfaces/Prolog/SWI/swi_cfli.hh
143 @@ -346,7 +346,7 @@ Prolog_get_atom_name(Prolog_term_ref t,
144 The behavior is undefined if \p t is not a Prolog compound term.
147 -Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) {
148 +Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, size_t* ip) {
149 assert(Prolog_is_compound(t));
150 return PL_get_name_arity(t, ap, ip);
152 --- a/interfaces/Prolog/XSB/xsb_cfli.hh
153 +++ b/interfaces/Prolog/XSB/xsb_cfli.hh
154 @@ -314,10 +314,10 @@ Prolog_get_atom_name(Prolog_term_ref t,
155 The behavior is undefined if \p t is not a Prolog compound term.
158 -Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) {
159 +Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, size_t* ip) {
160 assert(Prolog_is_compound(t));
161 *ap = p2c_functor(t);
162 - *ip = p2c_arity(t);
163 + *ip = (size_t)p2c_arity(t);
167 --- a/interfaces/Prolog/YAP/yap_cfli.hh
168 +++ b/interfaces/Prolog/YAP/yap_cfli.hh
169 @@ -313,7 +313,7 @@ Prolog_get_atom_name(Prolog_term_ref t,
170 The behavior is undefined if \p t is not a Prolog compound term.
173 -Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) {
174 +Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, size_t* ip) {
175 assert(Prolog_is_compound(t));
176 YAP_Functor f = YAP_FunctorOfTerm(t);
177 *ap = YAP_NameOfFunctor(f);
178 --- a/m4/ac_check_swi_prolog.m4
179 +++ b/m4/ac_check_swi_prolog.m4
180 @@ -45,11 +45,11 @@ then
182 if test x$swi_prolog != x
184 - swi_prolog_base=`$swi_prolog -dump-runtime-variables | grep PLBASE= | sed 's/PLBASE="\([[a-z]]:\)\{0,1\}\(.*\)";.*/\2/'`
185 - swi_prolog_version=`$swi_prolog -dump-runtime-variables | grep PLVERSION= | sed 's/PLVERSION="\(.*\)";.*/\1/'`
186 - swi_prolog_arch=`$swi_prolog -dump-runtime-variables | grep PLARCH= | sed 's/PLARCH="\(.*\)";.*/\1/'`
187 - swi_prolog_libs=`$swi_prolog -dump-runtime-variables | grep PLLIBS= | sed 's/PLLIBS="\(.*\)";.*/\1/'`
188 - swi_prolog_lib=`$swi_prolog -dump-runtime-variables | grep PLLIB= | sed 's/PLLIB="\(.*\)";.*/\1/'`
189 + swi_prolog_base=`$swi_prolog --dump-runtime-variables | grep PLBASE= | sed 's/PLBASE="\([[a-z]]:\)\{0,1\}\(.*\)";.*/\2/'`
190 + swi_prolog_version=`$swi_prolog --dump-runtime-variables | grep PLVERSION= | sed 's/PLVERSION="\(.*\)";.*/\1/'`
191 + swi_prolog_arch=`$swi_prolog --dump-runtime-variables | grep PLARCH= | sed 's/PLARCH="\(.*\)";.*/\1/'`
192 + swi_prolog_libs=`$swi_prolog --dump-runtime-variables | grep PLLIBS= | sed 's/PLLIBS="\(.*\)";.*/\1/'`
193 + swi_prolog_lib=`$swi_prolog --dump-runtime-variables | grep PLLIB= | sed 's/PLLIB="\(.*\)";.*/\1/'`
195 dnl Additional version checks could be inserted here, if necessary.