Colin Watson <[EMAIL PROTECTED]> wrote:
> Applying commit 8bd3645d7c184ac6a4076414b469ece15fbcccde to the current
> Ubuntu version of parted yields this warning (promoted to an error by
> -Werror):
>
>   ../../../../libparted/fs/fat/traverse.c: In function 
> ‘fat_dir_entry_get_name’:
>   ../../../../libparted/fs/fat/traverse.c:354: error: comparison between 
> signed and unsigned
>   ../../../../libparted/fs/fat/traverse.c:362: error: comparison between 
> signed and unsigned
>
> I suggest applying the following patch (against current HEAD):
>
> diff --git a/libparted/fs/fat/traverse.c b/libparted/fs/fat/traverse.c
> index d3f0d35..37789d5 100644
> --- a/libparted/fs/fat/traverse.c
> +++ b/libparted/fs/fat/traverse.c
> @@ -341,7 +341,7 @@ fat_dir_entry_has_first_cluster (FatDirEntry* dir_entry, 
> PedFileSystem* fs)
>  */
>  void
>  fat_dir_entry_get_name (const FatDirEntry *dir_entry, char *result) {
> -     int     i;
> +     size_t  i;
>       const char *src;
>       const char *ext;

Thanks!  I'd be happy to apply that.
Next time, please send patches as output from "git format-patch"
so I can simply apply it with "git am PATCH".  Then I'll be even happier ;-)
because I won't have to take the time to write the log entry and to
arrange to have your name on it.

BTW, the format of the log message is important, since the goal
is to generate GNU Coding Standards-compliant ChangeLog entries
from it, as I've begun doing in coreutils and idutils.
Here's what I'm about to push:

From 80aa1efe3451770372819231344e2c681aaae32a Mon Sep 17 00:00:00 2001
From: Colin Watson <[EMAIL PROTECTED]>
Date: Thu, 29 May 2008 22:27:13 +0200
Subject: [PATCH] Avoid "comparison between signed and unsigned" warning from 
gcc.

* libparted/fs/fat/traverse.c (fat_dir_entry_get_name): Change
type of index from int to size_t.
---
 libparted/fs/fat/traverse.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libparted/fs/fat/traverse.c b/libparted/fs/fat/traverse.c
index d3f0d35..be5efe9 100644
--- a/libparted/fs/fat/traverse.c
+++ b/libparted/fs/fat/traverse.c
@@ -341,7 +341,7 @@ fat_dir_entry_has_first_cluster (FatDirEntry* dir_entry, 
PedFileSystem* fs)
 */
 void
 fat_dir_entry_get_name (const FatDirEntry *dir_entry, char *result) {
-       int     i;
+       size_t i;
        const char *src;
        const char *ext;

--
1.5.6.rc0.30.g51263

_______________________________________________
parted-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/parted-devel

Reply via email to