diff mbox

[3/4] api: cpumask: replace ssize_t with int32_t

Message ID 1424869109-930-3-git-send-email-petri.savolainen@linaro.org
State Accepted
Commit 8bd49f9d1ba997044ce7ad046db4295becc7f6c7
Headers show

Commit Message

Petri Savolainen Feb. 25, 2015, 12:58 p.m. UTC
ssize_t is a POSIX type. API definition must be pure C (C99).
Signed 32 bits can hold larger values than size_t (64k) and
ssize_t(32k) in minimum.

Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>
---
 include/odp/api/cpumask.h            | 3 +--
 platform/linux-generic/odp_cpumask.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/include/odp/api/cpumask.h b/include/odp/api/cpumask.h
index 21dfb1b..dbac7b9 100644
--- a/include/odp/api/cpumask.h
+++ b/include/odp/api/cpumask.h
@@ -18,7 +18,6 @@ 
 extern "C" {
 #endif
 
-#include <sys/types.h>
 #include <odp/config.h>
 
 /** @addtogroup odp_scheduler
@@ -50,7 +49,7 @@  void odp_cpumask_from_str(odp_cpumask_t *mask, const char *str);
  * @return number of characters written (including terminating null char)
  * @retval <0 on failure (buffer too small)
  */
-ssize_t odp_cpumask_to_str(const odp_cpumask_t *mask, char *str, ssize_t size);
+int32_t odp_cpumask_to_str(const odp_cpumask_t *mask, char *str, int32_t size);
 
 /**
  * Clear entire CPU mask
diff --git a/platform/linux-generic/odp_cpumask.c b/platform/linux-generic/odp_cpumask.c
index 7abf593..0ca1071 100644
--- a/platform/linux-generic/odp_cpumask.c
+++ b/platform/linux-generic/odp_cpumask.c
@@ -8,7 +8,6 @@ 
 #define _GNU_SOURCE
 #endif
 #include <sched.h>
-#include <sys/types.h>
 
 #include <odp/cpumask.h>
 #include <odp_debug_internal.h>
@@ -61,7 +60,7 @@  void odp_cpumask_from_str(odp_cpumask_t *mask, const char *str_in)
 	memcpy(&mask->set, &cpuset, sizeof(cpuset));
 }
 
-ssize_t odp_cpumask_to_str(const odp_cpumask_t *mask, char *str, ssize_t len)
+int32_t odp_cpumask_to_str(const odp_cpumask_t *mask, char *str, int32_t len)
 {
 	char *p = str;
 	int cpu = odp_cpumask_last(mask);