From edd83a03fea5bd6adad3870c0b014e8f18894ca5 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 12 Sep 2011 11:24:24 +0000 Subject: [PATCH] From Paul Idstein, warning fixes for OSX 10.7 --- src/osgDB/FileUtils.cpp | 2 +- src/osgPlugins/imageio/ReaderWriterImageIO.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/osgDB/FileUtils.cpp b/src/osgDB/FileUtils.cpp index f5693e673..90fda6841 100644 --- a/src/osgDB/FileUtils.cpp +++ b/src/osgDB/FileUtils.cpp @@ -73,7 +73,7 @@ typedef char TCHAR; // Unfortunately, we can't use the label MAC_OS_X_VERSION_10_4 // for older OS's like Jaguar, Panther since they are not defined, // so I am going to hardcode the number. - #if (MAC_OS_X_VERSION_MAX_ALLOWED <= 1040) + #if (MAC_OS_X_VERSION_MAX_ALLOWED <= 1040) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1066) #define stat64 stat #endif #elif defined(__CYGWIN__) || defined(__FreeBSD__) || (defined(__hpux) && !defined(_LARGEFILE64_SOURCE)) diff --git a/src/osgPlugins/imageio/ReaderWriterImageIO.cpp b/src/osgPlugins/imageio/ReaderWriterImageIO.cpp index 84c0b0d4a..26b1b5c8d 100644 --- a/src/osgPlugins/imageio/ReaderWriterImageIO.cpp +++ b/src/osgPlugins/imageio/ReaderWriterImageIO.cpp @@ -388,8 +388,10 @@ osg::Image* CreateOSGImageFromCGImage(CGImageRef image_ref) int i, j; GLubyte *pixels = (GLubyte *)image_data; for (i = the_height * the_width; i--; ) { - GLuint *value = (GLuint *)pixels; + #if __BIG_ENDIAN__ + // That value is a temporary one and only needed for endianess conversion + GLuint *value = (GLuint *)pixels; // // swap endian of each pixel for avoiding weird colors on ppc macs // by Tatsuhiro Nishioka