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

Unified Diff: cgpt/cmd_show.c

Issue 2799019: Modify the size of the attributes field to comply with msc limitations. (Closed) Base URL: ssh://git@chromiumos-git/vboot_reference.git
Patch Set: Fix the attribute field to allow compilation in the BIOS environment. Created 10 years, 6 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 | « cgpt/cmd_add.c ('k') | firmware/lib/cgptlib/cgptlib.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cgpt/cmd_show.c
diff --git a/cgpt/cmd_show.c b/cgpt/cmd_show.c
index 91461490cf617f8ad513aeb027d99951d7dabf39..6ab537dca5ff1c19c1b4fb150655f76ec6ba0fbb 100644
--- a/cgpt/cmd_show.c
+++ b/cgpt/cmd_show.c
@@ -132,12 +132,15 @@ void EntryDetails(GptEntry *entry, int index, int raw) {
GuidToStr(&entry->unique, unique);
printf(PARTITION_MORE, "UUID: ", unique);
if (!memcmp(&guid_chromeos_kernel, &entry->type, sizeof(Guid))) {
- int tries = (entry->attributes & CGPT_ATTRIBUTE_TRIES_MASK) >>
- CGPT_ATTRIBUTE_TRIES_OFFSET;
- int successful = (entry->attributes & CGPT_ATTRIBUTE_SUCCESSFUL_MASK) >>
- CGPT_ATTRIBUTE_SUCCESSFUL_OFFSET;
- int priority = (entry->attributes & CGPT_ATTRIBUTE_PRIORITY_MASK) >>
- CGPT_ATTRIBUTE_PRIORITY_OFFSET;
+ int tries = (entry->attrs.fields.gpt_att &
+ CGPT_ATTRIBUTE_TRIES_MASK) >>
+ CGPT_ATTRIBUTE_TRIES_OFFSET;
+ int successful = (entry->attrs.fields.gpt_att &
+ CGPT_ATTRIBUTE_SUCCESSFUL_MASK) >>
+ CGPT_ATTRIBUTE_SUCCESSFUL_OFFSET;
+ int priority = (entry->attrs.fields.gpt_att &
+ CGPT_ATTRIBUTE_PRIORITY_MASK) >>
+ CGPT_ATTRIBUTE_PRIORITY_OFFSET;
snprintf(contents, sizeof(contents),
"priority=%d tries=%d successful=%d",
priority, tries, successful);
@@ -155,7 +158,7 @@ void EntryDetails(GptEntry *entry, int index, int raw) {
printf(PARTITION_MORE, "Type: ", type);
GuidToStr(&entry->unique, unique);
printf(PARTITION_MORE, "UUID: ", unique);
- snprintf(contents, sizeof(contents), "[%" PRIx64 "]", entry->attributes);
+ snprintf(contents, sizeof(contents), "[%x]", entry->attrs.fields.gpt_att);
printf(PARTITION_MORE, "Attr: ", contents);
}
}
@@ -299,7 +302,7 @@ int cmd_show(int argc, char *argv[]) {
printf("%d\n", GetPriority(&drive.gpt, PRIMARY, index));
break;
case 'A':
- printf("0x%" PRIx64 "\n", entry->attributes);
+ printf("0x%x\n", entry->attrs.fields.gpt_att);
break;
}
} else {
« no previous file with comments | « cgpt/cmd_add.c ('k') | firmware/lib/cgptlib/cgptlib.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698