diff mbox series

[API-NEXT,v8,1/4] api: std_types: add odp_percent_t data type

Message ID 1511186413-3157-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v8,1/4] api: std_types: add odp_percent_t data type | expand

Commit Message

Github ODP bot Nov. 20, 2017, 2 p.m. UTC
From: Balasubramanian Manoharan <bala.manoharan@linaro.org>


odp_percent_t is used to express values which are percentages

Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>

---
/** Email created from pull request 277 (bala-manoharan:RED)
 ** https://github.com/Linaro/odp/pull/277
 ** Patch: https://github.com/Linaro/odp/pull/277.patch
 ** Base sha: d4b364849c4abb4c71e0c5260e1a793ebb8dc97d
 ** Merge commit sha: 806896e052ccb172565d49630ce6033f4e6ec9cd
 **/
 include/odp/api/spec/std_types.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/include/odp/api/spec/std_types.h b/include/odp/api/spec/std_types.h
index ec6a6df6d..9b4f894de 100644
--- a/include/odp/api/spec/std_types.h
+++ b/include/odp/api/spec/std_types.h
@@ -15,6 +15,8 @@ 
 #ifndef ODP_API_STD_TYPES_H_
 #define ODP_API_STD_TYPES_H_
 #include <odp/visibility_begin.h>
+/* uint64_t, uint32_t, etc */
+#include <stdint.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -31,6 +33,14 @@  extern "C" {
  * between e.g. different compilers.
  */
 
+/**
+ * Percentage type
+ * Use odp_percent_t for specifying fields that are percentages. It is a fixed
+ * point integer whose units are expressed as one-hundredth of a percent.
+ * Hence 100% is represented as integer value 10000.
+ */
+typedef uint32_t odp_percent_t;
+
 /**
  * @}
  */