<br><br><div class="gmail_quote">On Sat, Oct 9, 2010 at 3:01 PM, Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi All,<div><br></div><div>    now I&#39;m successfully simulating the LargeIntegers plugin I&#39;m hitting what I consider a bug in CArray, used to model C pointers in the simulator.  The first problem is that CArray&gt;&gt;#+ &amp; #- return an integer value, not another CArray,  (in C (char *)(exp) + n is still of type (char *), not int) and that the addition/subtraction doesn&#39;t scale by the unit size (in C (type *)p + n == (type *)((char *)p + n * sizeof(type))).  The second problem is that &lt;&lt; &gt;&gt; * &amp; // are meaningless on C pointers.  Anyone think of a good reason why I shouldn&#39;t a) rewrite CArray&gt;&gt;#+ &amp; #- to read</div>

<div><br></div><div><div>+ n</div><div><span style="white-space:pre-wrap">        </span>^ self shallowCopy += (n * unitSize)</div></div><div><br></div><div>- n</div><div><span style="white-space:pre-wrap">        </span>^ self shallowCopy -= (n * unitSize)</div>

<div><br></div><div>(since e.g. </div><div><div>+= increment</div><div><br></div><div><span style="white-space:pre-wrap">        </span>ptrOffset := ptrOffset + increment)</div></div><div><br></div><div>and b) delete CArray&gt;&gt;#*, #//, #&lt;&lt;, #&gt;&gt;, #bitAnd:, #bitOr:, #bitShift: &amp; #signedBitShift: ?</div>
</blockquote><div><br></div><div>So far so good.  The only thing that broke was the use of BitBltSimulator/BitBltSimulation&gt;&gt;#tableLookup:at: which can be deleted and in BitBltSimulation&gt;&gt;#pickSourcePixels:flags:srcMask:destMask:srcShiftInc:dstShiftInc: rewrite</div>
<div><span class="Apple-style-span" style="white-space: pre-wrap; ">        </span>destPix := self tableLookup: cmLookupTable at: (sourcePix bitAnd: cmMask).</div><div>to</div><span class="Apple-style-span" style="white-space: pre-wrap; ">        </span>destPix := cmLookupTable at: (sourcePix bitAnd: cmMask).<div>
<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><br></div><div>best</div><div>Eliot</div>
</blockquote></div><br>