Adds #define for patch and adjusts version numbers and strings to use semantic versions (x.y.z) per semver.org.
Signed-off-by: Mike Leach mike.leach@linaro.org --- decoder/include/c_api/opencsd_c_api.h | 2 +- decoder/include/ocsd_if_types.h | 11 ++++++++++- decoder/source/c_api/ocsd_c_api.cpp | 2 +- decoder/source/ocsd_version.cpp | 7 ++----- 4 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/decoder/include/c_api/opencsd_c_api.h b/decoder/include/c_api/opencsd_c_api.h index c40c20f..a6daef9 100644 --- a/decoder/include/c_api/opencsd_c_api.h +++ b/decoder/include/c_api/opencsd_c_api.h @@ -83,7 +83,7 @@ /** @name Library Version API
@{*/ -/** Get Library version. Return a 32 bit version in form MMMMnnnn - MMMM = major verison, nnnn = minor version */ +/** Get Library version. Return a 32 bit version in form MMMMnnpp - MMMM = major verison, nn = minor version, pp = patch version */ OCSD_C_API uint32_t ocsd_get_version(void);
/** Get library version string */ diff --git a/decoder/include/ocsd_if_types.h b/decoder/include/ocsd_if_types.h index f581499..487d3cb 100644 --- a/decoder/include/ocsd_if_types.h +++ b/decoder/include/ocsd_if_types.h @@ -50,7 +50,16 @@ @{*/ #define OCSD_VER_MAJOR 0x0 /**< Library Major Version */ #define OCSD_VER_MINOR 0x4 /**< Library Minor Version */ -#define OCSD_VER_STRING "0.004" /**< Library Version string */ +#define OCSD_VER_PATCH 0x0 /**< Library Patch Version */ + +/** Library version number - MMMMnnpp format. + MMMM = major version, + nn = minor version, + pp = patch version +*/ +#define OCSD_VER_NUM (((uint32_t)OCSD_VER_MAJOR << 16) | ((uint32_t)OCSD_VER_MINOR << 8) | ((uint32_t)OCSD_VER_PATCH)) + +#define OCSD_VER_STRING "0.4.0" /**< Library Version string */ #define OCSD_LIB_NAME "OpenCSD Library" /**< Library name string */ #define OCSD_LIB_SHORT_NAME "OCSD" /**< Library Short name string */ /** @}*/ diff --git a/decoder/source/c_api/ocsd_c_api.cpp b/decoder/source/c_api/ocsd_c_api.cpp index dcea304..591e9d4 100644 --- a/decoder/source/c_api/ocsd_c_api.cpp +++ b/decoder/source/c_api/ocsd_c_api.cpp @@ -73,7 +73,7 @@ static std::map<dcd_tree_handle_t, lib_dt_data_list *> s_data_map; /* C API functions */ /*******************************************************************************/
-/** Get Library version. Return a 32 bit version in form MMMMnnnn - MMMM = major verison, nnnn = minor version */ +/** Get Library version. Return a 32 bit version in form MMMMnnpp - MMMM = major verison, nn = minor version, pp = patch version */ OCSD_C_API uint32_t ocsd_get_version(void) { return ocsdVersion::vers_num(); diff --git a/decoder/source/ocsd_version.cpp b/decoder/source/ocsd_version.cpp index 2d12c4f..15a9912 100644 --- a/decoder/source/ocsd_version.cpp +++ b/decoder/source/ocsd_version.cpp @@ -37,15 +37,12 @@
const uint32_t ocsdVersion::vers_num() { - return ((uint32_t)OCSD_VER_MAJOR << 16) | (uint32_t)OCSD_VER_MINOR; + return OCSD_VER_NUM; }
const char *ocsdVersion::vers_str() { - return OCSD_VER_STRING; + return OCSD_VER_STRING; }
- - - /* End of File ocsd_version.cpp */