neverstoplwy / fastlz

Automatically exported from code.google.com/p/fastlz
Other
0 stars 0 forks source link

decompressor does not work on sparc #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Got misaligned data access at this line in FASTLZ_DECOMPRESSOR:

          *q++ = *p++;

I replaced all of 
        /* copy a byte, so that now it's word aligned */
        if(len & 1)
        {
          *op++ = *ref++;
          len--;
        }

        /* copy 16-bit at once */
        q = (flzuint16*) op;
        op += len;
        p = (const flzuint16*) ref;
        for(len>>=1; len > 4; len-=4)
        {
          *q++ = *p++;
          *q++ = *p++;
          *q++ = *p++;
          *q++ = *p++;
        }
        for(; len; --len)
          *q++ = *p++;

with
      while(len--) *op++= *ref++;

and now it works fine (and fast I think).

Original issue reported on code.google.com by thwill...@gmail.com on 16 Jun 2007 at 2:57

GoogleCodeExporter commented 8 years ago
Thanks a lot for testing and for the fix!

Original comment by ariya.hi...@gmail.com on 18 Jun 2007 at 9:20