<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The parameters are passed on the stack, so if it's a little-endian machine the first two bytes will be the same for a short as for an int.<br>
(Big-endians would think argc was zero). The problem arises when the called routine looks for the first argv which it expects to find right after the short argc on the stack. The caller put a four-byte int there so the next two bytes will be zero and all the pointers to the argvs will be wrong.</blockquote>
<div>Since my laptop's processor is an Intel Core 2, it's a little edian one, right? How can I make my code versatile so that it can compile on either little or big endian machines? I'm reading Pd's source code ([phasor~]'s code, for example) but it's beyond my understanding. I kind of understand the beginning of d_osc.c where the code will try to determine the endianess of the machine, but when it comes to sorting arguments out depending on the endianess, I'm at loss.<br>
</div><div>Another important question I still have is, how do I determine whether there is a signal coming in the object's inlets, so I know whether to use the values passed via arguments, or the vectors passed from the dsp method. I'm asking the same thing over and over again...I'll stop for now.<br>
</div><div>Thanks<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
<br>
Martin<br>
<br>
______________________________<u></u>_________________<br>
<a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/<u></u>listinfo/pd-list</a><br>
</div></div></blockquote></div><br></div></div>