Index: OpenSceneGraph/trunk/src/osgPlugins/3ds/lib3ds/lib3ds_io.c
===================================================================
--- OpenSceneGraph/trunk/src/osgPlugins/3ds/lib3ds/lib3ds_io.c (revision 10853)
+++ OpenSceneGraph/trunk/src/osgPlugins/3ds/lib3ds/lib3ds_io.c (revision 11173)
@@ -172,11 +172,11 @@
     w = ((uint16_t)b[1] << 8) |
         ((uint16_t)b[0]);
-	/* --- Code for OpenSceneGraph --- */
-    if (s_requiresByteSwap)
-    {
-        osg::swapBytes2((char*)w);
-    }
-	/* --- (end) Code for OpenSceneGraph --- */
-	return(w);
+    /* --- Code for OpenSceneGraph --- */
+    if (s_requiresByteSwap)
+    {
+        osg::swapBytes2((char*)&w);
+    }
+    /* --- (end) Code for OpenSceneGraph --- */
+    return(w);
 }
 
@@ -196,10 +196,10 @@
         ((uint32_t)b[1] << 8) |
         ((uint32_t)b[0]);
-	/* --- Code for OpenSceneGraph --- */
-    if (s_requiresByteSwap)
-    {
-        osg::swapBytes4((char*)d);
-    }
-	/* --- (end) Code for OpenSceneGraph --- */
+    /* --- Code for OpenSceneGraph --- */
+    if (s_requiresByteSwap)
+    {
+        osg::swapBytes4((char*)&d);
+    }
+    /* --- (end) Code for OpenSceneGraph --- */
     return(d);
 }
@@ -231,11 +231,11 @@
     w = ((uint16_t)b[1] << 8) |
         ((uint16_t)b[0]);
-	/* --- Code for OpenSceneGraph --- */
-    if (s_requiresByteSwap)
-    {
-        osg::swapBytes2((char*)w);
-    }
-	/* --- (end) Code for OpenSceneGraph --- */
-	return((int16_t)w);
+    /* --- Code for OpenSceneGraph --- */
+    if (s_requiresByteSwap)
+    {
+        osg::swapBytes2((char*)&w);
+    }
+    /* --- (end) Code for OpenSceneGraph --- */
+    return((int16_t)w);
 }
 
@@ -255,10 +255,10 @@
         ((uint32_t)b[1] << 8) |
         ((uint32_t)b[0]);
-	/* --- Code for OpenSceneGraph --- */
-    if (s_requiresByteSwap)
-    {
-        osg::swapBytes4((char*)d);
-    }
-	/* --- (end) Code for OpenSceneGraph --- */
+    /* --- Code for OpenSceneGraph --- */
+    if (s_requiresByteSwap)
+    {
+        osg::swapBytes4((char*)&d);
+    }
+    /* --- (end) Code for OpenSceneGraph --- */
     return((int32_t)d);
 }
@@ -279,11 +279,11 @@
                     ((uint32_t)b[1] << 8) |
                     ((uint32_t)b[0]);
-	/* --- Code for OpenSceneGraph --- */
-    if (s_requiresByteSwap)
-    {
-		osg::swapBytes4((char*)d.dword_value);
-    }
-	/* --- (end) Code for OpenSceneGraph --- */
-	return d.float_value;
+    /* --- Code for OpenSceneGraph --- */
+    if (s_requiresByteSwap)
+    {
+        osg::swapBytes4((char*)&(d.dword_value));
+    }
+    /* --- (end) Code for OpenSceneGraph --- */
+    return d.float_value;
 }
 
@@ -361,12 +361,12 @@
 void
 lib3ds_io_write_word(Lib3dsIo *io, uint16_t w) {
-	/* --- Code for OpenSceneGraph --- */
-    if (s_requiresByteSwap)
-    {
-		osg::swapBytes2((char*)w);
-    }
-	/* --- (end) Code for OpenSceneGraph --- */
-
-	uint8_t b[2];
+    /* --- Code for OpenSceneGraph --- */
+    if (s_requiresByteSwap)
+    {
+            osg::swapBytes2((char*)&w);
+    }
+    /* --- (end) Code for OpenSceneGraph --- */
+
+    uint8_t b[2];
 
     assert(io);
@@ -384,10 +384,10 @@
 void
 lib3ds_io_write_dword(Lib3dsIo *io, uint32_t d) {
-	/* --- Code for OpenSceneGraph --- */
-    if (s_requiresByteSwap)
-    {
-        osg::swapBytes4((char*)d);
-    }
-	/* --- (end) Code for OpenSceneGraph --- */
+    /* --- Code for OpenSceneGraph --- */
+    if (s_requiresByteSwap)
+    {
+        osg::swapBytes4((char*)&d);
+    }
+    /* --- (end) Code for OpenSceneGraph --- */
     uint8_t b[4];
 
@@ -420,10 +420,10 @@
 void
 lib3ds_io_write_intw(Lib3dsIo *io, int16_t w) {
-	/* --- Code for OpenSceneGraph --- */
-    if (s_requiresByteSwap)
-    {
-        osg::swapBytes2((char*)w);
-    }
-	/* --- (end) Code for OpenSceneGraph --- */
+    /* --- Code for OpenSceneGraph --- */
+    if (s_requiresByteSwap)
+    {
+        osg::swapBytes2((char*)&w);
+    }
+    /* --- (end) Code for OpenSceneGraph --- */
     uint8_t b[2];
 
@@ -442,10 +442,10 @@
 void
 lib3ds_io_write_intd(Lib3dsIo *io, int32_t d) {
-	/* --- Code for OpenSceneGraph --- */
-    if (s_requiresByteSwap)
-    {
-        osg::swapBytes4((char*)d);
-    }
-	/* --- (end) Code for OpenSceneGraph --- */
+    /* --- Code for OpenSceneGraph --- */
+    if (s_requiresByteSwap)
+    {
+        osg::swapBytes4((char*)&d);
+    }
+    /* --- (end) Code for OpenSceneGraph --- */
     uint8_t b[4];
 
@@ -471,10 +471,10 @@
     assert(io);
     d.float_value = l;
-	/* --- Code for OpenSceneGraph --- */
-    if (s_requiresByteSwap)
-    {
-		osg::swapBytes4((char*)d.dword_value);
-    }
-	/* --- (end) Code for OpenSceneGraph --- */
+    /* --- Code for OpenSceneGraph --- */
+    if (s_requiresByteSwap)
+    {
+        osg::swapBytes4((char*)&d.dword_value);
+    }
+    /* --- (end) Code for OpenSceneGraph --- */
     b[3] = (uint8_t)(((uint32_t)d.dword_value & 0xFF000000) >> 24);
     b[2] = (uint8_t)(((uint32_t)d.dword_value & 0x00FF0000) >> 16);
