discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] First line of Work Confusion


From: Marcus Müller
Subject: Re: [Discuss-gnuradio] First line of Work Confusion
Date: Tue, 21 Jul 2015 01:37:41 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1

Hi Rich,

two cases here:
a) Either the block doesn't actually do the casting (ie. it doesn't care for the data type), and the drop down menu just selects a item size (useful for things that just memcpy things over etc), or
b) the dropdown menu actually selects one of multiple different blocks.

Cheers,
Marcus


On 21.07.2015 01:35, Richard Bell wrote:
So, the first line of work and general_work functions is usually something of the form

const unsigned char *in = (const unsigned char *) input_items[0];
unsigned char *out = (unsigned char *) output_items[0];

or

gr_complex *in = (gr_complex *) input_items[0];
gr_complex *out = (gr_complex *) output_items[0];

or other input/output types.

The confusion comes when I make blocks that have user selectable types through GRC. I see from built-ins that developers use the unsigned char pointers for this usually. What I can't figure out is how this works when a user selects gr_complex as an input/output type. It seems to me that these pointers to unsigned chars should fail dramatically. But they don't! In fact, I can use either of the two forms I presented above and my flow graph "works", quotes because there maybe a fail case I haven't found yet, so far they just work either way.

Rich


_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


reply via email to

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