discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] gr-modtool cpp generation issue


From: Martin Braun
Subject: Re: [Discuss-gnuradio] gr-modtool cpp generation issue
Date: Wed, 20 May 2015 09:07:58 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

On 19.05.2015 18:03, Al Anderson wrote:
> Here is the corrected one:
> 
>     testfilename::make(unsigned short printing, unsigned short
> print_type, const char *filename)
>     {
>       return gnuradio::get_initial_sptr
>         (new testfilename_impl(printing, print_type, filename)); //got
> rid of * here
>     }
> 
> I can repeat this by just generating a simple general module with this
> const char *filename parameter. The above declaration is generated by
> gr_modtool. So if I move the * to next to the char when I enter
> parameters in gr_modtool add it works fine. So I am not sure if this is
> poor C++ or the gr_modtool just slurping up the *filename but I will
> point out the file_sink block bundled with gnuradio declares its
> filename with the * next to the parameter

Most likely modtool is slurping the *. We rarely have pointers as such
(a better way in this case would anyway be a const std::string &), and
when we use references, the & needs to go away. Maybe that &-removal is
also removing the *.

M




reply via email to

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