Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualCDarwin

Posted 04 May 2013 - 11:30 AM

Hello,
 
I'm pretty new to luabind. I'm having a little problem binding one of my string functions(convert to uppercase). Just couldn't figure it out.
 

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)

  ]; 


Compiler Error
 

 

error C2664: 'void (char *)' : cannot convert parameter 1 from 'const char *' to 'char *'

 

Any help is appreciated!


#2CDarwin

Posted 04 May 2013 - 11:30 AM

Hello,
 
I'm pretty new to luabind. I'm having a little problem binding one of my string functions(convert to uppercase). Just couldn't figure it out.
 

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)

  ]; 


Compiler Error
 

 


 error C2664: 'void (char *)' : cannot convert parameter 1 from 'const char *' to 'char *'
 

 

Any help is appreciated!


#1CDarwin

Posted 04 May 2013 - 11:30 AM

Hello,
 
I'm pretty new to luabind. I'm having a little problem binding one of my string functions(convert to uppercase). Just couldn't figure it out.
 

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)

  ];

 


Compiler Error
 

 


 error C2664: 'void (char *)' : cannot convert parameter 1 from 'const char *' to 'char *'
 

 

Any help is appreciated!


PARTNERS