[parted-devel] [PATCH] Fix endianness bugs

Matthew S. Harris mharris312 at gmail.com
Wed Apr 25 02:23:59 UTC 2007


On 4/24/07, Otavio Salvador <otavio at debian.org> wrote:
> You can export it as file, using -o option. Then you can send them as
> attachment.

Uh, no, the -o option lets you tell git-format-patch what directory it
should put the mbox file in.

But it does seem that git-am simply reads mbox files as input, so I'll
just attach the mbox file to this message.  'git-am --interactive'
appears to be able to read it.

(If you couldn't tell, this is my first experience with git.)


Matthew
-------------- next part --------------
From 93fb3f3bfedb7e9212d28be072b14f50a74d56f3 Mon Sep 17 00:00:00 2001
From: Matthew Harris <mharris at coruscant.(none)>
Date: Tue, 24 Apr 2007 08:13:41 -0700
Subject: [PATCH] Fix endianness bugs
MIME-Version: 1.0
Content-Type: multipart/mixed;
 boundary="------------1.4.4.2"

This is a multi-part message in MIME format.
--------------1.4.4.2
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit

---
 libparted/labels/gpt.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)
--------------1.4.4.2
Content-Type: text/x-patch;
 name="93fb3f3bfedb7e9212d28be072b14f50a74d56f3.diff"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline;
 filename="93fb3f3bfedb7e9212d28be072b14f50a74d56f3.diff"

diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
index f03c8e5..86c31c7 100644
--- a/libparted/labels/gpt.c
+++ b/libparted/labels/gpt.c
@@ -639,8 +639,8 @@ _parse_header (PedDisk* disk, GuidPartitionTableHeader_t* gpt,
 	PED_ASSERT (_header_is_valid (disk->dev, gpt), return 0);
 
 #ifndef DISCOVER_ONLY
-	if (PED_CPU_TO_LE32 (gpt->Revision) > GPT_HEADER_REVISION_V1_02
-	    || PED_CPU_TO_LE32 (gpt->HeaderSize) != pth_get_size_static (
+	if (PED_LE32_TO_CPU (gpt->Revision) > GPT_HEADER_REVISION_V1_02
+	    || PED_LE32_TO_CPU (gpt->HeaderSize) != pth_get_size_static (
                                                         disk->dev)) {
 		if (ped_exception_throw (
 			PED_EXCEPTION_WARNING,
@@ -648,14 +648,14 @@ _parse_header (PedDisk* disk, GuidPartitionTableHeader_t* gpt,
 			_("The format of the GPT partition table is version "
 			  "%x, which is newer than what Parted can "
 			  "recognise.  Please tell us!  bug-parted at gnu.org"),
-			PED_CPU_TO_LE32 (gpt->Revision))
+			PED_LE32_TO_CPU (gpt->Revision))
 				!= PED_EXCEPTION_IGNORE)
 			return 0;
 	}
 #endif
 
-	first_usable = PED_CPU_TO_LE64 (gpt->FirstUsableLBA);
-	last_usable = PED_CPU_TO_LE64 (gpt->LastUsableLBA);
+	first_usable = PED_LE64_TO_CPU (gpt->FirstUsableLBA);
+	last_usable = PED_LE64_TO_CPU (gpt->LastUsableLBA);
 
 
 /*
@@ -670,8 +670,8 @@ _parse_header (PedDisk* disk, GuidPartitionTableHeader_t* gpt,
    
 	last_usable_if_grown 
 		= PED_CPU_TO_LE64 (disk->dev->length - 2 - 
-		((PedSector)(PED_CPU_TO_LE32(gpt->NumberOfPartitionEntries)) * 
-		(PedSector)(PED_CPU_TO_LE32(gpt->SizeOfPartitionEntry)) / 
+		((PedSector)(PED_LE32_TO_CPU(gpt->NumberOfPartitionEntries)) * 
+		(PedSector)(PED_LE32_TO_CPU(gpt->SizeOfPartitionEntry)) / 
 		disk->dev->sector_size));
 
 	last_usable_min_default = disk->dev->length - 2 - 
@@ -719,7 +719,7 @@ _parse_header (PedDisk* disk, GuidPartitionTableHeader_t* gpt,
 
 
 	gpt_disk_data->entry_count
-		= PED_CPU_TO_LE32 (gpt->NumberOfPartitionEntries);
+		= PED_LE32_TO_CPU (gpt->NumberOfPartitionEntries);
 	PED_ASSERT (gpt_disk_data->entry_count > 0, return 0);
 	PED_ASSERT (gpt_disk_data->entry_count <= 8192, return 0);
 

--------------1.4.4.2--



More information about the parted-devel mailing list