[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdesupport/taglib/taglib
From:       Lukáš Lalinský <lalinsky () gmail ! com>
Date:       2011-01-24 7:32:31
Message-ID: 20110124073231.CF7FCAC8B9 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1216679 by lalinsky:

Define a macro to properly construct std::bitset

 M  +1 -1      ape/apefooter.cpp  
 M  +1 -1      mpc/mpcproperties.cpp  
 M  +1 -1      mpeg/mpegheader.cpp  
 M  +6 -0      toolkit/taglib.h  


--- trunk/kdesupport/taglib/taglib/ape/apefooter.cpp #1216678:1216679
@@ -189,7 +189,7 @@
 
   // Read the flags
 
-  std::bitset<32> flags(static_cast<unsigned long>(data.mid(20, 4).toUInt(false)));
+  std::bitset<32> flags(TAGLIB_CONSTRUCT_BITSET(data.mid(20, 4).toUInt(false)));
 
   d->headerPresent = flags[31];
   d->footerPresent = !flags[30];
--- trunk/kdesupport/taglib/taglib/mpc/mpcproperties.cpp #1216678:1216679
@@ -113,7 +113,7 @@
   if(d->version >= 7) {
     frames = d->data.mid(4, 4).toUInt(false);
 
-    std::bitset<32> flags(static_cast<unsigned long>(d->data.mid(8, 4).toUInt(false)));
+    std::bitset<32> flags(TAGLIB_CONSTRUCT_BITSET(d->data.mid(8, 4).toUInt(false)));
     d->sampleRate = sftable[flags[17] * 2 + flags[16]];
     d->channels = 2;
   }
--- trunk/kdesupport/taglib/taglib/mpeg/mpegheader.cpp #1216678:1216679
@@ -168,7 +168,7 @@
     return;
   }
 
-  std::bitset<32> flags(static_cast<unsigned long>(data.toUInt()));
+  std::bitset<32> flags(TAGLIB_CONSTRUCT_BITSET(data.toUInt()));
 
   // Check for the second byte's part of the MPEG synch
 
--- trunk/kdesupport/taglib/taglib/toolkit/taglib.h #1216678:1216679
@@ -36,6 +36,12 @@
 #define TAGLIB_IGNORE_MISSING_DESTRUCTOR
 #endif
 
+#if (defined(_MSC_VER) && _MSC_VER >= 1600)
+#define TAGLIB_CONSTRUCT_BITSET(x) static_cast<unsigned long long>(x)
+#else
+#define TAGLIB_CONSTRUCT_BITSET(x) static_cast<unsigned long>(x)
+#endif
+
 #include <string>
 
 //! A namespace for all TagLib related classes and functions
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic