[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-smalltalk] gst_string_to_oop with local string
From: |
Roland Plüss |
Subject: |
[Help-smalltalk] gst_string_to_oop with local string |
Date: |
Wed, 11 Nov 2009 00:58:56 +0100 |
User-agent: |
Thunderbird 2.0.0.23 (X11/20091031) |
A simple code problem. Code looks roughly like this:
char buffer[ 50 ];
sprintf( ( char* )&buffer, "(%f,%f,%f,%f)", csobject.color.r,
csobject.color.g, csobject.color.b, csobject.color.a );
return gst_string_to_oop( buffer );
Returns garbage in smalltalk ( function returns OOP by the way and is
mapped with #smalltalk as return value ). As I get from the
documentation this function only "maps" the string and does not make a
copy. How can you make a real smalltalk string so the buffer can go home
after the function returns?
--
Yours sincerely
Plüss Roland
Leader and Head Programmer
- Game: Epsylon ( http://epsylon.rptd.ch/ ,
http://www.moddb.com/games/4057/epsylon )
- Game Engine: Drag(en)gine ( http://dragengine.rptd.ch ,
http://www.moddb.com/engines/9/dragengine )
- Normal Map Generator: DENormGen ( http://epsylon.rptd.ch/denormgen.php )
signature.asc
Description: OpenPGP digital signature
- [Help-smalltalk] gst_string_to_oop with local string,
Roland Plüss <=