From 943715c464532918ee5aae0d0431271099ce006f Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Thu, 12 Dec 2019 12:33:47 -0800 Subject: [PATCH] [spinel] define spinel_prop_key_t and spinel_status_t as uint32_t (#4402) This commit defines `spinel_prop_key_t` and `spinel_status_t` as `uint32_t` instead of `enum` value. This allows these types to take values not included in `enum` (e.g., vendor or experimental values) and addresses "out-of-range enumeration value" compiler warnings. --- src/ncp/spinel.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ncp/spinel.h b/src/ncp/spinel.h index 62c4fc9f9..2c5bae3ef 100644 --- a/src/ncp/spinel.h +++ b/src/ncp/spinel.h @@ -374,7 +374,7 @@ extern "C" { #endif -typedef enum +enum { SPINEL_STATUS_OK = 0, ///< Operation has completed successfully. SPINEL_STATUS_FAILURE = 1, ///< Operation has failed for some undefined reason. @@ -469,7 +469,9 @@ typedef enum SPINEL_STATUS_EXPERIMENTAL__BEGIN = 2000000, SPINEL_STATUS_EXPERIMENTAL__END = 2097152, -} spinel_status_t; +}; + +typedef uint32_t spinel_status_t; typedef enum { @@ -1106,7 +1108,7 @@ enum * Experimental | 2,000,000 - 2,097,151 | Experimental use only * */ -typedef enum +enum { /// Last Operation Status /** Format: `i` - Read-only @@ -3898,7 +3900,9 @@ typedef enum SPINEL_PROP_EXPERIMENTAL__BEGIN = 2000000, SPINEL_PROP_EXPERIMENTAL__END = 2097152, -} spinel_prop_key_t; +}; + +typedef uint32_t spinel_prop_key_t; // ----------------------------------------------------------------------------