util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] fdisk: API: comment labels array
@ 2012-07-24 12:40 Davidlohr Bueso
  2012-07-24 12:49 ` Karel Zak
  2012-07-26  9:13 ` Karel Zak
  0 siblings, 2 replies; 5+ messages in thread
From: Davidlohr Bueso @ 2012-07-24 12:40 UTC (permalink / raw)
  To: Karel Zak, Petr Uzel; +Cc: util-linux

From: Davidlohr Bueso <dave@gnu.org>

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
---
 fdisks/utils.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/fdisks/utils.c b/fdisks/utils.c
index 8de64c2..c4ffe04 100644
--- a/fdisks/utils.c
+++ b/fdisks/utils.c
@@ -35,7 +35,9 @@
 int fdisk_debug_mask;
 
 /*
- * label probing functions
+ * Label probing functions.
+ * Must have the same order as fdisk_labeltype as the index
+ * depends on it.
  */
 static const struct fdisk_label *labels[] =
 {
-- 
1.7.4.1




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] fdisk: API: comment labels array
  2012-07-24 12:40 [PATCH 2/2] fdisk: API: comment labels array Davidlohr Bueso
@ 2012-07-24 12:49 ` Karel Zak
  2012-07-24 12:57   ` Davidlohr Bueso
  2012-07-26  9:13 ` Karel Zak
  1 sibling, 1 reply; 5+ messages in thread
From: Karel Zak @ 2012-07-24 12:49 UTC (permalink / raw)
  To: Davidlohr Bueso; +Cc: Petr Uzel, util-linux

On Tue, Jul 24, 2012 at 02:40:30PM +0200, Davidlohr Bueso wrote:
> From: Davidlohr Bueso <dave@gnu.org>
> 
> Signed-off-by: Davidlohr Bueso <dave@gnu.org>
> ---
>  fdisks/utils.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/fdisks/utils.c b/fdisks/utils.c
> index 8de64c2..c4ffe04 100644
> --- a/fdisks/utils.c
> +++ b/fdisks/utils.c
> @@ -35,7 +35,9 @@
>  int fdisk_debug_mask;
>  
>  /*
> - * label probing functions
> + * Label probing functions.
> + * Must have the same order as fdisk_labeltype as the index
> + * depends on it.

This (rely on comment) is bad way.

>   */
>  static const struct fdisk_label *labels[] =
>  {

Use:

 static const struct fdisk_label[] =
 {
    [XXX_LABEL] = &xxx_label,
    [YYY_LABEL] = &yyy_label
 }

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] fdisk: API: comment labels array
  2012-07-24 12:49 ` Karel Zak
@ 2012-07-24 12:57   ` Davidlohr Bueso
  2012-07-24 14:18     ` Karel Zak
  0 siblings, 1 reply; 5+ messages in thread
From: Davidlohr Bueso @ 2012-07-24 12:57 UTC (permalink / raw)
  To: Karel Zak; +Cc: Petr Uzel, util-linux

On Tue, 2012-07-24 at 14:49 +0200, Karel Zak wrote:
> On Tue, Jul 24, 2012 at 02:40:30PM +0200, Davidlohr Bueso wrote:
> > From: Davidlohr Bueso <dave@gnu.org>
> > 
> > Signed-off-by: Davidlohr Bueso <dave@gnu.org>
> > ---
> >  fdisks/utils.c |    4 +++-
> >  1 files changed, 3 insertions(+), 1 deletions(-)
> > 
> > diff --git a/fdisks/utils.c b/fdisks/utils.c
> > index 8de64c2..c4ffe04 100644
> > --- a/fdisks/utils.c
> > +++ b/fdisks/utils.c
> > @@ -35,7 +35,9 @@
> >  int fdisk_debug_mask;
> >  
> >  /*
> > - * label probing functions
> > + * Label probing functions.
> > + * Must have the same order as fdisk_labeltype as the index
> > + * depends on it.
> 
> This (rely on comment) is bad way.
> 
> >   */
> >  static const struct fdisk_label *labels[] =
> >  {
> 
> Use:
> 
>  static const struct fdisk_label[] =
>  {
>     [XXX_LABEL] = &xxx_label,
>     [YYY_LABEL] = &yyy_label
>  }
> 

Yes, this is how we normally do it, but since we have an offset of 1 to
the index, it looks weired. I guess we need to straighten out
fdisk_labeltype and fix the menu along with it.

>     Karel
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] fdisk: API: comment labels array
  2012-07-24 12:57   ` Davidlohr Bueso
@ 2012-07-24 14:18     ` Karel Zak
  0 siblings, 0 replies; 5+ messages in thread
From: Karel Zak @ 2012-07-24 14:18 UTC (permalink / raw)
  To: Davidlohr Bueso; +Cc: Petr Uzel, util-linux

On Tue, Jul 24, 2012 at 02:57:17PM +0200, Davidlohr Bueso wrote:
> On Tue, 2012-07-24 at 14:49 +0200, Karel Zak wrote:
> > On Tue, Jul 24, 2012 at 02:40:30PM +0200, Davidlohr Bueso wrote:
> > > From: Davidlohr Bueso <dave@gnu.org>
> > > 
> > > Signed-off-by: Davidlohr Bueso <dave@gnu.org>
> > > ---
> > >  fdisks/utils.c |    4 +++-
> > >  1 files changed, 3 insertions(+), 1 deletions(-)
> > > 
> > > diff --git a/fdisks/utils.c b/fdisks/utils.c
> > > index 8de64c2..c4ffe04 100644
> > > --- a/fdisks/utils.c
> > > +++ b/fdisks/utils.c
> > > @@ -35,7 +35,9 @@
> > >  int fdisk_debug_mask;
> > >  
> > >  /*
> > > - * label probing functions
> > > + * Label probing functions.
> > > + * Must have the same order as fdisk_labeltype as the index
> > > + * depends on it.
> > 
> > This (rely on comment) is bad way.
> > 
> > >   */
> > >  static const struct fdisk_label *labels[] =
> > >  {
> > 
> > Use:
> > 
> >  static const struct fdisk_label[] =
> >  {
> >     [XXX_LABEL] = &xxx_label,
> >     [YYY_LABEL] = &yyy_label
> >  }
> > 
> 
> Yes, this is how we normally do it, but since we have an offset of 1 to

 Ah yes, I see menu... I'll apply the patch tomorrow.

> the index, it looks weired. I guess we need to straighten out
> fdisk_labeltype and fix the menu along with it.

 It would be nice to be without the IDs at all. The API should not be
 affected by any program specific menu or so...

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] fdisk: API: comment labels array
  2012-07-24 12:40 [PATCH 2/2] fdisk: API: comment labels array Davidlohr Bueso
  2012-07-24 12:49 ` Karel Zak
@ 2012-07-26  9:13 ` Karel Zak
  1 sibling, 0 replies; 5+ messages in thread
From: Karel Zak @ 2012-07-26  9:13 UTC (permalink / raw)
  To: Davidlohr Bueso; +Cc: Petr Uzel, util-linux

On Tue, Jul 24, 2012 at 02:40:30PM +0200, Davidlohr Bueso wrote:
>  fdisks/utils.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)

 Applied, thanks.

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-07-26  9:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-24 12:40 [PATCH 2/2] fdisk: API: comment labels array Davidlohr Bueso
2012-07-24 12:49 ` Karel Zak
2012-07-24 12:57   ` Davidlohr Bueso
2012-07-24 14:18     ` Karel Zak
2012-07-26  9:13 ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).