bugfix: fixed most of the compiler warnings from the MinGW C compiler, some of which are real overflow issues. thanks Edwin Cleton for the report.