[PATCH 1/7] build: avoid a shadowing warning

Jim Meyering meyering at redhat.com
Thu Oct 1 10:03:07 UTC 2009


* libparted/fs/hfs/advfs_plus.c (hfsplus_get_empty_end): Rename local,
"link" to avoid shadowing the syscall.
* libparted/fs/hfs/advfs.c (hfs_get_empty_end): Likewise.
---
 libparted/fs/hfs/advfs.c      |   12 ++++++------
 libparted/fs/hfs/advfs_plus.c |   12 ++++++------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/libparted/fs/hfs/advfs.c b/libparted/fs/hfs/advfs.c
index b214fdc..bf4595f 100644
--- a/libparted/fs/hfs/advfs.c
+++ b/libparted/fs/hfs/advfs.c
@@ -268,19 +268,19 @@ hfs_get_empty_end (const PedFileSystem *fs)
 	HfsPrivateFSData* 	priv_data = (HfsPrivateFSData*)
 						fs->type_specific;
 	HfsMasterDirectoryBlock* mdb = priv_data->mdb;
-	HfsPrivateLinkExtent*	link;
 	unsigned int		block, last_bad, end_free_blocks;

 	/* find the next block to the last bad block of the volume */
 	if (!hfs_read_bad_blocks (fs))
 		return 0;

+	HfsPrivateLinkExtent*	l;
 	last_bad = 0;
-	for (link = priv_data->bad_blocks_xtent_list; link; link = link->next) {
-		if ((unsigned int) PED_BE16_TO_CPU (link->extent.start_block)
-		    + PED_BE16_TO_CPU (link->extent.block_count) > last_bad)
-			last_bad = PED_BE16_TO_CPU (link->extent.start_block)
-			           + PED_BE16_TO_CPU (link->extent.block_count);
+	for (l = priv_data->bad_blocks_xtent_list; l; l = l->next) {
+		if ((unsigned int) PED_BE16_TO_CPU (l->extent.start_block)
+		    + PED_BE16_TO_CPU (l->extent.block_count) > last_bad)
+			last_bad = PED_BE16_TO_CPU (l->extent.start_block)
+			           + PED_BE16_TO_CPU (l->extent.block_count);
 	}

 	/* Count the free blocks from last_bad to the end of the volume */
diff --git a/libparted/fs/hfs/advfs_plus.c b/libparted/fs/hfs/advfs_plus.c
index 94bfe3b..8543904 100644
--- a/libparted/fs/hfs/advfs_plus.c
+++ b/libparted/fs/hfs/advfs_plus.c
@@ -275,7 +275,6 @@ hfsplus_get_empty_end (const PedFileSystem *fs)
 	HfsPPrivateFSData* 	priv_data = (HfsPPrivateFSData*)
 						    fs->type_specific;
 	HfsPVolumeHeader* 	vh = priv_data->vh;
-	HfsPPrivateLinkExtent*	link;
 	unsigned int		block, last_bad, end_free_blocks;

 	/* find the next block to the last bad block of the volume */
@@ -287,12 +286,13 @@ hfsplus_get_empty_end (const PedFileSystem *fs)
 		return 0;
 	}

+	HfsPPrivateLinkExtent*	l;
 	last_bad = 0;
-	for (link = priv_data->bad_blocks_xtent_list; link; link = link->next) {
-		if ((unsigned int) PED_BE32_TO_CPU (link->extent.start_block)
-		    + PED_BE32_TO_CPU (link->extent.block_count) > last_bad)
-			last_bad = PED_BE32_TO_CPU (link->extent.start_block)
-			           + PED_BE32_TO_CPU (link->extent.block_count);
+	for (l = priv_data->bad_blocks_xtent_list; l; l = l->next) {
+		if ((unsigned int) PED_BE32_TO_CPU (l->extent.start_block)
+		    + PED_BE32_TO_CPU (l->extent.block_count) > last_bad)
+			last_bad = PED_BE32_TO_CPU (l->extent.start_block)
+			           + PED_BE32_TO_CPU (l->extent.block_count);
 	}

 	/* Count the free blocks from last_bad to the end of the volume */
--
1.6.5.rc2.177.ga9dd6




More information about the parted-devel mailing list