From e8d10c4479fffeac91c11df2cf837d379674ea76 Mon Sep 17 00:00:00 2001 From: Julius Pfrommer Date: Tue, 6 Nov 2018 13:16:28 +0100 Subject: [PATCH] Stack: Add Boolean to the numeric data types; Improve documentation --- include/ua_types.h | 3 +++ src/ua_types.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/ua_types.h b/include/ua_types.h index a6ca461c7..f8cfccf1e 100644 --- a/include/ua_types.h +++ b/include/ua_types.h @@ -816,6 +816,9 @@ struct UA_DataType { UA_DataTypeMember *members; }; +/* Test if the data type is a numeric builtin data type. This includes Boolean, + * integers and floating point numbers. Not included are DateTime and + * StatusCode. */ UA_Boolean UA_DataType_isNumeric(const UA_DataType *type); diff --git a/src/ua_types.c b/src/ua_types.c index e7e02739d..5c4bbc6b0 100644 --- a/src/ua_types.c +++ b/src/ua_types.c @@ -1097,7 +1097,7 @@ UA_Array_delete(void *p, size_t size, const UA_DataType *type) { UA_Boolean UA_DataType_isNumeric(const UA_DataType *type) { /* All data types between UA_TYPES_SBYTE and UA_TYPES_DOUBLE are numeric */ - for(size_t i = UA_TYPES_SBYTE; i <= UA_TYPES_DOUBLE; ++i) + for(size_t i = UA_TYPES_BOOLEAN; i <= UA_TYPES_DOUBLE; ++i) if(&UA_TYPES[i] == type) return true; return false;