problem binding a simple function
"Charles Darwin" <[email protected]> Sun, 05 May 2013 20:24:55 -0400
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <[email protected]> |
--===============3544910320620475198==
Content-Type: multipart/alternative;
boundary="========GMXBoundary166341367799895834912"
--========GMXBoundary166341367799895834912
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Hello,
I'm having trouble binding this simple function does uppercase conversion.
void STools::UCase(char *txt)
{
for (;;)
{
u_int32 t = *reinterpret_cast(txt);
...
txt++;
}
}
Here's the luabind code
luabind::module(myLuaState) [
luabind::def("convert_upper", STools::UCase)
];
Here's the compiler error:
error C2664: 'void (char *)' : cannot convert parameter 1 from 'const char *' to 'char *'
I've tried adding "out_value(_1)" but got nowhere
error C2352: 'luabind::native_converter_base<T>::match' : illegal call of non-static member function
Any help is appreciated.
Best regards
Charles
--========GMXBoundary166341367799895834912
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
<span style=3D'font-family:Verdana'><span style=3D'font-size:12px'><div>Hel=
lo,</div><div>=C2=A0</div><div>I'm having trouble binding this simple funct=
ion does uppercase conversion.</div><div>=C2=A0</div><div>=C2=A0</div><div>=
void STools::UCase(char *txt)</div><div>{</div><div>for (;;)</div><div>{</d=
iv><div>u_int32 t =3D *reinterpret_cast(txt);</div><div>...</div><div>txt++=
;</div><div>}</div><div>}</div><div>=C2=A0</div><div>=C2=A0</div><div>Here'=
s the luabind code</div><div> </div><div>luabind::module(myLuaState) [=
</div><div> luabind::def("convert_upper", STools::UCase)</div>=
<div> ]; </div><div>=C2=A0</div><div> </div><div>Here=
's the compiler error:</div><div> </div><div>error C2664: 'void =
(char *)' : cannot convert parameter 1 from 'const char *' to 'char *'</div=
><div>=C2=A0</div><div>=C2=A0</div><div>I've tried adding "out_value(_1)" b=
ut got nowhere</div><div>=C2=A0</div><div>error C2352: 'luabind::native_con=
verter_base<T>::match' : illegal call of non-static member function</=
div><div>=C2=A0</div><div>=C2=A0</div><div>=C2=A0</div><div>Any help is app=
reciated.</div><div>=C2=A0</div><div>Best regards</div><div>=C2=A0</div><di=
v>Charles</div></span></span>
--========GMXBoundary166341367799895834912--
--===============3544910320620475198==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
--===============3544910320620475198==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user
--===============3544910320620475198==--