Author: post
Date: 2010-07-06 20:43:06 +0200 (Tue, 06 Jul 2010)
New Revision: 252

Modified:
   RawSpeed/ByteStreamSwap.cpp
   RawSpeed/TiffIFD.cpp
Log:
Make sure ByteStreamSwap increments offset, and avoid gcc warning.

Modified: RawSpeed/ByteStreamSwap.cpp
===================================================================
--- RawSpeed/ByteStreamSwap.cpp 2010-07-05 21:56:16 UTC (rev 251)
+++ RawSpeed/ByteStreamSwap.cpp 2010-07-06 18:43:06 UTC (rev 252)
@@ -21,15 +21,16 @@
     throw IOException("getShort: Out of buffer read");
   uint32 a = buffer[off++];
   uint32 b = buffer[off++];
-  return (a << 8) | b;
+  return (ushort16)((a << 8) | b);
 }
 
 /* NOTE: Actually unused, so not tested */
 int ByteStreamSwap::getInt() {
   if (off + 4 >= size)
     throw IOException("getInt: Out of buffer read");
-  return (int)buffer[off] << 24 | (int)buffer[off+1] << 16 | 
(int)buffer[off+2] << 8 | (int)buffer[off+3];
+  int r = (int)buffer[off] << 24 | (int)buffer[off] << 16 | (int)buffer[off] 
<< 8 | (int)buffer[off];
   off+=4;
+  return r;
 }
 
 } // namespace RawSpeed

Modified: RawSpeed/TiffIFD.cpp
===================================================================
--- RawSpeed/TiffIFD.cpp        2010-07-05 21:56:16 UTC (rev 251)
+++ RawSpeed/TiffIFD.cpp        2010-07-06 18:43:06 UTC (rev 252)
@@ -108,7 +108,7 @@
 
   data+=4;
   CHECKSIZE(count);
-  Endianness makernote_endian;
+  Endianness makernote_endian = unknown;
   if (data[0] == 0x49 && data[1] == 0x49)
     makernote_endian = little;
   else if (data[0] == 0x4D && data[1] == 0x4D)


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to