eal: fix signed integers in fbarray
[dpdk.git] / lib / librte_eal / common / include / rte_fbarray.h
index 97df945..3e61fff 100644 (file)
@@ -44,9 +44,9 @@ extern "C" {
 
 struct rte_fbarray {
        char name[RTE_FBARRAY_NAME_LEN]; /**< name associated with an array */
-       int count;                       /**< number of entries stored */
-       int len;                         /**< current length of the array */
-       int elt_sz;                      /**< size of each element */
+       unsigned int count;              /**< number of entries stored */
+       unsigned int len;                /**< current length of the array */
+       unsigned int elt_sz;             /**< size of each element */
        void *data;                      /**< data pointer */
        rte_rwlock_t rwlock;             /**< multiprocess lock */
 };
@@ -76,8 +76,8 @@ struct rte_fbarray {
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
 int __rte_experimental
-rte_fbarray_init(struct rte_fbarray *arr, const char *name, int len,
-               int elt_sz);
+rte_fbarray_init(struct rte_fbarray *arr, const char *name, unsigned int len,
+               unsigned int elt_sz);
 
 
 /**
@@ -154,7 +154,7 @@ rte_fbarray_detach(struct rte_fbarray *arr);
  *  - NULL on failure, with ``rte_errno`` indicating reason for failure.
  */
 void * __rte_experimental
-rte_fbarray_get(const struct rte_fbarray *arr, int idx);
+rte_fbarray_get(const struct rte_fbarray *arr, unsigned int idx);
 
 
 /**
@@ -188,7 +188,7 @@ rte_fbarray_find_idx(const struct rte_fbarray *arr, const void *elt);
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
 int __rte_experimental
-rte_fbarray_set_used(struct rte_fbarray *arr, int idx);
+rte_fbarray_set_used(struct rte_fbarray *arr, unsigned int idx);
 
 
 /**
@@ -205,7 +205,7 @@ rte_fbarray_set_used(struct rte_fbarray *arr, int idx);
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
 int __rte_experimental
-rte_fbarray_set_free(struct rte_fbarray *arr, int idx);
+rte_fbarray_set_free(struct rte_fbarray *arr, unsigned int idx);
 
 
 /**
@@ -223,7 +223,7 @@ rte_fbarray_set_free(struct rte_fbarray *arr, int idx);
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
 int __rte_experimental
-rte_fbarray_is_used(struct rte_fbarray *arr, int idx);
+rte_fbarray_is_used(struct rte_fbarray *arr, unsigned int idx);
 
 
 /**
@@ -240,7 +240,7 @@ rte_fbarray_is_used(struct rte_fbarray *arr, int idx);
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
 int __rte_experimental
-rte_fbarray_find_next_free(struct rte_fbarray *arr, int start);
+rte_fbarray_find_next_free(struct rte_fbarray *arr, unsigned int start);
 
 
 /**
@@ -257,7 +257,7 @@ rte_fbarray_find_next_free(struct rte_fbarray *arr, int start);
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
 int __rte_experimental
-rte_fbarray_find_next_used(struct rte_fbarray *arr, int start);
+rte_fbarray_find_next_used(struct rte_fbarray *arr, unsigned int start);
 
 
 /**
@@ -277,7 +277,8 @@ rte_fbarray_find_next_used(struct rte_fbarray *arr, int start);
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
 int __rte_experimental
-rte_fbarray_find_next_n_free(struct rte_fbarray *arr, int start, int n);
+rte_fbarray_find_next_n_free(struct rte_fbarray *arr, unsigned int start,
+               unsigned int n);
 
 
 /**
@@ -297,7 +298,8 @@ rte_fbarray_find_next_n_free(struct rte_fbarray *arr, int start, int n);
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
 int __rte_experimental
-rte_fbarray_find_next_n_used(struct rte_fbarray *arr, int start, int n);
+rte_fbarray_find_next_n_used(struct rte_fbarray *arr, unsigned int start,
+               unsigned int n);
 
 
 /**
@@ -314,7 +316,8 @@ rte_fbarray_find_next_n_used(struct rte_fbarray *arr, int start, int n);
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
 int __rte_experimental
-rte_fbarray_find_contig_free(struct rte_fbarray *arr, int start);
+rte_fbarray_find_contig_free(struct rte_fbarray *arr,
+               unsigned int start);
 
 
 /**
@@ -331,7 +334,7 @@ rte_fbarray_find_contig_free(struct rte_fbarray *arr, int start);
  *  - -1 on failure, with ``rte_errno`` indicating reason for failure.
  */
 int __rte_experimental
-rte_fbarray_find_contig_used(struct rte_fbarray *arr, int start);
+rte_fbarray_find_contig_used(struct rte_fbarray *arr, unsigned int start);
 
 
 /**