solve static check errors and warnings in c/cpp project