Using IR Proximity Sensor to control motors

what do you think is wrong?

I think that this version of C doesn't like nested function declarations.
Move the functions out of loop, and LOSE THE SEMICOLONS.