X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8b089c5e8c8a2140258d150ca1ce42afd3b79e1b..08a092f9f4de6c80a2d43d4072c379ac84e6cc2f:/samples/opengl/penguin/lw.cpp?ds=sidebyside diff --git a/samples/opengl/penguin/lw.cpp b/samples/opengl/penguin/lw.cpp index e7bfe17843..957f18aa08 100644 --- a/samples/opengl/penguin/lw.cpp +++ b/samples/opengl/penguin/lw.cpp @@ -25,8 +25,11 @@ #include #include +#if !defined(__WXMAC__) || defined(__DARWIN__) +// these must be defined in the precompiled headers under CodeWarrior #define wxInt32 int #define wxUint32 unsigned int +#endif #ifndef FALSE #define FALSE 0 @@ -57,12 +60,23 @@ static wxInt32 read_char(FILE *f) static wxInt32 read_short(FILE *f) { - return (read_char(f)<<8) | read_char(f); + // the execution path was not always correct + // when using the direct evaluation in the return statement + wxInt32 first = read_char(f) ; + wxInt32 second = read_char(f) ; + + return (first<<8) | second ; } static wxInt32 read_long(FILE *f) { - return (read_char(f)<<24) | (read_char(f)<<16) | (read_char(f)<<8) | read_char(f); + // the execution path was not always correct + // when using the direct evaluation in the return statement + wxInt32 first = read_char(f) ; + wxInt32 second = read_char(f) ; + wxInt32 third = read_char(f) ; + wxInt32 fourth = read_char(f) ; + return (first<<24) | (second<<16) | (third<<8) | fourth ; } static GLfloat read_float(FILE *f)