[Vala] string.to_double
- From: Yu Feng <rainwoodman gmail com>
- To: vala-list <vala-list gnome org>
- Subject: [Vala] string.to_double
- Date: Tue, 19 Aug 2008 18:24:51 -0400
Dear friends,
I can not find any way to make it work.
It keeps reporting can not pass an owned object to an unowned object
stuff:
protected override void from_string(string str){
weak string s = str;
weak string end_ptr = null;
int dimensions = 0;
while(true) {
s.to_double(out end_ptr);
if((void*) s == (void*) end_ptr) break;
s = end_ptr;
dimensions ++ ;
}
this.dimensions = dimensions;
s = str;
for(int i = 0; i< dimensions; i++){
positions[i] = s.to_double(out s);
dimensions ++ ;
}
}
If I remove the weak prefix, the compiler will leave me with a lot of
'strdup's. If I add a weak prefix in glib-2.0.vapi, vala can produce
good code.
Shouldn't the end_ptr parameter in to_xxx functions be declared as weak?
Yu
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]