aboutsummaryrefslogtreecommitdiffstats
path: root/src/tag
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-17 21:53:19 +0200
committerMax Kellermann <max@duempel.org>2013-10-17 21:53:19 +0200
commit58502b38d3eaf5649c9e09b6af6ea84d726dccd1 (patch)
treeb9bbcf6711b783ceba4aac6259e1cb7c66293ec4 /src/tag
parentd44880dfa99197a8c1f4b65416470e6ffbe534f6 (diff)
downloadmpd-58502b38d3eaf5649c9e09b6af6ea84d726dccd1.tar.gz
mpd-58502b38d3eaf5649c9e09b6af6ea84d726dccd1.tar.xz
mpd-58502b38d3eaf5649c9e09b6af6ea84d726dccd1.zip
*: use std::numeric_limits
Diffstat (limited to 'src/tag')
-rw-r--r--src/tag/Aiff.cxx4
-rw-r--r--src/tag/Riff.cxx5
2 files changed, 4 insertions, 5 deletions
diff --git a/src/tag/Aiff.cxx b/src/tag/Aiff.cxx
index 4135565f7..73e46e49f 100644
--- a/src/tag/Aiff.cxx
+++ b/src/tag/Aiff.cxx
@@ -23,7 +23,7 @@
#include "system/ByteOrder.hxx"
#include "Log.hxx"
-#include <glib.h>
+#include <limits>
#include <stdint.h>
#include <sys/types.h>
@@ -81,7 +81,7 @@ aiff_seek_id3(FILE *file)
return 0;
size = FromBE32(chunk.size);
- if (size > G_MAXINT32)
+ if (size > unsigned(std::numeric_limits<int>::max()))
/* too dangerous, bail out: possible integer
underflow when casting to off_t */
return 0;
diff --git a/src/tag/Riff.cxx b/src/tag/Riff.cxx
index 3728d281c..ad64afc39 100644
--- a/src/tag/Riff.cxx
+++ b/src/tag/Riff.cxx
@@ -23,12 +23,11 @@
#include "system/ByteOrder.hxx"
#include "Log.hxx"
-#include <glib.h>
+#include <limits>
#include <stdint.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <unistd.h>
#include <string.h>
static constexpr Domain riff_domain("riff");
@@ -79,7 +78,7 @@ riff_seek_id3(FILE *file)
return 0;
size = FromLE32(chunk.size);
- if (size > G_MAXINT32)
+ if (size > size_t(std::numeric_limits<int>::max()))
/* too dangerous, bail out: possible integer
underflow when casting to off_t */
return 0;