upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / ppl / trunk / ppl-1.2-prolog8.2.patch
blobcf1e8a7d0e5dc23ec91d03ff118277dc4291a5b5
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.
5 */
6 inline int
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.
17 inline int
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) {
20 + int i;
21 assert(Prolog_is_compound(t));
22 - Rd_Compound_Check(t, ap, ip);
23 + Rd_Compound_Check(t, ap, &i);
24 + *ip = (size_t)i;
25 return 1;
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);
33 Prolog_atom functor;
34 - int arity;
35 + size_t arity;
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)) {
44 Prolog_atom functor;
45 - int arity;
46 + size_t arity;
47 Prolog_get_compound_name_arity(t, &functor, &arity);
48 switch (arity) {
49 case 1:
50 @@ -1000,7 +1000,7 @@ Constraint
51 build_constraint(Prolog_term_ref t, const char* where) {
52 if (Prolog_is_compound(t)) {
53 Prolog_atom functor;
54 - int arity;
55 + size_t arity;
56 Prolog_get_compound_name_arity(t, &functor, &arity);
57 if (arity == 2) {
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)) {
62 Prolog_atom functor;
63 - int arity;
64 + size_t arity;
65 Prolog_get_compound_name_arity(t, &functor, &arity);
66 if (arity == 2) {
67 Prolog_term_ref arg1 = Prolog_new_term_ref();
68 @@ -1084,7 +1084,7 @@ build_congruence(Prolog_term_ref t, cons
69 // /
70 if (Prolog_is_integer(arg2)) {
71 Prolog_atom functor1;
72 - int arity1;
73 + size_t arity1;
74 Prolog_get_compound_name_arity(arg1, &functor1, &arity1);
75 if (arity1 == 2) {
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)) {
80 Prolog_atom functor;
81 - int arity;
82 + size_t arity;
83 Prolog_get_compound_name_arity(t, &functor, &arity);
84 if (arity == 1) {
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)) {
89 Prolog_atom functor;
90 - int arity;
91 + size_t arity;
92 Prolog_get_compound_name_arity(t, &functor, &arity);
93 if (arity == 1) {
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)) {
98 Prolog_atom functor;
99 - int arity;
100 + size_t arity;
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
105 return false;
107 Prolog_atom functor;
108 - int arity;
109 + size_t arity;
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,
117 PCFLI_DECLSPEC int
118 Prolog_get_compound_name_arity(Prolog_term_ref t,
119 - Prolog_atom& name, int& arity);
120 + Prolog_atom& name, size_t& arity);
122 PCFLI_DECLSPEC int
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) {
132 + int i, ret;
133 assert(Prolog_is_compound(t));
134 - return SP_get_functor(t, ap, ip);
135 + ret = SP_get_functor(t, ap, &i);
136 + *ip = i;
137 + return ret;
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.
146 inline int
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.
157 inline int
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);
164 return 1;
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.
172 inline int
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
183 then
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.