summaryrefslogtreecommitdiff
path: root/iflag.h
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2013-12-07 16:12:07 +0400
committerCyrill Gorcunov <gorcunov@gmail.com>2013-12-07 16:12:07 +0400
commit71f71c0dbe204d8d6a58e695c038bf0508d3b406 (patch)
tree65f3351f99a8a1e039a3cc3a3452c72ccddef78f /iflag.h
parent20df33d2a5f325cb2f89103b2fe0e98773cf5854 (diff)
downloadnasm-71f71c0dbe204d8d6a58e695c038bf0508d3b406.tar.gz
nasm-71f71c0dbe204d8d6a58e695c038bf0508d3b406.tar.bz2
nasm-71f71c0dbe204d8d6a58e695c038bf0508d3b406.zip
iflag: Introduce IFLAG_INIT helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'iflag.h')
-rw-r--r--iflag.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/iflag.h b/iflag.h
index 7bc31cc..66e340e 100644
--- a/iflag.h
+++ b/iflag.h
@@ -13,6 +13,8 @@ int ilog2_32(uint32_t v);
#define IF_GENBIT(bit) (UINT32_C(1) << (bit))
+#define IFLAG_INIT (iflag_t){ .field = { 0 }, }
+
static inline unsigned int iflag_test(const iflag_t *f, unsigned int bit)
{
unsigned int index = bit / 32;
@@ -143,9 +145,7 @@ static inline int iflag_cmp_cpu_level(const iflag_t *a, const iflag_t *b)
static inline iflag_t _iflag_pfmask(const iflag_t *a)
{
- iflag_t r;
-
- memset(&r, 0, sizeof(r));
+ iflag_t r = IFLAG_INIT;
if (iflag_test(a, IF_CYRIX))
iflag_set(&r, IF_CYRIX);