[PD-dev] How to pass indeterminate args to a thread
ben at ekran.org
Fri Feb 27 22:01:29 CET 2009
I got lots of help from Matju on IRC so things are compiling.
I'm now getting a segfault when trying to access a member of the
structure in the thread function:
#0 0xf7d531cb in strlen () from /lib/i686/cmov/libc.so.6
#1 0xf7d1f648 in vfprintf () from /lib/i686/cmov/libc.so.6
#2 0xf7d43e04 in vsnprintf () from /lib/i686/cmov/libc.so.6
#3 0x080c68d6 in post (fmt=0xf7f7db5a "My symbol: %s")
#4 0xf7f7d829 in mythread ()
The way I'm trying to access the member is as follows:
post("My symbol: %s", ((struct floatArgStruct *)threadArgs)->s->s_name);
I've attached the full source.
All this typdef stuff is new to me, so I may have messed up something
Claude Heiland-Allen wrote:
>> post("My symbol: %s", threadArgs.s->s_name); // line 92
> threadArgs is a pointer, '.' is only for structs/unions
> try '->' instead of '.' to both dereference pointer and access member
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 11675 bytes
Desc: not available
More information about the Pd-dev