[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 (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 ( , )
- Game Engine: Drag(en)gine ( , )
- Normal Map Generator: DENormGen ( )

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]