fdisk: API: comment labels array
PATCH 2/2 fdisk: API: comment labels array
From: Davidlohr Bueso <[email protected]>
--- fdisks/utils.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
fdisks/utils.c +3 -1
@@ -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[] = {
Signature · 1 line
1.7.4.1
Karel Zak
maintainerQuoted 12 lines · Davidlohr Bueso
From: Davidlohr Bueso <[email protected]>
Signed-off-by Davidlohr Bueso <[email protected]>--- fdisks/utils.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)fdisks/utils.c +0
-0
fdisks/utils.c line 40
Quoted 7 lines
fdisks/utils.c +3
-1@@ -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.
fdisks/utils.c line 43
Quoted 3 lines
fdisks/utils.c +0
-0*/ static const struct fdisk_label *labels[] = {
Use:
static const struct fdisk_label[] =
{
[XXX_LABEL] = &xxx_label,
[YYY_LABEL] = &yyy_label
}
Karel
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com
Quoted 27 lines · Karel Zak
Quoted 12 lines · Davidlohr Bueso
From: Davidlohr Bueso <[email protected]>
Signed-off-by Davidlohr Bueso <[email protected]>--- fdisks/utils.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)fdisks/utils.c +0
-0fdisks/utils.c line 40
Quoted 7 lines
fdisks/utils.c +3
-1@@ -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.
fdisks/utils.c line 43
Quoted 3 lines
fdisks/utils.c +0
-0*/ static const struct fdisk_label *labels[] = {
Quoted 8 lines
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.
Quoted 2 lines
Karel
Karel Zak
maintainerQuoted 30 lines · Davidlohr Bueso
Quoted 29 lines · Karel Zak
Quoted 12 lines · Davidlohr Bueso
From: Davidlohr Bueso <[email protected]>
Signed-off-by Davidlohr Bueso <[email protected]>--- fdisks/utils.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)fdisks/utils.c +0
-0fdisks/utils.c line 40
Quoted 7 lines
fdisks/utils.c +3
-1@@ -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.
fdisks/utils.c line 43
Quoted 3 lines
fdisks/utils.c +0
-0*/ static const struct fdisk_label *labels[] = {Use:
Quoted 8 lines
Quoted 6 lines
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.
Quoted 2 lines
the index, it looks weired. I guess we need to straighten out
fdisk_labeltypeand 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
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com
Quoted 2 lines · Davidlohr Bueso
fdisks/utils.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
Applied, thanks.
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com