fix compile warning and error issue for mingw32.