* [Patch] MdePkg Base.h: Update field name in VERIFY_UINTXX_ENUM_SIZE to follow style
@ 2016-11-11 3:32 Liming Gao
2016-11-11 20:47 ` Kinney, Michael D
2016-11-14 2:24 ` [PATCH v2] " Liming Gao
0 siblings, 2 replies; 3+ messages in thread
From: Liming Gao @ 2016-11-11 3:32 UTC (permalink / raw)
To: edk2-devel; +Cc: Michael Kinney
For field name in structure, its first character should be upper case.
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
MdePkg/Include/Base.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
index 5e24b5d..749c275 100644
--- a/MdePkg/Include/Base.h
+++ b/MdePkg/Include/Base.h
@@ -64,15 +64,15 @@ VERIFY_SIZE_OF (CHAR8, 1);
VERIFY_SIZE_OF (CHAR16, 2);
typedef enum {
- __VerifyUint8EnumValue = 0xff
+ VerifyUint8EnumValue = 0xff
} __VERIFY_UINT8_ENUM_SIZE;
typedef enum {
- __VerifyUint16EnumValue = 0xffff
+ VerifyUint16EnumValue = 0xffff
} __VERIFY_UINT16_ENUM_SIZE;
typedef enum {
- __VerifyUint32EnumValue = 0xffffffff
+ VerifyUint32EnumValue = 0xffffffff
} __VERIFY_UINT32_ENUM_SIZE;
VERIFY_SIZE_OF (__VERIFY_UINT8_ENUM_SIZE, 4);
--
2.8.0.windows.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Patch] MdePkg Base.h: Update field name in VERIFY_UINTXX_ENUM_SIZE to follow style
2016-11-11 3:32 [Patch] MdePkg Base.h: Update field name in VERIFY_UINTXX_ENUM_SIZE to follow style Liming Gao
@ 2016-11-11 20:47 ` Kinney, Michael D
2016-11-14 2:24 ` [PATCH v2] " Liming Gao
1 sibling, 0 replies; 3+ messages in thread
From: Kinney, Michael D @ 2016-11-11 20:47 UTC (permalink / raw)
To: Gao, Liming, edk2-devel@lists.01.org, Kinney, Michael D
Liming,
I agree enums should start with [A-Z].
These enums are only use to verify compiler config is right
and I wanted to make sure the enum names did not conflict
with any other names that might be used. This is why
I added '__' to the beginning of these enum names. These
enums would never be used my any code after the verify
operation in the same .h file.
I don't expect name collisions without the '__', so I am
ok with this patch.
But, we could also consider adding a comment that the '__'
is on purpose.
Mike
> -----Original Message-----
> From: Gao, Liming
> Sent: Thursday, November 10, 2016 7:33 PM
> To: edk2-devel@lists.01.org
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>
> Subject: [Patch] MdePkg Base.h: Update field name in VERIFY_UINTXX_ENUM_SIZE to
> follow style
>
> For field name in structure, its first character should be upper case.
>
> Cc: Michael Kinney <michael.d.kinney@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Liming Gao <liming.gao@intel.com>
> ---
> MdePkg/Include/Base.h | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
> index 5e24b5d..749c275 100644
> --- a/MdePkg/Include/Base.h
> +++ b/MdePkg/Include/Base.h
> @@ -64,15 +64,15 @@ VERIFY_SIZE_OF (CHAR8, 1);
> VERIFY_SIZE_OF (CHAR16, 2);
>
> typedef enum {
> - __VerifyUint8EnumValue = 0xff
> + VerifyUint8EnumValue = 0xff
> } __VERIFY_UINT8_ENUM_SIZE;
>
> typedef enum {
> - __VerifyUint16EnumValue = 0xffff
> + VerifyUint16EnumValue = 0xffff
> } __VERIFY_UINT16_ENUM_SIZE;
>
> typedef enum {
> - __VerifyUint32EnumValue = 0xffffffff
> + VerifyUint32EnumValue = 0xffffffff
> } __VERIFY_UINT32_ENUM_SIZE;
>
> VERIFY_SIZE_OF (__VERIFY_UINT8_ENUM_SIZE, 4);
> --
> 2.8.0.windows.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2] MdePkg Base.h: Update field name in VERIFY_UINTXX_ENUM_SIZE to follow style
2016-11-11 3:32 [Patch] MdePkg Base.h: Update field name in VERIFY_UINTXX_ENUM_SIZE to follow style Liming Gao
2016-11-11 20:47 ` Kinney, Michael D
@ 2016-11-14 2:24 ` Liming Gao
1 sibling, 0 replies; 3+ messages in thread
From: Liming Gao @ 2016-11-14 2:24 UTC (permalink / raw)
To: edk2-devel; +Cc: Michael Kinney
In V2, add comments on why uses __ prefix in enum type name.
For field name in structure, its first character should be upper case.
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
MdePkg/Include/Base.h | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
index 5e24b5d..ce6cb07 100644
--- a/MdePkg/Include/Base.h
+++ b/MdePkg/Include/Base.h
@@ -63,16 +63,21 @@ VERIFY_SIZE_OF (UINT64, 8);
VERIFY_SIZE_OF (CHAR8, 1);
VERIFY_SIZE_OF (CHAR16, 2);
+//
+// Those three enum types are only used to verify compiler config is right.
+// They are not used by any source code. So, __ prefix is added for them to
+// avoid their name conflict with other types.
+//
typedef enum {
- __VerifyUint8EnumValue = 0xff
+ VerifyUint8EnumValue = 0xff
} __VERIFY_UINT8_ENUM_SIZE;
typedef enum {
- __VerifyUint16EnumValue = 0xffff
+ VerifyUint16EnumValue = 0xffff
} __VERIFY_UINT16_ENUM_SIZE;
typedef enum {
- __VerifyUint32EnumValue = 0xffffffff
+ VerifyUint32EnumValue = 0xffffffff
} __VERIFY_UINT32_ENUM_SIZE;
VERIFY_SIZE_OF (__VERIFY_UINT8_ENUM_SIZE, 4);
--
2.8.0.windows.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-11-14 2:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-11 3:32 [Patch] MdePkg Base.h: Update field name in VERIFY_UINTXX_ENUM_SIZE to follow style Liming Gao
2016-11-11 20:47 ` Kinney, Michael D
2016-11-14 2:24 ` [PATCH v2] " Liming Gao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox