aap / skygfx

Bringing the PS2 graphics of GTA San Andreas to PC
210 stars 18 forks source link

Check these warnings #9

Closed ThirteenAG closed 7 years ago

ThirteenAG commented 7 years ago

https://github.com/aap/skygfx/blob/master/src/defaultFuncs.cpp#L82 V522 Dereferencing of the null pointer 'envData' might take place. defaultfuncs.cpp 82

https://github.com/aap/skygfx/blob/master/src/main.cpp#L565 https://github.com/aap/skygfx/blob/master/src/main.cpp#L622 V557 Array overrun is possible. The value of 'nLen + 1' index could reach 260. main.cpp 565

https://github.com/aap/skygfx/blob/master/src/neo.cpp#L132 V590 Consider inspecting the 'c != (- 1) && c == '\t'' expression. The expression is excessive or contains a misprint. neo.cpp 132

https://github.com/aap/skygfx/blob/master/src/neoCarpipe.cpp#L108 V614 Potentially uninitialized variable 'minU' used. neocarpipe.cpp 108 V614 Potentially uninitialized variable 'minV' used. neocarpipe.cpp 109 V614 Potentially uninitialized variable 'maxV' used. neocarpipe.cpp 111 V614 Potentially uninitialized variable 'maxU' used. neocarpipe.cpp 112

https://github.com/aap/skygfx/blob/master/src/postfx.cpp#L478 V636 The 'width / 2' expression was implicitly cast from 'int' type to 'float' type. Consider utilizing an explicit type cast to avoid the loss of a fractional part. An example: double A = (double)(X) / Y;. postfx.cpp 478 V636 The 'height / 2' expression was implicitly cast from 'int' type to 'float' type. Consider utilizing an explicit type cast to avoid the loss of a fractional part. An example: double A = (double)(X) / Y;. postfx.cpp 479

https://github.com/aap/skygfx/blob/master/src/vehiclePipe.cpp#L399 V601 The bool type is implicitly cast to the float type. vehiclepipe.cpp 399 V601 The bool type is implicitly cast to the float type. vehiclepipe.cpp 563

https://github.com/aap/skygfx/blob/master/external/ini_parser.hpp#L195 V575 The number of processed elements should be passed to the 'fgets' function as the second argument instead of buffer's size in bytes. ini_parser.hpp 195

aap commented 7 years ago

Thanks, but mostly uninteresting. Not so sure about the radiosity thing though. It's been a while since I touched it and I don't know how it actually should behave. But we don't see any strange effects so it should be fine.