2012/11/6 Ingo Weinhold <ingo_weinhold@xxxxxx> > > > Here the check is necessary indeed. On the other hand all the shifts > are > > > the wrong way around. I wonder why I didn't use a mask for the > boundary, > > > anyway. The checks would be similiar, but a mask doesn't need a loop > to be > > > computed. > > > > Right. You think to something like ((offsetStart ^ (offsetStart + length > - > > 1)) & ~(boundary - 1)) == 0 ? > > I was thinking of > > boundaryMask = -boundary; > > in the initialization part. And then check ((offsetStart | (offsetStart + > length - 1)) & boundaryMask) != 0. > This doesn't work right IMO. Moreover boundaryMask would be a int32? I still like my proposition above :) Bye, Jérôme