[PD-dev] getting rid of warning (incompatible integer to pointer conversion )

Alexandre Torres Porres porres at gmail.com
Wed Feb 23 15:18:10 CET 2022


Em qua., 23 de fev. de 2022 às 06:21, IOhannes m zmoelnig <zmoelnig at iem.at>
escreveu:

>
> that is just a bug in your code.
> it should read:
>
> ```
> int nblock = sp[0]->s_n;
> ```
>

If I do that I get this similar warning

*warning: **incompatible integer to pointer conversion assigning*

*      to 't_int *' (aka 'long *') from 'int' [-Wint-conversion]*

        sigvec[n_sig - 1] = nblock; // block size (n)


 this happens here =>
https://github.com/porres/pd-else/blob/master/Classes/Source/chance~.c#L79

'sigvec' is declared as t_int ** and is used in *dsp_addv(chance_perform,
n_sig, (t_int *)sigvec);*

I tried everything and was able to remove the warning by matching things up
at one point, I don't remember exactly what I did, but the problem is that
the object would blow up Pd when DSP was on, so no good... So yeah, the
solution to remove this warning doesn't seem to be trivial and is way over
my head.

I'd really like to have no warnings at all as I believe this is some proof
the code is robust, but that's just an assumption from someone who's not a
real programmer.

This object has a variable number of signal outlets and I don't remember
where I copied this structure from (maybe some object in Cyclone?). Perhaps
I have to adopt a whole new strategy so if someone can point me to some
other code out there as a reference I'd appreciate it.

thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20220223/61b5bc17/attachment.htm>


More information about the Pd-dev mailing list