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
This commit is contained in:
ted.mielczarek@gmail.com 2013-03-06 14:04:42 +00:00
parent c02002a581
commit aeffe1056f
117 changed files with 1385 additions and 1379 deletions

View file

@ -46,14 +46,14 @@
//
class GUIDGenerator {
public:
static u_int32_t BytesToUInt32(const u_int8_t bytes[]) {
return ((u_int32_t) bytes[0]
| ((u_int32_t) bytes[1] << 8)
| ((u_int32_t) bytes[2] << 16)
| ((u_int32_t) bytes[3] << 24));
static uint32_t BytesToUInt32(const uint8_t bytes[]) {
return ((uint32_t) bytes[0]
| ((uint32_t) bytes[1] << 8)
| ((uint32_t) bytes[2] << 16)
| ((uint32_t) bytes[3] << 24));
}
static void UInt32ToBytes(u_int8_t bytes[], u_int32_t n) {
static void UInt32ToBytes(uint8_t bytes[], uint32_t n) {
bytes[0] = n & 0xff;
bytes[1] = (n >> 8) & 0xff;
bytes[2] = (n >> 16) & 0xff;
@ -63,8 +63,8 @@ class GUIDGenerator {
static bool CreateGUID(GUID *guid) {
InitOnce();
guid->data1 = random();
guid->data2 = (u_int16_t)(random());
guid->data3 = (u_int16_t)(random());
guid->data2 = (uint16_t)(random());
guid->data3 = (uint16_t)(random());
UInt32ToBytes(&guid->data4[0], random());
UInt32ToBytes(&guid->data4[4], random());
return true;

View file

@ -97,7 +97,7 @@ bool MemoryMappedFile::Map(const char* path) {
void MemoryMappedFile::Unmap() {
if (content_.data()) {
sys_munmap(const_cast<u_int8_t*>(content_.data()), content_.length());
sys_munmap(const_cast<uint8_t*>(content_.data()), content_.length());
content_.Set(NULL, 0);
}
}