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

Unified Diff: base/big_endian.cc

Issue 145873006: ui/base/resource: Roll our own version of ReadBigEndian() function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 months 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 | « base/big_endian.h ('k') | base/big_endian_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/big_endian.cc
diff --git a/net/base/big_endian.cc b/base/big_endian.cc
similarity index 84%
rename from net/base/big_endian.cc
rename to base/big_endian.cc
index 888cf35c6d610d9f74a5f79bc796230bc803b4e2..4d441fcb5dc283459b661983d3c6e1b5b0423b63 100644
--- a/net/base/big_endian.cc
+++ b/base/big_endian.cc
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "net/base/big_endian.h"
+#include "base/big_endian.h"
#include "base/strings/string_piece.h"
-namespace net {
+namespace base {
-BigEndianReader::BigEndianReader(const void* buf, size_t len)
- : ptr_(reinterpret_cast<const char*>(buf)), end_(ptr_ + len) {}
+BigEndianReader::BigEndianReader(const char* buf, size_t len)
+ : ptr_(buf), end_(ptr_ + len) {}
bool BigEndianReader::Skip(size_t len) {
if (ptr_ + len > end_)
@@ -55,8 +55,8 @@ bool BigEndianReader::ReadU32(uint32* value) {
return Read(value);
}
-BigEndianWriter::BigEndianWriter(void* buf, size_t len)
- : ptr_(reinterpret_cast<char*>(buf)), end_(ptr_ + len) {}
+BigEndianWriter::BigEndianWriter(char* buf, size_t len)
+ : ptr_(buf), end_(ptr_ + len) {}
bool BigEndianWriter::Skip(size_t len) {
if (ptr_ + len > end_)
@@ -94,5 +94,4 @@ bool BigEndianWriter::WriteU32(uint32 value) {
return Write(value);
}
-} // namespace net
-
+} // namespace base
« no previous file with comments | « base/big_endian.h ('k') | base/big_endian_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698