aboutsummaryrefslogtreecommitdiffstats
path: root/lib/includes/hicn/util/types.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/includes/hicn/util/types.h')
-rw-r--r--lib/includes/hicn/util/types.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/includes/hicn/util/types.h b/lib/includes/hicn/util/types.h
index 017e85b72..50c5362d3 100644
--- a/lib/includes/hicn/util/types.h
+++ b/lib/includes/hicn/util/types.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2019 Cisco and/or its affiliates.
+ * Copyright (c) 2021 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
@@ -25,15 +25,19 @@ typedef uint32_t u32;
typedef uint64_t u64;
/* Helper for avoiding warnings about type-punning */
-#define UNION_CAST(x, destType) \
- (((union {__typeof__(x) a; destType b;})x).b)
+#define UNION_CAST(x, destType) \
+ (((union { \
+ __typeof__ (x) a; \
+ destType b; \
+ }) x) \
+ .b)
-//typedef unsigned int hash_t;
+// typedef unsigned int hash_t;
-typedef int (*cmp_t)(const void *, const void *);
+typedef int (*cmp_t) (const void *, const void *);
/* Enums */
-#define IS_VALID_ENUM_TYPE(NAME, x) ((x > NAME ## _UNDEFINED) && (x < NAME ## _N))
+#define IS_VALID_ENUM_TYPE(NAME, x) ((x > NAME##_UNDEFINED) && (x < NAME##_N))
#endif /* UTIL_TYPES */