Skip to content

Commit 4fa4457

Browse files
committed
Use stdint.h instead of cstdint in gpt.h
Recommmended by: https://google.github.io/styleguide/cppguide.html#Integer_Types Bug: b/436625775
1 parent 81ff1f9 commit 4fa4457

File tree

1 file changed

+24
-24
lines changed
  • base/cvd/cuttlefish/host/libs/image_aggregator

1 file changed

+24
-24
lines changed

base/cvd/cuttlefish/host/libs/image_aggregator/gpt.h

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
#pragma once
1717

18-
#include <cstdint>
18+
#include <stdint.h>
1919

2020
#include "cuttlefish/common/libs/utils/size_utils.h"
2121
#include "cuttlefish/host/libs/image_aggregator/mbr.h"
@@ -25,41 +25,41 @@ namespace cuttlefish {
2525
constexpr int GPT_NUM_PARTITIONS = 128;
2626

2727
struct __attribute__((packed)) GptHeader {
28-
std::uint8_t signature[8];
29-
std::uint8_t revision[4];
30-
std::uint32_t header_size;
31-
std::uint32_t header_crc32;
32-
std::uint32_t reserved;
33-
std::uint64_t current_lba;
34-
std::uint64_t backup_lba;
35-
std::uint64_t first_usable_lba;
36-
std::uint64_t last_usable_lba;
37-
std::uint8_t disk_guid[16];
38-
std::uint64_t partition_entries_lba;
39-
std::uint32_t num_partition_entries;
40-
std::uint32_t partition_entry_size;
41-
std::uint32_t partition_entries_crc32;
28+
uint8_t signature[8];
29+
uint8_t revision[4];
30+
uint32_t header_size;
31+
uint32_t header_crc32;
32+
uint32_t reserved;
33+
uint64_t current_lba;
34+
uint64_t backup_lba;
35+
uint64_t first_usable_lba;
36+
uint64_t last_usable_lba;
37+
uint8_t disk_guid[16];
38+
uint64_t partition_entries_lba;
39+
uint32_t num_partition_entries;
40+
uint32_t partition_entry_size;
41+
uint32_t partition_entries_crc32;
4242
};
4343

4444
static_assert(sizeof(GptHeader) == 92);
4545

4646
struct __attribute__((packed)) GptPartitionEntry {
47-
std::uint8_t partition_type_guid[16];
48-
std::uint8_t unique_partition_guid[16];
49-
std::uint64_t first_lba;
50-
std::uint64_t last_lba;
51-
std::uint64_t attributes;
52-
std::uint16_t partition_name[36]; // UTF-16LE
47+
uint8_t partition_type_guid[16];
48+
uint8_t unique_partition_guid[16];
49+
uint64_t first_lba;
50+
uint64_t last_lba;
51+
uint64_t attributes;
52+
uint16_t partition_name[36]; // UTF-16LE
5353
};
5454

5555
static_assert(sizeof(GptPartitionEntry) == 128);
5656

5757
struct __attribute__((packed)) GptBeginning {
5858
MasterBootRecord protective_mbr;
5959
GptHeader header;
60-
std::uint8_t header_padding[kSectorSize - sizeof(GptHeader)];
60+
uint8_t header_padding[kSectorSize - sizeof(GptHeader)];
6161
GptPartitionEntry entries[GPT_NUM_PARTITIONS];
62-
std::uint8_t partition_alignment[3072];
62+
uint8_t partition_alignment[3072];
6363
};
6464

6565
static_assert(AlignToPowerOf2(sizeof(GptBeginning), PARTITION_SIZE_SHIFT) ==
@@ -68,7 +68,7 @@ static_assert(AlignToPowerOf2(sizeof(GptBeginning), PARTITION_SIZE_SHIFT) ==
6868
struct __attribute__((packed)) GptEnd {
6969
GptPartitionEntry entries[GPT_NUM_PARTITIONS];
7070
GptHeader footer;
71-
std::uint8_t footer_padding[kSectorSize - sizeof(GptHeader)];
71+
uint8_t footer_padding[kSectorSize - sizeof(GptHeader)];
7272
};
7373

7474
static_assert(sizeof(GptEnd) % kSectorSize == 0);

0 commit comments

Comments
 (0)