Fix : « and » and « or » are reserved in c++

Replaced them by names that don’t collide.
Fixed compile error on pre C99 compilers

- removed variable declaration inside a for loop