Clean CMake files and solve clang warnings
Solve small warnings reported by C compiler
Change function comments