Getting error in code for ir sensor

Please post the full code, and the line where it goes wrong.

What i saw in the code is that you are evaluating a binary value and the variable is an int.
That can cause serious trouble.