(long)0xFFFF8000 had expanded to 0x00000000FFFF8000. With (long)(-0x8000), the compiler now extends the negative sign.