aboutsummaryrefslogtreecommitdiff
path: root/src/processor/binarystream.cc
diff options
context:
space:
mode:
authorted.mielczarek@gmail.com <ted.mielczarek@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>2013-03-06 14:04:42 +0000
committerted.mielczarek@gmail.com <ted.mielczarek@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e>2013-03-06 14:04:42 +0000
commitaeffe1056f9ff6526d87a16ef55222899f5528f7 (patch)
tree1b7601a9135f82c14e73535c9d4a24f94d494662 /src/processor/binarystream.cc
parentWork around Windows headers #defining ERROR by renaming enum values in StackF... (diff)
downloadbreakpad-aeffe1056f9ff6526d87a16ef55222899f5528f7.tar.xz
Use stdint types everywhere
R=mark at https://breakpad.appspot.com/535002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1121 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/processor/binarystream.cc')
-rw-r--r--src/processor/binarystream.cc34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/processor/binarystream.cc b/src/processor/binarystream.cc
index 9ed3b702..bf92225b 100644
--- a/src/processor/binarystream.cc
+++ b/src/processor/binarystream.cc
@@ -40,7 +40,7 @@ namespace google_breakpad {
using std::vector;
binarystream &binarystream::operator>>(string &str) {
- u_int16_t length;
+ uint16_t length;
*this >> length;
if (eof())
return *this;
@@ -55,68 +55,68 @@ binarystream &binarystream::operator>>(string &str) {
return *this;
}
-binarystream &binarystream::operator>>(u_int8_t &u8) {
+binarystream &binarystream::operator>>(uint8_t &u8) {
stream_.read((char *)&u8, 1);
return *this;
}
-binarystream &binarystream::operator>>(u_int16_t &u16) {
- u_int16_t temp;
+binarystream &binarystream::operator>>(uint16_t &u16) {
+ uint16_t temp;
stream_.read((char *)&temp, 2);
if (!eof())
u16 = ntohs(temp);
return *this;
}
-binarystream &binarystream::operator>>(u_int32_t &u32) {
- u_int32_t temp;
+binarystream &binarystream::operator>>(uint32_t &u32) {
+ uint32_t temp;
stream_.read((char *)&temp, 4);
if (!eof())
u32 = ntohl(temp);
return *this;
}
-binarystream &binarystream::operator>>(u_int64_t &u64) {
- u_int32_t lower, upper;
+binarystream &binarystream::operator>>(uint64_t &u64) {
+ uint32_t lower, upper;
*this >> lower >> upper;
if (!eof())
- u64 = static_cast<u_int64_t>(lower) | (static_cast<u_int64_t>(upper) << 32);
+ u64 = static_cast<uint64_t>(lower) | (static_cast<uint64_t>(upper) << 32);
return *this;
}
binarystream &binarystream::operator<<(const string &str) {
if (str.length() > USHRT_MAX) {
// truncate to 16-bit length
- *this << static_cast<u_int16_t>(USHRT_MAX);
+ *this << static_cast<uint16_t>(USHRT_MAX);
stream_.write(str.c_str(), USHRT_MAX);
} else {
- *this << (u_int16_t)(str.length() & 0xFFFF);
+ *this << (uint16_t)(str.length() & 0xFFFF);
stream_.write(str.c_str(), str.length());
}
return *this;
}
-binarystream &binarystream::operator<<(u_int8_t u8) {
+binarystream &binarystream::operator<<(uint8_t u8) {
stream_.write((const char*)&u8, 1);
return *this;
}
-binarystream &binarystream::operator<<(u_int16_t u16) {
+binarystream &binarystream::operator<<(uint16_t u16) {
u16 = htons(u16);
stream_.write((const char*)&u16, 2);
return *this;
}
-binarystream &binarystream::operator<<(u_int32_t u32) {
+binarystream &binarystream::operator<<(uint32_t u32) {
u32 = htonl(u32);
stream_.write((const char*)&u32, 4);
return *this;
}
-binarystream &binarystream::operator<<(u_int64_t u64) {
+binarystream &binarystream::operator<<(uint64_t u64) {
// write 64-bit ints as two 32-bit ints, so we can byte-swap them easily
- u_int32_t lower = static_cast<u_int32_t>(u64 & 0xFFFFFFFF);
- u_int32_t upper = static_cast<u_int32_t>(u64 >> 32);
+ uint32_t lower = static_cast<uint32_t>(u64 & 0xFFFFFFFF);
+ uint32_t upper = static_cast<uint32_t>(u64 >> 32);
*this << lower << upper;
return *this;
}