diff mbox

[2/4] api: packet_io: replace ssize_t with int

Message ID 1424869109-930-2-git-send-email-petri.savolainen@linaro.org
State Accepted
Commit eabd0342d69c4b13c44bbc0bf70f077901c5d080
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).
Int is at least 16 bits and can hold any mac address size.

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

Patch

diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h
index 427457e..418b8e7 100644
--- a/include/odp/api/packet_io.h
+++ b/include/odp/api/packet_io.h
@@ -18,8 +18,6 @@ 
 extern "C" {
 #endif
 
-#include <sys/types.h>
-
 /** @defgroup odp_packet_io ODP PACKET IO
  *  Operations on a packet.
  *  @{
@@ -187,12 +185,12 @@  int odp_pktio_promisc_mode(odp_pktio_t pktio);
  *
  * @param	pktio     ODP packet IO handle
  * @param[out]	mac_addr  Output buffer (use ODP_PKTIO_MACADDR_MAXSIZE)
- * @param       size Size of output buffer
+ * @param       size      Size of output buffer
  *
  * @return Number of bytes written (actual size of MAC address)
  * @retval <0 on failure
  */
-ssize_t odp_pktio_mac_addr(odp_pktio_t pktio, void *mac_addr, ssize_t size);
+int odp_pktio_mac_addr(odp_pktio_t pktio, void *mac_addr, int size);
 
 /**
  * Setup per-port default class-of-service.
diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c
index a405bd7..21f0c17 100644
--- a/platform/linux-generic/odp_packet_io.c
+++ b/platform/linux-generic/odp_packet_io.c
@@ -817,7 +817,7 @@  int odp_pktio_promisc_mode(odp_pktio_t id)
 }
 
 
-ssize_t odp_pktio_mac_addr(odp_pktio_t id, void *mac_addr, ssize_t addr_size)
+int odp_pktio_mac_addr(odp_pktio_t id, void *mac_addr, int addr_size)
 {
 	pktio_entry_t *entry;
 
diff --git a/test/validation/odp_pktio.c b/test/validation/odp_pktio.c
index 3f9de3c..5577856 100644
--- a/test/validation/odp_pktio.c
+++ b/test/validation/odp_pktio.c
@@ -458,7 +458,7 @@  static void test_odp_pktio_promisc(void)
 static void test_odp_pktio_mac(void)
 {
 	unsigned char mac_addr[ODPH_ETHADDR_LEN];
-	ssize_t mac_len;
+	int mac_len;
 	int ret;
 	odp_pktio_t pktio = create_pktio(iface_name[0]);