unknown parse error when testing function

I have the function below which seems to act as it should, however when running the program through a testing program, I am given the errors: parse error: [int xSwapped = ((255 << nShift) | (255 << mShift));] and
undeclared variable `xSwapped': [return (~xSwapped & x) | nMask | mMask;]