ad0895b
--- a/interfaces/Prolog/Ciao/ciao_cfli.hh
ad0895b
+++ b/interfaces/Prolog/Ciao/ciao_cfli.hh
ad0895b
@@ -296,7 +296,7 @@ Prolog_get_atom_name(Prolog_term_ref t,
ad0895b
   The behavior is undefined if \p t is not a Prolog compound term.
ad0895b
 */
ad0895b
 inline int
ad0895b
-Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) {
ad0895b
+Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, size_t* ip) {
ad0895b
   assert(Prolog_is_compound(t));
ad0895b
   *ap = ciao_structure_name(t);
ad0895b
   *ip = ciao_structure_arity(t);
ad0895b
--- a/interfaces/Prolog/GNU/gprolog_cfli.hh
ad0895b
+++ b/interfaces/Prolog/GNU/gprolog_cfli.hh
ad0895b
@@ -420,9 +420,11 @@ Prolog_get_atom_name(Prolog_term_ref t,
ad0895b
   The behavior is undefined if \p t is not a Prolog compound term.
ad0895b
 */
ad0895b
 inline int
ad0895b
-Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) {
ad0895b
+Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, size_t* ip) {
ad0895b
+  int i;
ad0895b
   assert(Prolog_is_compound(t));
ad0895b
-  Rd_Compound_Check(t, ap, ip);
ad0895b
+  Rd_Compound_Check(t, ap, &i);
ad0895b
+  *ip = (size_t)i;
ad0895b
   return 1;
ad0895b
 }
ad0895b
 
ad0895b
--- a/interfaces/Prolog/ppl_interface_generator_prolog_cc_code.m4
ad0895b
+++ b/interfaces/Prolog/ppl_interface_generator_prolog_cc_code.m4
ad0895b
@@ -1934,7 +1934,7 @@ m4_define(`ppl_@CLASS@_map_space_dimensi
ad0895b
     while (Prolog_is_cons(t_pfunc)) {
ad0895b
       Prolog_get_cons(t_pfunc, t_pair, t_pfunc);
ad0895b
       Prolog_atom functor;
ad0895b
-      int arity;
ad0895b
+      size_t arity;
ad0895b
       Prolog_get_compound_name_arity(t_pair, &functor, &arity);
ad0895b
       if (arity != 2 || functor != a_minus)
ad0895b
         return PROLOG_FAILURE;
ad0895b
--- a/interfaces/Prolog/ppl_prolog_common.cc
ad0895b
+++ b/interfaces/Prolog/ppl_prolog_common.cc
ad0895b
@@ -937,7 +937,7 @@ build_linear_expression(Prolog_term_ref
ad0895b
     return Linear_Expression(integer_term_to_Coefficient(t));
ad0895b
   else if (Prolog_is_compound(t)) {
ad0895b
     Prolog_atom functor;
ad0895b
-    int arity;
ad0895b
+    size_t arity;
ad0895b
     Prolog_get_compound_name_arity(t, &functor, &arity);
ad0895b
     switch (arity) {
ad0895b
     case 1:
ad0895b
@@ -1000,7 +1000,7 @@ Constraint
ad0895b
 build_constraint(Prolog_term_ref t, const char* where) {
ad0895b
   if (Prolog_is_compound(t)) {
ad0895b
     Prolog_atom functor;
ad0895b
-    int arity;
ad0895b
+    size_t arity;
ad0895b
     Prolog_get_compound_name_arity(t, &functor, &arity);
ad0895b
     if (arity == 2) {
ad0895b
       Prolog_term_ref arg1 = Prolog_new_term_ref();
ad0895b
@@ -1073,7 +1073,7 @@ Congruence
ad0895b
 build_congruence(Prolog_term_ref t, const char* where) {
ad0895b
   if (Prolog_is_compound(t)) {
ad0895b
     Prolog_atom functor;
ad0895b
-    int arity;
ad0895b
+    size_t arity;
ad0895b
     Prolog_get_compound_name_arity(t, &functor, &arity);
ad0895b
     if (arity == 2) {
ad0895b
       Prolog_term_ref arg1 = Prolog_new_term_ref();
ad0895b
@@ -1084,7 +1084,7 @@ build_congruence(Prolog_term_ref t, cons
ad0895b
         // /
ad0895b
         if (Prolog_is_integer(arg2)) {
ad0895b
           Prolog_atom functor1;
ad0895b
-          int arity1;
ad0895b
+          size_t arity1;
ad0895b
           Prolog_get_compound_name_arity(arg1, &functor1, &arity1);
ad0895b
           if (arity1 == 2) {
ad0895b
             if (functor1 == a_is_congruent_to) {
ad0895b
@@ -1137,7 +1137,7 @@ Generator
ad0895b
 build_generator(Prolog_term_ref t, const char* where) {
ad0895b
   if (Prolog_is_compound(t)) {
ad0895b
     Prolog_atom functor;
ad0895b
-    int arity;
ad0895b
+    size_t arity;
ad0895b
     Prolog_get_compound_name_arity(t, &functor, &arity);
ad0895b
     if (arity == 1) {
ad0895b
       Prolog_term_ref arg = Prolog_new_term_ref();
ad0895b
@@ -1174,7 +1174,7 @@ Grid_Generator
ad0895b
 build_grid_generator(Prolog_term_ref t, const char* where) {
ad0895b
   if (Prolog_is_compound(t)) {
ad0895b
     Prolog_atom functor;
ad0895b
-    int arity;
ad0895b
+    size_t arity;
ad0895b
     Prolog_get_compound_name_arity(t, &functor, &arity);
ad0895b
     if (arity == 1) {
ad0895b
       Prolog_term_ref arg = Prolog_new_term_ref();
ad0895b
@@ -1406,7 +1406,7 @@ Variable
ad0895b
 term_to_Variable(Prolog_term_ref t, const char* where) {
ad0895b
   if (Prolog_is_compound(t)) {
ad0895b
     Prolog_atom functor;
ad0895b
-    int arity;
ad0895b
+    size_t arity;
ad0895b
     Prolog_get_compound_name_arity(t, &functor, &arity);
ad0895b
     if (functor == a_dollar_VAR && arity == 1) {
ad0895b
       Prolog_term_ref arg = Prolog_new_term_ref();
ad0895b
@@ -1554,7 +1554,7 @@ term_to_boundary(Prolog_term_ref t_b, Bo
ad0895b
     return false;
ad0895b
 
ad0895b
   Prolog_atom functor;
ad0895b
-  int arity;
ad0895b
+  size_t arity;
ad0895b
 
ad0895b
   Prolog_get_compound_name_arity(t_b, &functor, &arity);
ad0895b
   // A boundary term is either of the form c(Limit) or o(Limit).
ad0895b
--- a/interfaces/Prolog/SICStus/sicstus_cfli.h
ad0895b
+++ b/interfaces/Prolog/SICStus/sicstus_cfli.h
ad0895b
@@ -134,7 +134,7 @@ Prolog_get_atom_name(Prolog_term_ref t,
ad0895b
 
ad0895b
 PCFLI_DECLSPEC int
ad0895b
 Prolog_get_compound_name_arity(Prolog_term_ref t,
ad0895b
-                               Prolog_atom& name, int& arity);
ad0895b
+                               Prolog_atom& name, size_t& arity);
ad0895b
 
ad0895b
 PCFLI_DECLSPEC int
ad0895b
 Prolog_get_arg(int i, Prolog_term_ref t, Prolog_term_ref a);
ad0895b
--- a/interfaces/Prolog/SICStus/sicstus_cfli.ic
ad0895b
+++ b/interfaces/Prolog/SICStus/sicstus_cfli.ic
ad0895b
@@ -262,9 +262,12 @@ Prolog_get_atom_name(Prolog_term_ref t,
ad0895b
   The behavior is undefined if \p t is not a Prolog compound term.
ad0895b
 */
ad0895b
 PCFLI_EXTERN_INLINE int
ad0895b
-Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) {
ad0895b
+Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, size_t* ip) {
ad0895b
+  int i, ret;
ad0895b
   assert(Prolog_is_compound(t));
ad0895b
-  return SP_get_functor(t, ap, ip);
ad0895b
+  ret = SP_get_functor(t, ap, &i);
ad0895b
+  *ip = i;
ad0895b
+  return ret;
ad0895b
 }
ad0895b
 
ad0895b
 /*!
ad0895b
--- a/interfaces/Prolog/SWI/swi_cfli.hh
ad0895b
+++ b/interfaces/Prolog/SWI/swi_cfli.hh
ad0895b
@@ -346,7 +346,7 @@ Prolog_get_atom_name(Prolog_term_ref t,
ad0895b
   The behavior is undefined if \p t is not a Prolog compound term.
ad0895b
 */
ad0895b
 inline int
ad0895b
-Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) {
ad0895b
+Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, size_t* ip) {
ad0895b
   assert(Prolog_is_compound(t));
ad0895b
   return PL_get_name_arity(t, ap, ip);
ad0895b
 }
ad0895b
--- a/interfaces/Prolog/XSB/xsb_cfli.hh
ad0895b
+++ b/interfaces/Prolog/XSB/xsb_cfli.hh
ad0895b
@@ -314,10 +314,10 @@ Prolog_get_atom_name(Prolog_term_ref t,
ad0895b
   The behavior is undefined if \p t is not a Prolog compound term.
ad0895b
 */
ad0895b
 inline int
ad0895b
-Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) {
ad0895b
+Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, size_t* ip) {
ad0895b
   assert(Prolog_is_compound(t));
ad0895b
   *ap = p2c_functor(t);
ad0895b
-  *ip = p2c_arity(t);
ad0895b
+  *ip = (size_t)p2c_arity(t);
ad0895b
   return 1;
ad0895b
 }
ad0895b
 
ad0895b
--- a/interfaces/Prolog/YAP/yap_cfli.hh
ad0895b
+++ b/interfaces/Prolog/YAP/yap_cfli.hh
ad0895b
@@ -313,7 +313,7 @@ Prolog_get_atom_name(Prolog_term_ref t,
ad0895b
   The behavior is undefined if \p t is not a Prolog compound term.
ad0895b
 */
ad0895b
 inline int
ad0895b
-Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) {
ad0895b
+Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, size_t* ip) {
ad0895b
   assert(Prolog_is_compound(t));
ad0895b
   YAP_Functor f = YAP_FunctorOfTerm(t);
ad0895b
   *ap = YAP_NameOfFunctor(f);
ad0895b
--- a/m4/ac_check_swi_prolog.m4
ad0895b
+++ b/m4/ac_check_swi_prolog.m4
ad0895b
@@ -45,11 +45,11 @@ then
ad0895b
 fi
ad0895b
 if test x$swi_prolog != x
ad0895b
 then
ad0895b
-  swi_prolog_base=`$swi_prolog -dump-runtime-variables | grep PLBASE= | sed 's/PLBASE="\([[a-z]]:\)\{0,1\}\(.*\)";.*/\2/'`
ad0895b
-  swi_prolog_version=`$swi_prolog -dump-runtime-variables | grep PLVERSION= | sed 's/PLVERSION="\(.*\)";.*/\1/'`
ad0895b
-  swi_prolog_arch=`$swi_prolog -dump-runtime-variables | grep PLARCH= | sed 's/PLARCH="\(.*\)";.*/\1/'`
ad0895b
-  swi_prolog_libs=`$swi_prolog -dump-runtime-variables | grep PLLIBS= | sed 's/PLLIBS="\(.*\)";.*/\1/'`
ad0895b
-  swi_prolog_lib=`$swi_prolog -dump-runtime-variables | grep PLLIB= | sed 's/PLLIB="\(.*\)";.*/\1/'`
ad0895b
+  swi_prolog_base=`$swi_prolog --dump-runtime-variables | grep PLBASE= | sed 's/PLBASE="\([[a-z]]:\)\{0,1\}\(.*\)";.*/\2/'`
ad0895b
+  swi_prolog_version=`$swi_prolog --dump-runtime-variables | grep PLVERSION= | sed 's/PLVERSION="\(.*\)";.*/\1/'`
ad0895b
+  swi_prolog_arch=`$swi_prolog --dump-runtime-variables | grep PLARCH= | sed 's/PLARCH="\(.*\)";.*/\1/'`
ad0895b
+  swi_prolog_libs=`$swi_prolog --dump-runtime-variables | grep PLLIBS= | sed 's/PLLIBS="\(.*\)";.*/\1/'`
ad0895b
+  swi_prolog_lib=`$swi_prolog --dump-runtime-variables | grep PLLIB= | sed 's/PLLIB="\(.*\)";.*/\1/'`
ad0895b
 
ad0895b
   dnl Additional version checks could be inserted here, if necessary.
ad0895b