ソースを参照

replace ULONG_MAX with c++ style std::numeric_limits

For some reason travis seems to be unhappy about it claiming it
is not defined. Well, lets not think to deeply about it…

Git-Dch: Ignore
David Kalnischkies 11 年 前
コミット
c69e837094
共有1 個のファイルを変更した2 個の追加2 個の削除を含む
  1. 2 2
      methods/rred.cc

+ 2 - 2
methods/rred.cc

@@ -405,12 +405,12 @@ class Patch {
 	    size_t s, e;
 	    errno = 0;
 	    s = strtoul(buffer, &m, 10);
-	    if (unlikely(m == buffer || s == ULONG_MAX || errno != 0))
+	    if (unlikely(m == buffer || s == std::numeric_limits<unsigned long>::max() || errno != 0))
 	       return _error->Error("Parsing patchfile %s failed: Expected an effected line start", f.Name().c_str());
 	    else if (*m == ',') {
 	       ++m;
 	       e = strtol(m, &c, 10);
-	       if (unlikely(m == c || e == ULONG_MAX || errno != 0))
+	       if (unlikely(m == c || e == std::numeric_limits<unsigned long>::max() || errno != 0))
 		  return _error->Error("Parsing patchfile %s failed: Expected an effected line end", f.Name().c_str());
 	       if (unlikely(e < s))
 		  return _error->Error("Parsing patchfile %s failed: Effected lines end %lu is before start %lu", f.Name().c_str(), e, s);