fix compilation warnings for gcc4.1.2/gcc4.4.7/gcc4.7.1 with -Wall option