<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>
      <blockquote type="cite">'sigvec' is declared as t_int ** and is
        used in <b>dsp_addv(chance_perform, n_sig, (t_int *)sigvec);</b> </blockquote>
      dsp_addv wants "t_int *" (= an array of t_int), not "t_int **", so
      sigvec must be "t_int *" as well. Consequently, variables must be
      cast to "t_int", not "t_int *", when assigning to the array.<br>
    </p>
    <p>
      <blockquote type="cite">I tried everything and was able to remove
        the warning by matching things up at one point</blockquote>
      Don't just try to get rid of warnings by doing random things until
      they go away. Instead, try to understand them and see if they
      might point to an actual mistake in your code (as it is the case
      here).</p>
    <p>---<br>
    </p>
    <p>As a side note: you don't necessarily need to use dsp_addv() for
      objects with variable inputs/outputs, you can just as well store
      the signal buffers (t_sample *) in an array (t_sample **) in your
      object.</p>
    <p>Both methods are fine, it's just a matter of preference.</p>
    <p>Christof<br>
    </p>
    <div class="moz-cite-prefix">On 23.02.2022 15:18, Alexandre Torres
      Porres wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAEAsFmgm8n341bfGc72_tbtHG420-VhTfUgO_yjBc-AGWChmdw@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div dir="ltr">Em qua., 23 de fev. de 2022 às 06:21, IOhannes m
          zmoelnig <<a href="mailto:zmoelnig@iem.at"
            moz-do-not-send="true" class="moz-txt-link-freetext">zmoelnig@iem.at</a>>
          escreveu:<br>
        </div>
        <div class="gmail_quote">
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
            0.8ex;border-left:1px solid
            rgb(204,204,204);padding-left:1ex">
            <br>
            that is just a bug in your code.<br>
            it should read:<br>
            <br>
            ```<br>
            int nblock = sp[0]->s_n;<br>
            ```<br>
          </blockquote>
          <div><br>
          </div>
          <div>If I do that I get this similar warning</div>
          <div><br>
          </div>
          <div>
            <p class="gmail-p1"
style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span
                class="gmail-s1"
                style="font-variant-ligatures:no-common-ligatures;color:rgb(219,39,218)"><b>warning:
                </b></span><span class="gmail-s2"
                style="font-variant-ligatures:no-common-ligatures"><b>incompatible
                  integer to pointer conversion assigning</b></span></p>
            <p class="gmail-p1"
style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span
                class="gmail-s2"
                style="font-variant-ligatures:no-common-ligatures"><b><span
                    class="gmail-Apple-converted-space">      </span>to
                  't_int *' (aka 'long *') from 'int' [-Wint-conversion]</b></span></p>
            <p class="gmail-p1"
style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span
                class="gmail-s2"
                style="font-variant-ligatures:no-common-ligatures"><span
                  class="gmail-Apple-converted-space">        </span>sigvec[n_sig
                - 1] = nblock; // block size (n)</span></p>
          </div>
          <div> </div>
          <div><br>
          </div>
          <div> this happens here => <a
href="https://github.com/porres/pd-else/blob/master/Classes/Source/chance~.c#L79"
              moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/porres/pd-else/blob/master/Classes/Source/chance~.c#L79</a></div>
          <div><br>
          </div>
          <div>'sigvec' is declared as t_int ** and is used in <b>dsp_addv(chance_perform,
              n_sig, (t_int *)sigvec);</b> </div>
          <div><br>
          </div>
          <div>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. </div>
          <div><br>
          </div>
          <div>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.</div>
          <div><br>
          </div>
          <div>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.</div>
          <div><br>
          </div>
          <div>thanks </div>
        </div>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Pd-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Pd-dev@lists.iem.at">Pd-dev@lists.iem.at</a>
<a class="moz-txt-link-freetext" href="https://lists.puredata.info/listinfo/pd-dev">https://lists.puredata.info/listinfo/pd-dev</a>
</pre>
    </blockquote>
  </body>
</html>