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

Unified Diff: webrtc/base/bytebuffer.cc

Issue 1362503003: Use suffixed {uint,int}{8,16,32,64}_t types. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase + revert basictypes.h (to be landed separately just in case of a revert due to unexpected us… Created 5 years, 2 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 | « webrtc/base/bytebuffer.h ('k') | webrtc/base/bytebuffer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/bytebuffer.cc
diff --git a/webrtc/base/bytebuffer.cc b/webrtc/base/bytebuffer.cc
index 4b6a1d8d629e9297e1d04dec66f7e965480b9652..8bc1f23670e7917736ee1e79fa304b57ca1187ff 100644
--- a/webrtc/base/bytebuffer.cc
+++ b/webrtc/base/bytebuffer.cc
@@ -66,16 +66,16 @@ ByteBuffer::~ByteBuffer() {
delete[] bytes_;
}
-bool ByteBuffer::ReadUInt8(uint8* val) {
+bool ByteBuffer::ReadUInt8(uint8_t* val) {
if (!val) return false;
return ReadBytes(reinterpret_cast<char*>(val), 1);
}
-bool ByteBuffer::ReadUInt16(uint16* val) {
+bool ByteBuffer::ReadUInt16(uint16_t* val) {
if (!val) return false;
- uint16 v;
+ uint16_t v;
if (!ReadBytes(reinterpret_cast<char*>(&v), 2)) {
return false;
} else {
@@ -84,10 +84,10 @@ bool ByteBuffer::ReadUInt16(uint16* val) {
}
}
-bool ByteBuffer::ReadUInt24(uint32* val) {
+bool ByteBuffer::ReadUInt24(uint32_t* val) {
if (!val) return false;
- uint32 v = 0;
+ uint32_t v = 0;
char* read_into = reinterpret_cast<char*>(&v);
if (byte_order_ == ORDER_NETWORK || IsHostBigEndian()) {
++read_into;
@@ -101,10 +101,10 @@ bool ByteBuffer::ReadUInt24(uint32* val) {
}
}
-bool ByteBuffer::ReadUInt32(uint32* val) {
+bool ByteBuffer::ReadUInt32(uint32_t* val) {
if (!val) return false;
- uint32 v;
+ uint32_t v;
if (!ReadBytes(reinterpret_cast<char*>(&v), 4)) {
return false;
} else {
@@ -113,10 +113,10 @@ bool ByteBuffer::ReadUInt32(uint32* val) {
}
}
-bool ByteBuffer::ReadUInt64(uint64* val) {
+bool ByteBuffer::ReadUInt64(uint64_t* val) {
if (!val) return false;
- uint64 v;
+ uint64_t v;
if (!ReadBytes(reinterpret_cast<char*>(&v), 8)) {
return false;
} else {
@@ -147,17 +147,17 @@ bool ByteBuffer::ReadBytes(char* val, size_t len) {
}
}
-void ByteBuffer::WriteUInt8(uint8 val) {
+void ByteBuffer::WriteUInt8(uint8_t val) {
WriteBytes(reinterpret_cast<const char*>(&val), 1);
}
-void ByteBuffer::WriteUInt16(uint16 val) {
- uint16 v = (byte_order_ == ORDER_NETWORK) ? HostToNetwork16(val) : val;
+void ByteBuffer::WriteUInt16(uint16_t val) {
+ uint16_t v = (byte_order_ == ORDER_NETWORK) ? HostToNetwork16(val) : val;
WriteBytes(reinterpret_cast<const char*>(&v), 2);
}
-void ByteBuffer::WriteUInt24(uint32 val) {
- uint32 v = (byte_order_ == ORDER_NETWORK) ? HostToNetwork32(val) : val;
+void ByteBuffer::WriteUInt24(uint32_t val) {
+ uint32_t v = (byte_order_ == ORDER_NETWORK) ? HostToNetwork32(val) : val;
char* start = reinterpret_cast<char*>(&v);
if (byte_order_ == ORDER_NETWORK || IsHostBigEndian()) {
++start;
@@ -165,13 +165,13 @@ void ByteBuffer::WriteUInt24(uint32 val) {
WriteBytes(start, 3);
}
-void ByteBuffer::WriteUInt32(uint32 val) {
- uint32 v = (byte_order_ == ORDER_NETWORK) ? HostToNetwork32(val) : val;
+void ByteBuffer::WriteUInt32(uint32_t val) {
+ uint32_t v = (byte_order_ == ORDER_NETWORK) ? HostToNetwork32(val) : val;
WriteBytes(reinterpret_cast<const char*>(&v), 4);
}
-void ByteBuffer::WriteUInt64(uint64 val) {
- uint64 v = (byte_order_ == ORDER_NETWORK) ? HostToNetwork64(val) : val;
+void ByteBuffer::WriteUInt64(uint64_t val) {
+ uint64_t v = (byte_order_ == ORDER_NETWORK) ? HostToNetwork64(val) : val;
WriteBytes(reinterpret_cast<const char*>(&v), 8);
}
« no previous file with comments | « webrtc/base/bytebuffer.h ('k') | webrtc/base/bytebuffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698