Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Unified Diff: net/disk_cache/blockfile/file_ios.cc

Issue 1492403002: Remove kuint32max. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: http security header file Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/disk_cache/blockfile/backend_impl_v3.cc ('k') | net/disk_cache/blockfile/file_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/blockfile/file_ios.cc
diff --git a/net/disk_cache/blockfile/file_ios.cc b/net/disk_cache/blockfile/file_ios.cc
index 3ffb5a585671bc32d4f6f6299f98ad709eb5ca05..b00c246953d43619ac8db1d130f4e3975552f329 100644
--- a/net/disk_cache/blockfile/file_ios.cc
+++ b/net/disk_cache/blockfile/file_ios.cc
@@ -4,6 +4,10 @@
#include "net/disk_cache/blockfile/file.h"
+#include <stdint.h>
+
+#include <limits>
+
#include "base/bind.h"
#include "base/location.h"
#include "base/logging.h"
@@ -188,8 +192,8 @@ bool File::IsValid() const {
bool File::Read(void* buffer, size_t buffer_len, size_t offset) {
DCHECK(base_file_.IsValid());
- if (buffer_len > static_cast<size_t>(kint32max) ||
- offset > static_cast<size_t>(kint32max)) {
+ if (buffer_len > static_cast<size_t>(std::numeric_limits<int32_t>::max()) ||
+ offset > static_cast<size_t>(std::numeric_limits<int32_t>::max())) {
return false;
}
@@ -199,8 +203,8 @@ bool File::Read(void* buffer, size_t buffer_len, size_t offset) {
bool File::Write(const void* buffer, size_t buffer_len, size_t offset) {
DCHECK(base_file_.IsValid());
- if (buffer_len > static_cast<size_t>(kint32max) ||
- offset > static_cast<size_t>(kint32max)) {
+ if (buffer_len > static_cast<size_t>(std::numeric_limits<int32_t>::max()) ||
+ offset > static_cast<size_t>(std::numeric_limits<int32_t>::max())) {
return false;
}
@@ -244,7 +248,7 @@ bool File::Write(const void* buffer, size_t buffer_len, size_t offset,
bool File::SetLength(size_t length) {
DCHECK(base_file_.IsValid());
- if (length > kuint32max)
+ if (length > std::numeric_limits<uint32_t>::max())
return false;
return base_file_.SetLength(length);
@@ -252,10 +256,10 @@ bool File::SetLength(size_t length) {
size_t File::GetLength() {
DCHECK(base_file_.IsValid());
- int64 len = base_file_.GetLength();
+ int64_t len = base_file_.GetLength();
- if (len > static_cast<int64>(kuint32max))
- return kuint32max;
+ if (len > static_cast<int64_t>(std::numeric_limits<uint32_t>::max()))
+ return std::numeric_limits<uint32_t>::max();
return static_cast<size_t>(len);
}
« no previous file with comments | « net/disk_cache/blockfile/backend_impl_v3.cc ('k') | net/disk_cache/blockfile/file_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698