codeclib: Declare several variables static and remove unused variables.