enigma-dev/enigma-dev — pull request #780 by sorlok (2014-07-27 03:41:10+00:00)
Title: Bug fixes and code cleanup identified by valgrind and clang.

This contains some fixes for memory corruption or other risky code identified by valgrind/clang. I tried to avoid being pedantic by limiting the errors fixed only to those I thought could cause real damage.

Please check the "CHECK THIS" comment in GSmath.h; I'm 99% sure this is a bug, but perhaps there is some weird GL thing I am overlooking.

Note: The "x1 ^= (x2 ^= (x1 ^= x2));" line uses sequence points incorrectly, and is a very confusing way of writing "swap" in the first place.