mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-02-19 08:42:59 +00:00
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:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user