]> granicus.if.org Git - taglib/commitdiff
Inline functions had better have internal linkages.
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Mon, 15 Feb 2016 11:53:27 +0000 (20:53 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Mon, 15 Feb 2016 11:53:27 +0000 (20:53 +0900)
This also removes useless inline specifiers.

12 files changed:
bindings/c/tag_c.cpp
taglib/ape/apeproperties.cpp
taglib/ape/apetag.cpp
taglib/asf/asfutils.h
taglib/fileref.cpp
taglib/mp4/mp4file.cpp
taglib/mpeg/mpegutils.h
taglib/ogg/oggfile.cpp
taglib/riff/riffutils.h
taglib/toolkit/tfilestream.cpp
taglib/toolkit/tstring.cpp
taglib/toolkit/tutils.h

index 33c61229099ea2d742193f48dec53be8a093e39e..04c549566e1baa52fbca09cc68e751d4841dd0f5 100644 (file)
@@ -50,7 +50,7 @@ namespace
   bool unicodeStrings = true;
   bool stringManagementEnabled = true;
 
-  inline char *stringToCharArray(const String &s)
+  char *stringToCharArray(const String &s)
   {
     const std::string str = s.to8Bit(unicodeStrings);
 
@@ -65,7 +65,7 @@ namespace
 #endif
   }
 
-  inline String charArrayToString(const char *s)
+  String charArrayToString(const char *s)
   {
     return String(s, unicodeStrings ? String::UTF8 : String::Latin1);
   }
index 26efd15fd5fbb997286f311bf623cefeb202f03d..dee7e8c050a54118e7fd8bc27a814725d10949fb 100644 (file)
@@ -133,7 +133,7 @@ unsigned int APE::Properties::sampleFrames() const
 
 namespace
 {
-  inline int headerVersion(const ByteVector &header)
+  int headerVersion(const ByteVector &header)
   {
     if(header.size() < 6 || !header.startsWith("MAC "))
       return -1;
index d49d07009ec85bf28c48bd7764f472ebbf4605fd..dfbd3076019c7b67979a469bb62f9cd9eeb2e645 100644 (file)
@@ -47,7 +47,7 @@ using namespace APE;
 
 namespace
 {
-  inline bool isKeyValid(const char *key, size_t length)
+  bool isKeyValid(const char *key, size_t length)
   {
     const char *invalidKeys[] = { "ID3", "TAG", "OGGS", "MP+", 0 };
 
index e3595a70bf5230212e08bed3f9033b3ecb84352f..a8ecd70dc7f888da925dfb68702a11d30065f25a 100644 (file)
@@ -34,65 +34,68 @@ namespace TagLib
 {
   namespace ASF
   {
-
-    inline unsigned short readWORD(File *file, bool *ok = 0)
+    namespace
     {
-      const ByteVector v = file->readBlock(2);
-      if(v.size() != 2) {
-        if(ok) *ok = false;
-        return 0;
-      }
-      if(ok) *ok = true;
-      return v.toUShort(false);
-    }
 
-    inline unsigned int readDWORD(File *file, bool *ok = 0)
-    {
-      const ByteVector v = file->readBlock(4);
-      if(v.size() != 4) {
-        if(ok) *ok = false;
-        return 0;
+      inline unsigned short readWORD(File *file, bool *ok = 0)
+      {
+        const ByteVector v = file->readBlock(2);
+        if(v.size() != 2) {
+          if(ok) *ok = false;
+          return 0;
+        }
+        if(ok) *ok = true;
+        return v.toUShort(false);
       }
-      if(ok) *ok = true;
-      return v.toUInt(false);
-    }
 
-    inline long long readQWORD(File *file, bool *ok = 0)
-    {
-      const ByteVector v = file->readBlock(8);
-      if(v.size() != 8) {
-        if(ok) *ok = false;
-        return 0;
+      inline unsigned int readDWORD(File *file, bool *ok = 0)
+      {
+        const ByteVector v = file->readBlock(4);
+        if(v.size() != 4) {
+          if(ok) *ok = false;
+          return 0;
+        }
+        if(ok) *ok = true;
+        return v.toUInt(false);
       }
-      if(ok) *ok = true;
-      return v.toLongLong(false);
-    }
 
-    inline String readString(File *file, int length)
-    {
-      ByteVector data = file->readBlock(length);
-      unsigned int size = data.size();
-      while (size >= 2) {
-        if(data[size - 1] != '\0' || data[size - 2] != '\0') {
-          break;
+      inline long long readQWORD(File *file, bool *ok = 0)
+      {
+        const ByteVector v = file->readBlock(8);
+        if(v.size() != 8) {
+          if(ok) *ok = false;
+          return 0;
         }
-        size -= 2;
+        if(ok) *ok = true;
+        return v.toLongLong(false);
       }
-      if(size != data.size()) {
-        data.resize(size);
+
+      inline String readString(File *file, int length)
+      {
+        ByteVector data = file->readBlock(length);
+        unsigned int size = data.size();
+        while (size >= 2) {
+          if(data[size - 1] != '\0' || data[size - 2] != '\0') {
+            break;
+          }
+          size -= 2;
+        }
+        if(size != data.size()) {
+          data.resize(size);
+        }
+        return String(data, String::UTF16LE);
       }
-      return String(data, String::UTF16LE);
-    }
 
-    inline ByteVector renderString(const String &str, bool includeLength = false)
-    {
-      ByteVector data = str.data(String::UTF16LE) + ByteVector::fromShort(0, false);
-      if(includeLength) {
-        data = ByteVector::fromShort(data.size(), false) + data;
+      inline ByteVector renderString(const String &str, bool includeLength = false)
+      {
+        ByteVector data = str.data(String::UTF16LE) + ByteVector::fromShort(0, false);
+        if(includeLength) {
+          data = ByteVector::fromShort(data.size(), false) + data;
+        }
+        return data;
       }
-      return data;
-    }
 
+    }
   }
 }
 
index 950b3f8a941a839d7c1ae177c185b8051f78ee12..3a7f2c65e53083c7e01be44b6ae38ae0de154cde 100644 (file)
@@ -62,42 +62,42 @@ namespace
   // Templatized internal functions. T should be String or IOStream*.
 
   template <typename T>
-  inline FileName toFileName(T arg)
+  FileName toFileName(T arg)
   {
     debug("FileRef::toFileName<T>(): This version should never be called.");
     return FileName(L"");
   }
 
   template <>
-  inline FileName toFileName<IOStream *>(IOStream *arg)
+  FileName toFileName<IOStream *>(IOStream *arg)
   {
     return arg->name();
   }
 
   template <>
-  inline FileName toFileName<FileName>(FileName arg)
+  FileName toFileName<FileName>(FileName arg)
   {
     return arg;
   }
 
   template <typename T>
-  inline File *resolveFileType(T arg, bool readProperties,
-                               AudioProperties::ReadStyle style)
+  File *resolveFileType(T arg, bool readProperties,
+                        AudioProperties::ReadStyle style)
   {
     debug("FileRef::resolveFileType<T>(): This version should never be called.");
     return 0;
   }
 
   template <>
-  inline File *resolveFileType<IOStream *>(IOStream *arg, bool readProperties,
-                                           AudioProperties::ReadStyle style)
+  File *resolveFileType<IOStream *>(IOStream *arg, bool readProperties,
+                                    AudioProperties::ReadStyle style)
   {
     return 0;
   }
 
   template <>
-  inline File *resolveFileType<FileName>(FileName arg, bool readProperties,
-                                         AudioProperties::ReadStyle style)
+  File *resolveFileType<FileName>(FileName arg, bool readProperties,
+                                  AudioProperties::ReadStyle style)
   {
     ResolverList::ConstIterator it = fileTypeResolvers.begin();
     for(; it != fileTypeResolvers.end(); ++it) {
index d0a6c4c66e561358083674a7d19975c401ba5324..3733fb40dce58e5d067e52ba3323ac5d93860fc0 100644 (file)
@@ -34,7 +34,7 @@ using namespace TagLib;
 
 namespace
 {
-  inline bool checkValid(const MP4::AtomList &list)
+  bool checkValid(const MP4::AtomList &list)
   {
     for(MP4::AtomList::ConstIterator it = list.begin(); it != list.end(); ++it) {
 
index 5a7e0e6a8d37d8d7a2b4615174705f4c974627d4..e35f752fb28be14f95bbab8f72586f452a6a9203 100644 (file)
@@ -34,25 +34,27 @@ namespace TagLib
 {
   namespace MPEG
   {
+    namespace
+    {
 
-    /*!
-     * MPEG frames can be recognized by the bit pattern 11111111 111, so the
-     * first byte is easy to check for, however checking to see if the second byte
-     * starts with \e 111 is a bit more tricky, hence these functions.
-     */
+      /*!
+       * MPEG frames can be recognized by the bit pattern 11111111 111, so the
+       * first byte is easy to check for, however checking to see if the second byte
+       * starts with \e 111 is a bit more tricky, hence these functions.
+       */
+      inline bool firstSyncByte(unsigned char byte)
+      {
+        return (byte == 0xFF);
+      }
 
-    inline bool firstSyncByte(unsigned char byte)
-    {
-      return (byte == 0xFF);
-    }
+      inline bool secondSynchByte(unsigned char byte)
+      {
+        // 0xFF is possible in theory, but it's very unlikely be a header.
 
-    inline bool secondSynchByte(unsigned char byte)
-    {
-      // 0xFF is possible in theory, but it's very unlikely be a header.
+        return (byte != 0xFF && ((byte & 0xE0) == 0xE0));
+      }
 
-      return (byte != 0xFF && ((byte & 0xE0) == 0xE0));
     }
-
   }
 }
 
index 6520cc3202de0388032b1de79832e284405dc322..86b0b0764ada2092e769372f71977554bc2e2b23 100644 (file)
@@ -37,7 +37,7 @@ using namespace TagLib;
 namespace
 {
   // Returns the first packet index of the right next page to the given one.
-  inline unsigned int nextPacketIndex(const Ogg::Page *page)
+  unsigned int nextPacketIndex(const Ogg::Page *page)
   {
     if(page->header()->lastPacketCompleted())
       return page->firstPacketIndex() + page->packetCount();
index 14b8508e8512c29b4659b0711b3d366923416a93..ecb985a4b5b7c576337bf3cde8cad612e345b779 100644 (file)
@@ -34,18 +34,23 @@ namespace TagLib
 {
   namespace RIFF
   {
-    inline bool isValidChunkName(const ByteVector &name)
+    namespace
     {
-      if(name.size() != 4)
-        return false;
 
-      for(ByteVector::ConstIterator it = name.begin(); it != name.end(); ++it) {
-        const int c = static_cast<unsigned char>(*it);
-        if(c < 32 || 127 < c)
+      inline bool isValidChunkName(const ByteVector &name)
+      {
+        if(name.size() != 4)
           return false;
+
+        for(ByteVector::ConstIterator it = name.begin(); it != name.end(); ++it) {
+          const int c = static_cast<unsigned char>(*it);
+          if(c < 32 || 127 < c)
+            return false;
+        }
+
+        return true;
       }
 
-      return true;
     }
   }
 }
index e20412f2ce1dd4915f1390eada61e2d1fc5ed4a5..5205bae0b6c610bef0edd0e9288e216032d2a82f 100644 (file)
@@ -47,7 +47,7 @@ namespace
 
   const FileHandle InvalidFileHandle = INVALID_HANDLE_VALUE;
 
-  inline FileHandle openFile(const FileName &path, bool readOnly)
+  FileHandle openFile(const FileName &path, bool readOnly)
   {
     const DWORD access = readOnly ? GENERIC_READ : (GENERIC_READ | GENERIC_WRITE);
 
@@ -59,12 +59,12 @@ namespace
       return InvalidFileHandle;
   }
 
-  inline void closeFile(FileHandle file)
+  void closeFile(FileHandle file)
   {
     CloseHandle(file);
   }
 
-  inline size_t readFile(FileHandle file, ByteVector &buffer)
+  size_t readFile(FileHandle file, ByteVector &buffer)
   {
     DWORD length;
     if(ReadFile(file, buffer.data(), static_cast<DWORD>(buffer.size()), &length, NULL))
@@ -73,7 +73,7 @@ namespace
       return 0;
   }
 
-  inline size_t writeFile(FileHandle file, const ByteVector &buffer)
+  size_t writeFile(FileHandle file, const ByteVector &buffer)
   {
     DWORD length;
     if(WriteFile(file, buffer.data(), static_cast<DWORD>(buffer.size()), &length, NULL))
@@ -94,22 +94,22 @@ namespace
 
   const FileHandle InvalidFileHandle = 0;
 
-  inline FileHandle openFile(const FileName &path, bool readOnly)
+  FileHandle openFile(const FileName &path, bool readOnly)
   {
     return fopen(path, readOnly ? "rb" : "rb+");
   }
 
-  inline void closeFile(FileHandle file)
+  void closeFile(FileHandle file)
   {
     fclose(file);
   }
 
-  inline size_t readFile(FileHandle file, ByteVector &buffer)
+  size_t readFile(FileHandle file, ByteVector &buffer)
   {
     return fread(buffer.data(), sizeof(char), buffer.size(), file);
   }
 
-  inline size_t writeFile(FileHandle file, const ByteVector &buffer)
+  size_t writeFile(FileHandle file, const ByteVector &buffer)
   {
     return fwrite(buffer.data(), sizeof(char), buffer.size(), file);
   }
index 8a596e4cca902f760ddf09f0f32da373922b2950..56daf33faa2a90d61e7eb33d0544b2ea822a5766 100644 (file)
 # include <config.h>
 #endif
 
-#include "tstring.h"
-#include "tdebug.h"
-#include "tstringlist.h"
-#include "trefcounter.h"
-#include "tutils.h"
-
 #include <iostream>
 #include <cerrno>
 #include <climits>
 # include "unicode.h"
 #endif
 
+#include <tstring.h>
+#include <tdebug.h>
+#include <tstringlist.h>
+#include <trefcounter.h>
+#include <tutils.h>
+
 namespace
 {
   using namespace TagLib;
 
-  inline size_t UTF16toUTF8(
-    const wchar_t *src, size_t srcLength, char *dst, size_t dstLength)
+  size_t UTF16toUTF8(const wchar_t *src, size_t srcLength, char *dst, size_t dstLength)
   {
     size_t len = 0;
 
@@ -84,8 +83,7 @@ namespace
     return len;
   }
 
-  inline size_t UTF8toUTF16(
-    const char *src, size_t srcLength, wchar_t *dst, size_t dstLength)
+  size_t UTF8toUTF16(const char *src, size_t srcLength, wchar_t *dst, size_t dstLength)
   {
     size_t len = 0;
 
@@ -118,7 +116,7 @@ namespace
   }
 
   // Returns the native format of std::wstring.
-  inline String::Type wcharByteOrder()
+  String::Type wcharByteOrder()
   {
     if(Utils::systemByteOrder() == Utils::LittleEndian)
       return String::UTF16LE;
@@ -128,7 +126,7 @@ namespace
 
   // Converts a Latin-1 string into UTF-16(without BOM/CPU byte order)
   // and copies it to the internal buffer.
-  inline void copyFromLatin1(std::wstring &data, const char *s, size_t length)
+  void copyFromLatin1(std::wstring &data, const char *s, size_t length)
   {
     data.resize(length);
 
@@ -138,7 +136,7 @@ namespace
 
   // Converts a UTF-8 string into UTF-16(without BOM/CPU byte order)
   // and copies it to the internal buffer.
-  inline void copyFromUTF8(std::wstring &data, const char *s, size_t length)
+  void copyFromUTF8(std::wstring &data, const char *s, size_t length)
   {
     data.resize(length);
 
@@ -150,7 +148,7 @@ namespace
 
   // Converts a UTF-16 (with BOM), UTF-16LE or UTF16-BE string into
   // UTF-16(without BOM/CPU byte order) and copies it to the internal buffer.
-  inline void copyFromUTF16(std::wstring &data, const wchar_t *s, size_t length, String::Type t)
+  void copyFromUTF16(std::wstring &data, const wchar_t *s, size_t length, String::Type t)
   {
     bool swap;
     if(t == String::UTF16) {
@@ -184,7 +182,7 @@ namespace
 
   // Converts a UTF-16 (with BOM), UTF-16LE or UTF16-BE string into
   // UTF-16(without BOM/CPU byte order) and copies it to the internal buffer.
-  inline void copyFromUTF16(std::wstring &data, const char *s, size_t length, String::Type t)
+  void copyFromUTF16(std::wstring &data, const char *s, size_t length, String::Type t)
   {
     bool swap;
     if(t == String::UTF16) {
index bacbc2dd79aa78804e551784f1b30375f44c06c8..6653e47be0d6719d1a71452f3fcdd63f7222b2c3 100644 (file)
@@ -55,235 +55,237 @@ namespace TagLib
 {
   namespace Utils
   {
-
-    /*!
-     * Reverses the order of bytes in an 16-bit integer.
-     */
-    inline unsigned short byteSwap(unsigned short x)
+    namespace
     {
+
+      /*!
+       * Reverses the order of bytes in an 16-bit integer.
+       */
+      inline unsigned short byteSwap(unsigned short x)
+      {
 #if defined(HAVE_BOOST_BYTESWAP)
 
-      return boost::endian::endian_reverse(x);
+        return boost::endian::endian_reverse(x);
 
 #elif defined(HAVE_GCC_BYTESWAP)
 
-      return __builtin_bswap16(x);
+        return __builtin_bswap16(x);
 
 #elif defined(HAVE_MSC_BYTESWAP)
 
-      return _byteswap_ushort(x);
+        return _byteswap_ushort(x);
 
 #elif defined(HAVE_GLIBC_BYTESWAP)
 
-      return __bswap_16(x);
+        return __bswap_16(x);
 
 #elif defined(HAVE_MAC_BYTESWAP)
 
-      return OSSwapInt16(x);
+        return OSSwapInt16(x);
 
 #elif defined(HAVE_OPENBSD_BYTESWAP)
 
-      return swap16(x);
+        return swap16(x);
 
 #else
 
-      return ((x >> 8) & 0xff) | ((x & 0xff) << 8);
+        return ((x >> 8) & 0xff) | ((x & 0xff) << 8);
 
 #endif
-    }
+      }
 
-    /*!
-     * Reverses the order of bytes in an 32-bit integer.
-     */
-    inline unsigned int byteSwap(unsigned int x)
-    {
+      /*!
+       * Reverses the order of bytes in an 32-bit integer.
+       */
+      inline unsigned int byteSwap(unsigned int x)
+      {
 #if defined(HAVE_BOOST_BYTESWAP)
 
-      return boost::endian::endian_reverse(x);
+        return boost::endian::endian_reverse(x);
 
 #elif defined(HAVE_GCC_BYTESWAP)
 
-      return __builtin_bswap32(x);
+        return __builtin_bswap32(x);
 
 #elif defined(HAVE_MSC_BYTESWAP)
 
-      return _byteswap_ulong(x);
+        return _byteswap_ulong(x);
 
 #elif defined(HAVE_GLIBC_BYTESWAP)
 
-      return __bswap_32(x);
+        return __bswap_32(x);
 
 #elif defined(HAVE_MAC_BYTESWAP)
 
-      return OSSwapInt32(x);
+        return OSSwapInt32(x);
 
 #elif defined(HAVE_OPENBSD_BYTESWAP)
 
-      return swap32(x);
+        return swap32(x);
 
 #else
 
-      return ((x & 0xff000000u) >> 24)
-        | ((x & 0x00ff0000u) >>  8)
-        | ((x & 0x0000ff00u) <<  8)
-        | ((x & 0x000000ffu) << 24);
+        return ((x & 0xff000000u) >> 24)
+          | ((x & 0x00ff0000u) >>  8)
+          | ((x & 0x0000ff00u) <<  8)
+          | ((x & 0x000000ffu) << 24);
 
 #endif
-    }
+      }
 
-    /*!
-     * Reverses the order of bytes in an 64-bit integer.
-     */
-    inline unsigned long long byteSwap(unsigned long long x)
-    {
+      /*!
+       * Reverses the order of bytes in an 64-bit integer.
+       */
+      inline unsigned long long byteSwap(unsigned long long x)
+      {
 #if defined(HAVE_BOOST_BYTESWAP)
 
-      return boost::endian::endian_reverse(x);
+        return boost::endian::endian_reverse(x);
 
 #elif defined(HAVE_GCC_BYTESWAP)
 
-      return __builtin_bswap64(x);
+        return __builtin_bswap64(x);
 
 #elif defined(HAVE_MSC_BYTESWAP)
 
-      return _byteswap_uint64(x);
+        return _byteswap_uint64(x);
 
 #elif defined(HAVE_GLIBC_BYTESWAP)
 
-      return __bswap_64(x);
+        return __bswap_64(x);
 
 #elif defined(HAVE_MAC_BYTESWAP)
 
-      return OSSwapInt64(x);
+        return OSSwapInt64(x);
 
 #elif defined(HAVE_OPENBSD_BYTESWAP)
 
-      return swap64(x);
+        return swap64(x);
 
 #else
 
-      return ((x & 0xff00000000000000ull) >> 56)
-        | ((x & 0x00ff000000000000ull) >> 40)
-        | ((x & 0x0000ff0000000000ull) >> 24)
-        | ((x & 0x000000ff00000000ull) >> 8)
-        | ((x & 0x00000000ff000000ull) << 8)
-        | ((x & 0x0000000000ff0000ull) << 24)
-        | ((x & 0x000000000000ff00ull) << 40)
-        | ((x & 0x00000000000000ffull) << 56);
+        return ((x & 0xff00000000000000ull) >> 56)
+          | ((x & 0x00ff000000000000ull) >> 40)
+          | ((x & 0x0000ff0000000000ull) >> 24)
+          | ((x & 0x000000ff00000000ull) >> 8)
+          | ((x & 0x00000000ff000000ull) << 8)
+          | ((x & 0x0000000000ff0000ull) << 24)
+          | ((x & 0x000000000000ff00ull) << 40)
+          | ((x & 0x00000000000000ffull) << 56);
 
 #endif
-    }
+      }
 
-    /*!
-     * Returns a formatted string just like standard sprintf(), but makes use of
-     * safer functions such as snprintf() if available.
-     */
-    inline String formatString(const char *format, ...)
-    {
-      // Sufficient buffer size for the current internal uses.
-      // Consider changing this value when you use this function.
+      /*!
+       * Returns a formatted string just like standard sprintf(), but makes use of
+       * safer functions such as snprintf() if available.
+       */
+      inline String formatString(const char *format, ...)
+      {
+        // Sufficient buffer size for the current internal uses.
+        // Consider changing this value when you use this function.
 
-      static const size_t BufferSize = 128;
+        static const size_t BufferSize = 128;
 
-      va_list args;
-      va_start(args, format);
+        va_list args;
+        va_start(args, format);
 
-      char buf[BufferSize];
-      int length;
+        char buf[BufferSize];
+        int length;
 
 #if defined(HAVE_VSNPRINTF)
 
-      length = vsnprintf(buf, BufferSize, format, args);
+        length = vsnprintf(buf, BufferSize, format, args);
 
 #elif defined(HAVE_VSPRINTF_S)
 
-      length = vsprintf_s(buf, format, args);
+        length = vsprintf_s(buf, format, args);
 
 #else
 
-      // The last resort. May cause a buffer overflow.
+        // The last resort. May cause a buffer overflow.
 
-      length = vsprintf(buf, format, args);
-      if(length >= BufferSize) {
-        debug("Utils::formatString() - Buffer overflow! Returning an empty string.");
-        length = -1;
-      }
+        length = vsprintf(buf, format, args);
+        if(length >= BufferSize) {
+          debug("Utils::formatString() - Buffer overflow! Returning an empty string.");
+          length = -1;
+        }
 
 #endif
 
-      va_end(args);
+        va_end(args);
 
-      if(length > 0)
-        return String(buf);
-      else
-        return String();
-    }
-
-    /*!
-     * Returns whether the two strings s1 and s2 are equal, ignoring the case of
-     * the characters.
-     *
-     * We took the trouble to define this one here, since there are some
-     * incompatible variations of case insensitive strcmp().
-     */
-    inline bool equalsIgnoreCase(const char *s1, const char *s2)
-    {
-      while(*s1 != '\0' && *s2 != '\0' && ::tolower(*s1) == ::tolower(*s2)) {
-        s1++;
-        s2++;
+        if(length > 0)
+          return String(buf);
+        else
+          return String();
       }
 
-      return (*s1 == '\0' && *s2 == '\0');
-    }
+      /*!
+       * Returns whether the two strings s1 and s2 are equal, ignoring the case of
+       * the characters.
+       *
+       * We took the trouble to define this one here, since there are some
+       * incompatible variations of case insensitive strcmp().
+       */
+      inline bool equalsIgnoreCase(const char *s1, const char *s2)
+      {
+        while(*s1 != '\0' && *s2 != '\0' && ::tolower(*s1) == ::tolower(*s2)) {
+          s1++;
+          s2++;
+        }
+
+        return (*s1 == '\0' && *s2 == '\0');
+      }
 
-    /*!
-     * The types of byte order of the running system.
-     */
-    enum ByteOrder
-    {
-      //! Little endian systems.
-      LittleEndian,
-      //! Big endian systems.
-      BigEndian
-    };
-
-    /*!
-     * Returns the integer byte order of the system.
-     */
-    inline ByteOrder systemByteOrder()
-    {
-      union {
-        int  i;
-        char c;
-      } u;
-
-      u.i = 1;
-      if(u.c == 1)
-        return LittleEndian;
-      else
-        return BigEndian;
-    }
+      /*!
+       * The types of byte order of the running system.
+       */
+      enum ByteOrder
+      {
+        //! Little endian systems.
+        LittleEndian,
+        //! Big endian systems.
+        BigEndian
+      };
+
+      /*!
+       * Returns the integer byte order of the system.
+       */
+      inline ByteOrder systemByteOrder()
+      {
+        union {
+          int  i;
+          char c;
+        } u;
+
+        u.i = 1;
+        if(u.c == 1)
+          return LittleEndian;
+        else
+          return BigEndian;
+      }
 
-    /*!
-     * Returns the IEEE754 byte order of the system.
-     */
-    inline ByteOrder floatByteOrder()
-    {
-      union {
-        double d;
-        char   c;
-      } u;
-
-      // 1.0 is stored in memory like 0x3FF0000000000000 in canonical form.
-      // So the first byte is zero if little endian.
-
-      u.d = 1.0;
-      if(u.c == 0)
-        return LittleEndian;
-      else
-        return BigEndian;
+      /*!
+       * Returns the IEEE754 byte order of the system.
+       */
+      inline ByteOrder floatByteOrder()
+      {
+        union {
+          double d;
+          char   c;
+        } u;
+
+        // 1.0 is stored in memory like 0x3FF0000000000000 in canonical form.
+        // So the first byte is zero if little endian.
+
+        u.d = 1.0;
+        if(u.c == 0)
+          return LittleEndian;
+        else
+          return BigEndian;
+      }
     }
-
   }
 }