libintelprov/gpt/lib/cgpt_common.c
/* Two headers are NOT bitwise identical. For example, my_lba pointers to header
 * itself so that my_lba in primary and secondary is definitely different.
 * Only the following fields should be identical.
 *
 *   first_usable_lba
 *   last_usable_lba
 *   number_of_entries
 *   size_of_entry
 *   disk_uuid
 *
 * If any of above field are not matched, overwrite secondary with primary since
 * we always trust primary.
 * If any one of header is invalid, copy from another. */
Two headers are NOT bitwise identical. For example, my_lba pointers to header
itself so that my_lba in primary and secondary is definitely different.
Only the following fields should be identical.



If any of above field are not matched, overwrite secondary with primary since
we always trust primary.
If any one of header is invalid, copy from another.
Two headers are NOT bitwise identical . For example my_lba pointers to header itself so that my_lba in primary and secondary is definitely different . Only the following fields should be identical . If any of above field are not matched overwrite secondary with primary since we always trust primary . If any one of header is invalid copy from another .
int IsSynonymous(const GptHeader* a, const GptHeader* b) {
  if ((a->first_usable_lba == b->first_usable_lba) &&
      (a->last_usable_lba == b->last_usable_lba) &&
      (a->number_of_entries == b->number_of_entries) &&
      (a->size_of_entry == b->size_of_entry) &&
      (!memcmp(&a->disk_uuid, &b->disk_uuid, sizeof(Guid))))
    return 1;
  return 0;
}
int IsSynonymous ( const GptHeader * a , const GptHeader * b ) { if ( ( a -> first_usable_lba == b -> first_usable_lba ) && ( a -> last_usable_lba == b -> last_usable_lba ) && ( a -> number_of_entries == b -> number_of_entries ) && ( a -> size_of_entry == b -> size_of_entry ) && ( ! memcmp ( & a -> disk_uuid , & b -> disk_uuid , sizeof ( Guid ) ) ) ) return 1 ; return 0 ; }
Two headers are NOT bitwise identical.
Two headers are NOT bitwise identical .