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:41:30 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1

Ah and I forgot to mention: Casting a pointer to a char* always works; that's something that C++ got from C; it's to ensure you can always get a byte-granular pointer; here I go actually citing stackoverflow :( :

http://stackoverflow.com/a/13996008

Greetings,
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]