Message from discussion
ambiguous overloaded method
Received: by 10.52.70.78 with SMTP id k14mr346709vdu.7.1348005096900;
Tue, 18 Sep 2012 14:51:36 -0700 (PDT)
X-BeenThere: cython-users@googlegroups.com
Received: by 10.52.32.232 with SMTP id m8ls393163vdi.8.gmail; Tue, 18 Sep 2012
14:51:35 -0700 (PDT)
Received: by 10.52.30.133 with SMTP id s5mr408812vdh.10.1348005095874;
Tue, 18 Sep 2012 14:51:35 -0700 (PDT)
Date: Tue, 18 Sep 2012 14:51:35 -0700 (PDT)
From: bibi21000 <bibi21...@gmail.com>
To: cython-users@googlegroups.com
Cc: stefan...@behnel.de
Message-Id: <4c258bb4-338a-4361-83c6-30dc2080a631@googlegroups.com>
In-Reply-To: <03fb84cd-53ec-4a3e-b144-92951b801f91@googlegroups.com>
References: <0233f532-5c8c-442b-bc9b-e77fad9a26fe@googlegroups.com> <503F4802.2060500@behnel.de> <e773664d-4a56-43c9-ab9b-6fa2e4ff78e5@googlegroups.com> <503FBD7F.6040900@behnel.de> <53267847-b65e-461b-9a90-9b3ac5b4b2dd@googlegroups.com>
<503FD536.8040806@behnel.de>
<03fb84cd-53ec-4a3e-b144-92951b801f91@googlegroups.com>
Subject: Re: [cython-users] ambiguous overloaded method
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_991_20140449.1348005095543"
------=_Part_991_20140449.1348005095543
Content-Type: multipart/alternative;
boundary="----=_Part_992_3424100.1348005095543"
------=_Part_992_3424100.1348005095543
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Me again.
Everything works fine on cython 0.14.1 but does not compile on cython 0.16.
The full code is here :=20
http://code.google.com/p/python-openzwave/source/browse/lib/libopenzwave.py=
x
1. running build_ext
2. cythoning lib/libopenzwave.pyx to lib/libopenzwave.cpp
3. =20
4. Error compiling Cython file:
5. ------------------------------------------------------------
6. ...
7. if values_map.find(id) !=3D values_map.end():
8. datatype =3D PyValueTypes[values_map.at(id).GetType()]
9. =20
10. if datatype =3D=3D "Bool":
11. type_bool =3D value
12. cret =3D self.manager.SetValue(values_map.at(id),=20
type_bool)
13. ^
14. ------------------------------------------------------------
15. =20
16. lib/libopenzwave.pyx:1584:44: ambiguous overloaded method
17. =20
18. Error compiling Cython file:
19. ------------------------------------------------------------
20. ...
21. type_bool =3D value
22. cret =3D self.manager.SetValue(values_map.at(id),=20
type_bool)
23. ret =3D 1 if cret else 0
24. elif datatype =3D=3D "Byte":
25. type_byte =3D value
26. cret =3D self.manager.SetValue(values_map.at(id),=20
type_byte)
27. ^
28. ------------------------------------------------------------
29. =20
30. lib/libopenzwave.pyx:1588:44: ambiguous overloaded method
31. =20
32. Error compiling Cython file:
33. ------------------------------------------------------------
34. ...
35. type_float =3D value
36. cret =3D self.manager.SetValue(values_map.at(id),=20
type_float)
37. ret =3D 1 if cret else 0
38. elif datatype =3D=3D "Int":
39. type_int =3D value
40. cret =3D self.manager.SetValue(values_map.at(id),=20
type_int)
41. ^
42. ------------------------------------------------------------
43. =20
44. lib/libopenzwave.pyx:1596:44: ambiguous overloaded method
45. =20
46. Error compiling Cython file:
47. ------------------------------------------------------------
48. ...
49. type_int =3D value
50. cret =3D self.manager.SetValue(values_map.at(id),=20
type_int)
51. ret =3D 1 if cret else 0
52. elif datatype =3D=3D "Short":
53. type_short =3D value
54. cret =3D self.manager.SetValue(values_map.at(id),=20
type_short)
55. ^
56. ------------------------------------------------------------
57. =20
58. lib/libopenzwave.pyx:1600:44: ambiguous overloaded method
=20
I've moved all ctype declaration in a separate pxd file :=20
http://code.google.com/p/python-openzwave/source/browse/lib/mylibc.pxd
So I can use the standard=20
https://github.com/cython/cython/blob/master/Cython/Includes/libc/stdint.px=
dsimply now. Will it solve my problem ?
Le vendredi 31 ao=C3=BBt 2012 21:31:35 UTC+2, bibi21000 a =C3=A9crit :
>
>
>
> Le jeudi 30 ao=C3=BBt 2012 23:03:52 UTC+2, Stefan Behnel a =C3=A9crit :
>>
>> bibi21000, 30.08.2012 22:40:=20
>> > Le jeudi 30 ao=C3=BBt 2012 21:22:42 UTC+2, Stefan Behnel a =C3=A9crit =
:=20
>> >> bibi21000, 30.08.2012 20:55:=20
>> >>> Le jeudi 30 ao=C3=BBt 2012 13:01:25 UTC+2, Stefan Behnel a =C3=A9cri=
t :=20
>> >>>> bibi21000, 29.08.2012 21:38:=20
>> >>>>> I try to update python-openzwave and I've got some problems. The=
=20
>> first=20
>> >>>>> is an ambiguous overloaded method when trying to compile=20
>> >>>>> I try to compile it on 0.14 (oneiric) and 0.15 (precise)=20
>> >>>>> Here is the pyx :=20
>> >>>>>=20
>> >>>>> if values_map.find(id) !=3D values_map.end():=20
>> >>>>> datatype =3D PyValueTypes[values_map.at(id).GetType()]=
=20
>> >>>>> =20
>> >>>>> if datatype =3D=3D "Bool":=20
>> >>>>> type_bool =3D value=20
>> >>>>> self.manager.SetValue(values_map.at(id),=20
>> type_bool)=20
>> >>>>> elif datatype =3D=3D "Byte":=20
>> >>>>> type_byte =3D value=20
>> >>>>> self.manager.SetValue(values_map.at(id),=20
>> >>>>> type_byte) =20
>> >>>>> elif datatype =3D=3D "Decimal":=20
>> >>>>> type_float =3D value=20
>> >>>>> self.manager.SetValue(values_map.at(id),=20
>> type_float)=20
>> >>>>> # TODO: this gives me an "ambiguous overloaded method"=
,=20
>> I=20
>> >>>>> don't understand why.=20
>> >>>>> elif datatype =3D=3D "Int":=20
>> >>>>> type_int =3D value=20
>> >>>>> self.manager.SetValue(values_map.at(id), type_int)=
=20
>> >>>>> #elif datatype =3D=3D "Short":=20
>> >>>>> # type_short =3D value=20
>> >>>>> # self.manager.SetValue(values_map.at(id),=20
>> type_short)=20
>> >>>>> elif datatype =3D=3D "String":=20
>> >>>>> type_string =3D string(value)=20
>> >>>>> self.manager.SetValue(values_map.at(id),=20
>> type_string)=20
>> >>>>> =20
>> >>>>> The C headers=20
>> >>>>> bool SetValue( ValueID const& _id, bool const _value );=20
>> >>>>> bool SetValue( ValueID const& _id, uint8 const _value );=
=20
>> >>>>> bool SetValue( ValueID const& _id, float const _value );=
=20
>> >>>>> bool SetValue( ValueID const& _id, int32 const _value );=
=20
>> >>>>> bool SetValue( ValueID const& _id, int16 const _value );=
=20
>> >>>>> bool SetValue( ValueID const& _id, string const& _value );=
=20
>> >>>>>=20
>> >>>>> And the result of the compilation :=20
>> >>>>>=20
>> >>>>> Error compiling Cython file:=20
>> >>>>> ------------------------------------------------------------=20
>> >>>>> ...=20
>> >>>>> type_float =3D value=20
>> >>>>> self.manager.SetValue(values_map.at(id),=20
>> type_float)=20
>> >>>>> # TODO: this gives me an "ambiguous overloaded method"=
,=20
>> I=20
>> >>>> don't=20
>> >>>>> understand why.=20
>> >>>>> elif datatype =3D=3D "Int":=20
>> >>>>> type_int =3D value=20
>> >>>>> self.manager.SetValue(values_map.at(id), type_int)=
=20
>> >>>>> ^=20
>> >>>>> ------------------------------------------------------------=20
>> >>>>>=20
>> >>>>> openzwave.pyx:1229:37: ambiguous overloaded method=20
>> >>>>=20
>> >>>> Apparently, the author(s) had the same problem:=20
>> >>>>=20
>> >>>>=20
>> >>>>=20
>> >>=20
>> https://github.com/maartendamen/py-openzwave/blob/master/openzwave.pyx#L=
1134=20
>> >>>>=20
>> >>> Yes. As I've said in the previous post, I try to update it.=20
>> >>> You've surely seen that it is no longer maintained. It use an very=
=20
>> old=20
>> >>> release of openzwave which have a poor set of functions and doesn't=
=20
>> >> compile=20
>> >>> on recent distribs (precise for example)=20
>> >>>=20
>> >>>>=20
>> >>>> It's based on these declarations further above in the file:=20
>> >>>>=20
>> >>>> bint SetValue(ValueID& valueid, bint value)=20
>> >>>> bint SetValue(ValueID& valueid, uint8 value)=20
>> >>>> bint SetValue(ValueID& valueid, float value)=20
>> >>>> bint SetValue(ValueID& valueid, int32 value)=20
>> >>>> bint SetValue(ValueID& valueid, int16 value)=20
>> >>>> bint SetValue(ValueID& valueid, string value)=20
>> >>>>=20
>> >>>> Note that the first parameter that is passed into the method is not=
=20
>> a=20
>> >> C++=20
>> >>>> reference type but the plain value type. Just a guess, but that=20
>> might=20
>> >> lead=20
>> >>>> to a slight difference in the signature matching that prevents an=
=20
>> exact=20
>> >>>> match. IMHO, it shouldn't.=20
>> >>>>=20
>> >>>> yes but it find the right methods for bint, unit8, float and string=
.=20
>> >> The=20
>> >>> problem only appears with int32 and int16=20
>> >>>=20
>> >>> From cython documentation :=20
>> >>>=20
>> >>>=20
>> >>> 1.=20
>> >>> =20
>> >>> If the header file uses typedef names such as word to refer to=20
>> >>> platform-dependent flavours of numeric types, you will need a=20
>> >> corresponding=20
>> >>> ctypedef<=20
>> >> http://docs.cython.org/src/userguide/language_basics.html#ctypedef>st=
atement,=20
>>
>> >> but you don=E2=80=99t need to match the type exactly, just use someth=
ing=20
>> >>> of the right general kind (int, float, etc). For example,:=20
>> >>> =20
>> >>> ctypedef int word=20
>> >>> =20
>> >>> will work okay whatever the actual size of a word is (provided=
=20
>> the=20
>> >>> header file defines it correctly). Conversion to and from Python=
=20
>> >> types, if=20
>> >>> any, will also be used for this new type=20
>> >>> =20
>> >>> Sould it be the problem ?=20
>> >>> cython uses the same type to map int16 and "int32" so it couldn't=20
>> find=20
>> >> the=20
>> >>> right method after that ?=20
>> >>=20
>> >> Ah, right - I missed this on first sight:=20
>> >>=20
>> >> """=20
>> >> ctypedef unsigned int uint32=20
>> >> ctypedef unsigned long uint64=20
>> >> ctypedef int int32=20
>> >> ctypedef int int16=20
>> >> ctypedef unsigned char uint8=20
>> >> """=20
>> >>=20
>> >> Sure, this is wrong. Change the int16 ctypedef from int to short and=
=20
>> it=20
>> >> should work.=20
>> >=20
>> > Thanks a lot=20
>> > That works :)=20
>>
>> You're welcome. If you want to do it really right, get rid of the above=
=20
>> declarations all together and use cimports from the libc.stdint module=
=20
>> instead.=20
>>
>>
>> https://github.com/cython/cython/blob/master/Cython/Includes/libc/stdint=
.pxd=20
>>
> I'll take a look at this=20
>
>>
>> Bon courage,=20
>>
> Merci
>
>>
>> Stefan=20
>>
>> bibi=20
>
------=_Part_992_3424100.1348005095543
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Me again.<br>Everything works fine on cython 0.14.1 but does not compile on=
cython 0.16.<br><br>The full code is here : <br>http://code.google.com/p/p=
ython-openzwave/source/browse/lib/libopenzwave.pyx<br><br><ol><li class=3D"=
li1"><div class=3D"de1">running build_ext</div></li><li class=3D"li2"><div =
class=3D"de2">cythoning lib/libopenzwave.pyx to lib/libopenzwave.cpp</div><=
/li><li class=3D"li1"><div class=3D"de1"> </div></li><li class=3D"li2"=
><div class=3D"de2">Error compiling Cython file:</div></li><li class=3D"li1=
"><div class=3D"de1">------------------------------------------------------=
------</div></li><li class=3D"li2"><div class=3D"de2">...</div></li><li cla=
ss=3D"li1"><div class=3D"de1"> if values_map.fin=
d(id) !=3D values_map.end():</div></li><li class=3D"li2"><div class=3D"de2"=
> datatype =3D PyValueTypes[values=
_map.at(id).GetType()]</div></li><li class=3D"li1"><div class=3D"de1"> =
;</div></li><li class=3D"li2"><div class=3D"de2">  =
; if datatype =3D=3D "Bool":</div></li><li class=3D"li1"><div=
class=3D"de1"> type=
_bool =3D value</div></li><li class=3D"li2"><div class=3D"de2">  =
; cret =3D self.manager.SetValue(=
values_map.at(id), type_bool)</div></li><li class=3D"li1"><div class=3D"de1=
"> &nb=
sp; &=
nbsp;^</div></li><li class=3D"li2"><div class=3D"de2">---------------------=
---------------------------------------</div></li><li class=3D"li1"><div cl=
ass=3D"de1"> </div></li><li class=3D"li2"><div class=3D"de2">lib/libop=
enzwave.pyx:1584:44: ambiguous overloaded method</div></li><li class=3D"li1=
"><div class=3D"de1"> </div></li><li class=3D"li2"><div class=3D"de2">=
Error compiling Cython file:</div></li><li class=3D"li1"><div class=3D"de1"=
>------------------------------------------------------------</div></li><li=
class=3D"li2"><div class=3D"de2">...</div></li><li class=3D"li1"><div clas=
s=3D"de1"> type_bool=
=3D value</div></li><li class=3D"li2"><div class=3D"de2"> &nb=
sp; cret =3D self.manager.SetValue(value=
s_map.at(id), type_bool)</div></li><li class=3D"li1"><div class=3D"de1">&nb=
sp; ret =3D 1 if cret else=
0</div></li><li class=3D"li2"><div class=3D"de2"> &nbs=
p; elif datatype =3D=3D "Byte":</div></li><li class=3D"li1"><=
div class=3D"de1"> t=
ype_byte =3D value</div></li><li class=3D"li2"><div class=3D"de2"> &n=
bsp; cret =3D self.manager.SetVal=
ue(values_map.at(id), type_byte)</div></li><li class=3D"li1"><div class=3D"=
de1"> =
 =
