<br><br><div class="gmail_quote">On Sat, Oct 9, 2010 at 3:01 PM, Eliot Miranda <span dir="ltr"><<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>></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'm successfully simulating the LargeIntegers plugin I'm hitting what I consider a bug in CArray, used to model C pointers in the simulator. The first problem is that CArray>>#+ & #- 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't scale by the unit size (in C (type *)p + n == (type *)((char *)p + n * sizeof(type))). The second problem is that << >> * & // are meaningless on C pointers. Anyone think of a good reason why I shouldn't a) rewrite CArray>>#+ & #- 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>>#*, #//, #<<, #>>, #bitAnd:, #bitOr:, #bitShift: & #signedBitShift: ?</div>
</blockquote><div><br></div><div>So far so good. The only thing that broke was the use of BitBltSimulator/BitBltSimulation>>#tableLookup:at: which can be deleted and in BitBltSimulation>>#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>