; ^</div></li><li class=3D"li2"><div class=3D"de2">------------------=
------------------------------------------</div></li><li class=3D"li1"><div=
class=3D"de1"> </div></li><li class=3D"li2"><div class=3D"de2">lib/li=
bopenzwave.pyx:1588:44: ambiguous overloaded method</div></li><li class=3D"=
li1"><div class=3D"de1"> </div></li><li class=3D"li2"><div class=3D"de=
2">Error compiling Cython file:</div></li><li class=3D"li1"><div class=3D"d=
e1">------------------------------------------------------------</div></li>=
<li class=3D"li2"><div class=3D"de2">...</div></li><li class=3D"li1"><div c=
lass=3D"de1"> type_f=
loat =3D value</div></li><li class=3D"li2"><div class=3D"de2"> =
cret =3D self.manager.SetValue(v=
alues_map.at(id), type_float)</div></li><li class=3D"li1"><div class=3D"de1=
"> ret =3D 1 if cret=
else 0</div></li><li class=3D"li2"><div class=3D"de2"> =
elif datatype =3D=3D "Int":</div></li><li class=3D"li=
1"><div class=3D"de1"> &nbs=
p; type_int =3D value</div></li><li class=3D"li2"><div class=3D"de2"> =
cret =3D self.manager.Set=
Value(values_map.at(id), type_int)</div></li><li class=3D"li1"><div class=
=3D"de1"> &nb=
sp; &=
nbsp; ^</div></li><li class=3D"li2"><div class=3D"de2">--------------=
----------------------------------------------</div></li><li class=3D"li1">=
<div class=3D"de1"> </div></li><li class=3D"li2"><div class=3D"de2">li=
b/libopenzwave.pyx:1596:44: ambiguous overloaded method</div></li><li class=
=3D"li1"><div class=3D"de1"> </div></li><li class=3D"li2"><div class=
=3D"de2">Error compiling Cython file:</div></li><li class=3D"li1"><div clas=
s=3D"de1">------------------------------------------------------------</div=
></li><li class=3D"li2"><div class=3D"de2">...</div></li><li class=3D"li1">=
<div class=3D"de1"> =
type_int =3D value</div></li><li class=3D"li2"><div class=3D"de2"> &n=
bsp; cret =3D self.manager.SetVal=
ue(values_map.at(id), type_int)</div></li><li class=3D"li1"><div class=3D"d=
e1"> ret =3D 1 if cr=
et else 0</div></li><li class=3D"li2"><div class=3D"de2"> &nbs=
p; elif datatype =3D=3D "Short":</div></li><li class=
=3D"li1"><div class=3D"de1">  =
; type_short =3D value</div></li><li class=3D"li2"><div class=3D"de2=
"> cret =3D self.man=
ager.SetValue(values_map.at(id), type_short)</div></li><li class=3D"li1"><d=
iv class=3D"de1"> &n=
bsp; =
^</div></li><li class=3D"li2"><div class=3D"de2">------=
------------------------------------------------------</div></li><li class=
=3D"li1"><div class=3D"de1"> </div></li><li class=3D"li2"><div class=
=3D"de2">lib/libopenzwave.pyx:1600:44: ambiguous overloaded method</div></l=
i></ol><p>I've moved all ctype declaration in a separate pxd file : http://=
code.google.com/p/python-openzwave/source/browse/lib/mylibc.pxd<br></p>So I=
can use the standard <a href=3D"https://github.com/cython/cython/blob/mast=
er/Cython/Includes/libc/stdint.pxd" target=3D"_blank">https://github.com/cy=
thon/<wbr>cython/blob/master/Cython/<wbr>Includes/libc/stdint.pxd</a>
simply now. Will it solve my problem ?<br><br><br><br>Le vendredi 31 ao=C3=
=BBt 2012 21:31:35 UTC+2, bibi21000 a =C3=A9crit :<blockquote class=3D=
"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc s=
olid;padding-left: 1ex;"><br><br>Le jeudi 30 ao=C3=BBt 2012 23:03:52 UTC+2,=
Stefan Behnel a =C3=A9crit :<blockquote class=3D"gmail_quote" style=
=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"=
>bibi21000, 30.08.2012 22:40:
<br>> Le jeudi 30 ao=C3=BBt 2012 21:22:42 UTC+2, Stefan Behnel a =C3=A9c=
rit :
<br>>> bibi21000, 30.08.2012 20:55:=20
<br>>>> Le jeudi 30 ao=C3=BBt 2012 13:01:25 UTC+2, Stefan Behnel a=
=C3=A9crit :=20
<br>>>>> bibi21000, 29.08.2012 21:38:=20
<br>>>>>> I try to update python-openzwave and I've got some=
problems. The first=20
<br>>>>>> is an ambiguous overloaded method when trying to c=
ompile=20
<br>>>>>> I try to compile it on 0.14 (oneiric) and 0.15 (pr=
ecise)=20
<br>>>>>> Here is the pyx :=20
<br>>>>>>
<br>>>>>> if values_map.find(id)=
!=3D values_map.end():=20
<br>>>>>> datatype=
=3D PyValueTypes[<a href=3D"http://values_map.at" target=3D"_blank">values=
_map.at</a>(id)<wbr>.GetType()]=20
<br>>>>>> =20
<br>>>>>> if datat=
ype =3D=3D "Bool":=20
<br>>>>>> &=
nbsp; type_bool =3D value=20
<br>>>>>> &=
nbsp; self.manager.SetValue(<a href=3D"http://values_map.at" target=3D"_bla=
nk">values_<wbr>map.at</a>(id), type_bool)=20
<br>>>>>> elif dat=
atype =3D=3D "Byte":=20
<br>>>>>> &=
nbsp; type_byte =3D value=20
<br>>>>>> &=
nbsp; self.manager.SetValue(<a href=3D"http://values_map.at" target=3D"_bla=
nk">values_<wbr>map.at</a>(id),=20
<br>>>>>> type_byte) &nbs=
p;=20
<br>>>>>> elif dat=
atype =3D=3D "Decimal":=20
<br>>>>>> &=
nbsp; type_float =3D value=20
<br>>>>>> &=
nbsp; self.manager.SetValue(<a href=3D"http://values_map.at" target=3D"_bla=
nk">values_<wbr>map.at</a>(id), type_float)=20
<br>>>>>> # TODO: =
this gives me an "ambiguous overloaded method", I=20
<br>>>>>> don't understand why.=20
<br>>>>>> elif dat=
atype =3D=3D "Int":=20
<br>>>>>> &=
nbsp; type_int =3D value=20
<br>>>>>> &=
nbsp; self.manager.SetValue(<a href=3D"http://values_map.at" target=3D"_bla=
nk">values_<wbr>map.at</a>(id), type_int)=20
<br>>>>>> #elif da=
tatype =3D=3D "Short":=20
<br>>>>>> # =
type_short =3D value=20
<br>>>>>> # =
self.manager.SetValue(<a href=3D"http://values_map.at" target=3D"_bl=
ank">values_<wbr>map.at</a>(id), type_short)=20
<br>>>>>> elif dat=
atype =3D=3D "String":=20
<br>>>>>> &=
nbsp; type_string =3D string(value)=20
<br>>>>>> &=
nbsp; self.manager.SetValue(<a href=3D"http://values_map.at" target=3D"_bla=
nk">values_<wbr>map.at</a>(id), type_string)=20
<br>>>>>> =20
<br>>>>>> The C headers=20
<br>>>>>> bool SetValue( ValueID=
const& _id, bool const _value );=20
<br>>>>>> bool SetValue( ValueID=
const& _id, uint8 const _value );=20
<br>>>>>> bool SetValue( ValueID=
const& _id, float const _value );=20
<br>>>>>> bool SetValue( ValueID=
const& _id, int32 const _value );=20
<br>>>>>> bool SetValue( ValueID=
const& _id, int16 const _value );=20
<br>>>>>> bool SetValue( ValueID=
const& _id, string const& _value );=20
<br>>>>>>
<br>>>>>> And the result of the compilation :=20
<br>>>>>>
<br>>>>>> Error compiling Cython file:=20
<br>>>>>> ------------------------------<wbr>---------------=
---------------=20
<br>>>>>> ...=20
<br>>>>>> &=
nbsp; type_float =3D value=20
<br>>>>>> &=
nbsp; self.manager.SetValue(<a href=3D"http://values_map.at" target=3D"_bla=
nk">values_<wbr>map.at</a>(id), type_float)=20
<br>>>>>> # TODO: =
this gives me an "ambiguous overloaded method", I=20
<br>>>>> don't=20
<br>>>>>> understand why.=20
<br>>>>>> elif dat=
atype =3D=3D "Int":=20
<br>>>>>> &=
nbsp; type_int =3D value=20
<br>>>>>> &=
nbsp; self.manager.SetValue(<a href=3D"http://values_map.at" target=3D"_bla=
nk">values_<wbr>map.at</a>(id), type_int)=20
<br>>>>>> &=
nbsp; =
^=20
<br>>>>>> ------------------------------<wbr>---------------=
---------------=20
<br>>>>>>
<br>>>>>> openzwave.pyx:1229:37: ambiguous overloaded method=
=20
<br>>>>>
<br>>>>> Apparently, the author(s) had the same problem:=20
<br>>>>>
<br>>>>>
<br>>>>>
<br>>> <a href=3D"https://github.com/maartendamen/py-openzwave/blob/m=
aster/openzwave.pyx#L1134" target=3D"_blank">https://github.com/<wbr>maarte=
ndamen/py-openzwave/<wbr>blob/master/openzwave.pyx#<wbr>L1134</a>=20
<br>>>>>
<br>>>> Yes. As I've said in the previous post, I try to update it=
.=20
<br>>>> You've surely seen that it is no longer maintained. It use=
an very old=20
<br>>>> release of openzwave which have a poor set of functions an=
d doesn't=20
<br>>> compile=20
<br>>>> on recent distribs (precise for example)=20
<br>>>>
<br>>>>>
<br>>>>> It's based on these declarations further above in the =
file:=20
<br>>>>>
<br>>>>> bint SetValue(ValueID&=
valueid, bint value)=20
<br>>>>> bint SetValue(ValueID&=
valueid, uint8 value)=20
<br>>>>> bint SetValue(ValueID&=
valueid, float value)=20
<br>>>>> bint SetValue(ValueID&=
valueid, int32 value)=20
<br>>>>> bint SetValue(ValueID&=
valueid, int16 value)=20
<br>>>>> bint SetValue(ValueID&=
valueid, string value)=20
<br>>>>>
<br>>>>> Note that the first parameter that is passed into the =
method is not a=20
<br>>> C++=20
<br>>>>> reference type but the plain value type. Just a guess,=
but that might=20
<br>>> lead=20
<br>>>>> to a slight difference in the signature matching that =
prevents an exact=20
<br>>>>> match. IMHO, it shouldn't.=20
<br>>>>>
<br>>>>> yes but it find the right methods for bint, unit8, flo=
at and string.=20
<br>>> The=20
<br>>>> problem only appears with int32 and int16=20
<br>>>>
<br>>>> From cython documentation :=20
<br>>>>
<br>>>>
<br>>>> 1.=20
<br>>>> =20
<br>>>> If the header file uses typedef names such as=
word to refer to=20
<br>>>> platform-dependent flavours of numeric types,=
you will need a=20
<br>>> corresponding=20
<br>>>> ctypedef<
<br>>> <a href=3D"http://docs.cython.org/src/userguide/language_basic=
s.html#ctypedef" target=3D"_blank">http://docs.cython.org/src/<wbr>userguid=
e/language_basics.<wbr>html#ctypedef</a>>statement,=20
<br>>> but you don=E2=80=99t need to match the type exactly, just use=
something=20
<br>>>> of the right general kind (int, float, etc). =
For example,:=20
<br>>>> =20
<br>>>> ctypedef int word=20
<br>>>> =20
<br>>>> will work okay whatever the actual size of a=
word is (provided the=20
<br>>>> header file defines it correctly). Conversion=
to and from Python=20
<br>>> types, if=20
<br>>>> any, will also be used for this new type=20
<br>>>> =20
<br>>>> Sould it be the problem ?=20
<br>>>> cython uses the same type to map int16 and "int32" so it c=
ouldn't find=20
<br>>> the=20
<br>>>> right method after that ?=20
<br>>>
<br>>> Ah, right - I missed this on first sight:=20
<br>>>
<br>>> """=20
<br>>> ctypedef unsigned int uint32=20
<br>>> ctypedef unsigned long uint64=20
<br>>> ctypedef int int32=20
<br>>> ctypedef int int16=20
<br>>> ctypedef unsigned char uint8=20
<br>>> """=20
<br>>>
<br>>> Sure, this is wrong. Change the int16 ctypedef from int to sho=
rt and it=20
<br>>> should work.=20
<br>>
<br>> Thanks a lot=20
<br>> That works :)
<br>
<br>You're welcome. If you want to do it really right, get rid of the above
<br>declarations all together and use cimports from the libc.stdint module =
instead.
<br>
<br><a href=3D"https://github.com/cython/cython/blob/master/Cython/Includes=
/libc/stdint.pxd" target=3D"_blank">https://github.com/cython/<wbr>cython/b=
lob/master/Cython/<wbr>Includes/libc/stdint.pxd</a>
<br></blockquote><div>I'll take a look at this <br></div><blockquote class=
=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc s=
olid;padding-left:1ex">
<br>Bon courage,
<br></blockquote><div>Merci<br></div><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex=
">
<br>Stefan
<br>
<br></blockquote><div>bibi <br></div></blockquote>
------=_Part_992_3424100.1348005095543--
------=_Part_991_20140449.1348005095543--