Signed-off-by: Angus Salkeld <asalkeld(a)redhat.com>
---
include/qb/qbipc_common.h | 8 ++--
include/qb/qblist.h | 2 +-
include/qb/qbplugin.h | 6 ++--
include/qb/qbplugin_comp.h | 8 ++--
include/qb/qbpoll.h | 36 +++++++++++-----------
include/qb/qbqueue.h | 50 +++++++++++++++---------------
include/qb/qbtimer.h | 8 ++--
include/qb/qbwthread.h | 16 +++++-----
include/tlist.h | 8 ++--
lib/hash.c | 10 +++---
lib/ipc_int.h | 6 ++--
lib/plugin_loader.c | 54 ++++++++++++++++----------------
lib/poll.c | 74 ++++++++++++++++++++++----------------------
lib/ringbuffer_int.h | 2 +-
lib/timer.c | 28 ++++++++--------
lib/tsafe.c | 12 +++---
lib/util.c | 8 ++--
lib/wthread.c | 20 ++++++------
tests/bmc.c | 16 +++++-----
tests/bmcpt.c | 12 +++---
tests/bms.c | 42 ++++++++++++------------
tests/check_hash.c | 6 ++--
tests/check_plugin.c | 4 +-
tests/check_rb.c | 10 +++---
tests/libtest_a.c | 8 ++--
tests/libtest_b.c | 8 ++--
tests/rbreader.c | 4 +-
tests/rbwriter.c | 12 +++---
28 files changed, 239 insertions(+), 239 deletions(-)
diff --git a/include/qb/qbipc_common.h b/include/qb/qbipc_common.h
index 9ee3b80..3f299a6 100644
--- a/include/qb/qbipc_common.h
+++ b/include/qb/qbipc_common.h
@@ -24,13 +24,13 @@
#define QB_IPC_COMMON_H_DEFINED
typedef struct {
- int size __attribute__ ((aligned(8)));
- int id __attribute__ ((aligned(8)));
+ int32_t size __attribute__ ((aligned(8)));
+ int32_t id __attribute__ ((aligned(8)));
} qb_ipc_request_header_t __attribute__ ((aligned(8)));
typedef struct {
- int size __attribute__ ((aligned(8)));
- int id __attribute__ ((aligned(8)));
+ int32_t size __attribute__ ((aligned(8)));
+ int32_t id __attribute__ ((aligned(8)));
int32_t error __attribute__ ((aligned(8)));
} qb_ipc_response_header_t __attribute__ ((aligned(8)));
diff --git a/include/qb/qblist.h b/include/qb/qblist.h
index efb945e..e191385 100644
--- a/include/qb/qblist.h
+++ b/include/qb/qblist.h
@@ -147,7 +147,7 @@ static void inline qb_list_del(struct qb_list_head *_remove)
* @param head pointer to the list head
* @return boolean true/false
*/
-static inline int qb_list_empty(const struct qb_list_head *head)
+static inline int32_t qb_list_empty(const struct qb_list_head *head)
{
return head->next == head;
}
diff --git a/include/qb/qbplugin.h b/include/qb/qbplugin.h
index 11996e1..ed66c83 100644
--- a/include/qb/qbplugin.h
+++ b/include/qb/qbplugin.h
@@ -28,11 +28,11 @@ extern "C" {
#endif
/* *INDENT-ON* */
-int plugin_ifact_reference(qb_handle_t * handle,
+int32_t plugin_ifact_reference(qb_handle_t * handle,
const char *iface_name,
- int version, void **interface, void *context);
+ int32_t version, void **interface, void *context);
-int plugin_ifact_release(qb_handle_t handle);
+int32_t plugin_ifact_release(qb_handle_t handle);
/* *INDENT-OFF* */
diff --git a/include/qb/qbplugin_comp.h b/include/qb/qbplugin_comp.h
index 9e48475..99cfd47 100644
--- a/include/qb/qbplugin_comp.h
+++ b/include/qb/qbplugin_comp.h
@@ -31,12 +31,12 @@ extern "C" {
*/
struct plugin_iface {
const char *name; /* Name of the interface */
- int version; /* Version of this interface */
- int *versions_replace; /* Versions that this interface can replace */
- int versions_replace_count; /* Count of entries in version_replace */
+ int32_t version; /* Version of this interface */
+ int32_t *versions_replace; /* Versions that this interface can replace */
+ int32_t versions_replace_count; /* Count of entries in version_replace */
char **dependencies; /* Dependent interfaces */
size_t dependency_count; /* Count of entires in dependencies */
- int (*constructor) (void *context); /* Constructor for this interface */
+ int32_t (*constructor) (void *context); /* Constructor for this interface */
void (*destructor) (void *context); /* Constructor for this interface */
void **interfaces; /* List of functions in interface */
};
diff --git a/include/qb/qbpoll.h b/include/qb/qbpoll.h
index 6a6165c..8ce87c2 100644
--- a/include/qb/qbpoll.h
+++ b/include/qb/qbpoll.h
@@ -34,34 +34,34 @@ typedef void *qb_poll_timer_handle;
qb_handle_t qb_poll_create(void);
-int qb_poll_destroy(qb_handle_t hdb_handle);
+int32_t qb_poll_destroy(qb_handle_t hdb_handle);
-int qb_poll_dispatch_add(qb_handle_t handle,
- int fd,
- int events,
+int32_t qb_poll_dispatch_add(qb_handle_t handle,
+ int32_t fd,
+ int32_t events,
void *data,
- int (*dispatch_fn) (qb_handle_t handle,
- int fd, int revents, void *data));
+ int32_t (*dispatch_fn) (qb_handle_t handle,
+ int32_t fd, int32_t revents, void *data));
-int qb_poll_dispatch_modify(qb_handle_t handle,
- int fd,
- int events,
- int (*dispatch_fn) (qb_handle_t hdb_handle_t,
- int fd,
- int revents, void *data));
+int32_t qb_poll_dispatch_modify(qb_handle_t handle,
+ int32_t fd,
+ int32_t events,
+ int32_t (*dispatch_fn) (qb_handle_t hdb_handle_t,
+ int32_t fd,
+ int32_t revents, void *data));
-int qb_poll_dispatch_delete(qb_handle_t handle, int fd);
+int32_t qb_poll_dispatch_delete(qb_handle_t handle, int32_t fd);
-int qb_poll_timer_add(qb_handle_t handle,
- int msec_in_future, void *data,
+int32_t qb_poll_timer_add(qb_handle_t handle,
+ int32_t msec_in_future, void *data,
void (*timer_fn) (void *data),
qb_poll_timer_handle * timer_handle_out);
-int qb_poll_timer_delete(qb_handle_t handle, qb_poll_timer_handle timer_handle);
+int32_t qb_poll_timer_delete(qb_handle_t handle, qb_poll_timer_handle timer_handle);
-int qb_poll_run(qb_handle_t handle);
+int32_t qb_poll_run(qb_handle_t handle);
-int qb_poll_stop(qb_handle_t handle);
+int32_t qb_poll_stop(qb_handle_t handle);
/* *INDENT-OFF* */
#ifdef __cplusplus
diff --git a/include/qb/qbqueue.h b/include/qb/qbqueue.h
index f178194..0ddb9ff 100644
--- a/include/qb/qbqueue.h
+++ b/include/qb/qbqueue.h
@@ -32,19 +32,19 @@ extern "C" {
/* *INDENT-ON* */
struct qb_queue {
- int head;
- int tail;
- int used;
- int usedhw;
- int size;
+ int32_t head;
+ int32_t tail;
+ int32_t used;
+ int32_t usedhw;
+ int32_t size;
void *items;
- int size_per_item;
- int iterator;
+ int32_t size_per_item;
+ int32_t iterator;
pthread_mutex_t mutex;
};
-static inline int qb_queue_init(struct qb_queue *qb_queue, int qb_queue_items,
- int size_per_item)
+static inline int32_t qb_queue_init(struct qb_queue *qb_queue, int32_t qb_queue_items,
+ int32_t size_per_item)
{
qb_queue->head = 0;
qb_queue->tail = qb_queue_items - 1;
@@ -62,7 +62,7 @@ static inline int qb_queue_init(struct qb_queue *qb_queue, int
qb_queue_items,
return (0);
}
-static inline int qb_queue_reinit(struct qb_queue *qb_queue)
+static inline int32_t qb_queue_reinit(struct qb_queue *qb_queue)
{
pthread_mutex_lock(&qb_queue->mutex);
qb_queue->head = 0;
@@ -81,9 +81,9 @@ static inline void qb_queue_free(struct qb_queue *qb_queue)
free(qb_queue->items);
}
-static inline int qb_queue_is_full(struct qb_queue *qb_queue)
+static inline int32_t qb_queue_is_full(struct qb_queue *qb_queue)
{
- int full;
+ int32_t full;
pthread_mutex_lock(&qb_queue->mutex);
full = ((qb_queue->size - 1) == qb_queue->used);
@@ -91,9 +91,9 @@ static inline int qb_queue_is_full(struct qb_queue *qb_queue)
return (full);
}
-static inline int qb_queue_is_empty(struct qb_queue *qb_queue)
+static inline int32_t qb_queue_is_empty(struct qb_queue *qb_queue)
{
- int empty;
+ int32_t empty;
pthread_mutex_lock(&qb_queue->mutex);
empty = (qb_queue->used == 0);
@@ -104,7 +104,7 @@ static inline int qb_queue_is_empty(struct qb_queue *qb_queue)
static inline void qb_queue_item_add(struct qb_queue *qb_queue, void *item)
{
char *qb_queue_item;
- int qb_queue_position;
+ int32_t qb_queue_position;
pthread_mutex_lock(&qb_queue->mutex);
qb_queue_position = qb_queue->head;
@@ -125,7 +125,7 @@ static inline void qb_queue_item_add(struct qb_queue *qb_queue, void
*item)
static inline void *qb_queue_item_get(struct qb_queue *qb_queue)
{
char *qb_queue_item;
- int qb_queue_position;
+ int32_t qb_queue_position;
pthread_mutex_lock(&qb_queue->mutex);
qb_queue_position = (qb_queue->tail + 1) % qb_queue->size;
@@ -148,7 +148,7 @@ static inline void qb_queue_item_remove(struct qb_queue *qb_queue)
}
static inline void qb_queue_items_remove(struct qb_queue *qb_queue,
- int rel_count)
+ int32_t rel_count)
{
pthread_mutex_lock(&qb_queue->mutex);
qb_queue->tail = (qb_queue->tail + rel_count) % qb_queue->size;
@@ -169,7 +169,7 @@ static inline void qb_queue_item_iterator_init(struct qb_queue
*qb_queue)
static inline void *qb_queue_item_iterator_get(struct qb_queue *qb_queue)
{
char *qb_queue_item;
- int qb_queue_position;
+ int32_t qb_queue_position;
pthread_mutex_lock(&qb_queue->mutex);
qb_queue_position = (qb_queue->iterator) % qb_queue->size;
@@ -183,9 +183,9 @@ static inline void *qb_queue_item_iterator_get(struct qb_queue
*qb_queue)
return ((void *)qb_queue_item);
}
-static inline int qb_queue_item_iterator_next(struct qb_queue *qb_queue)
+static inline int32_t qb_queue_item_iterator_next(struct qb_queue *qb_queue)
{
- int next_res;
+ int32_t next_res;
pthread_mutex_lock(&qb_queue->mutex);
qb_queue->iterator = (qb_queue->iterator + 1) % qb_queue->size;
@@ -195,7 +195,7 @@ static inline int qb_queue_item_iterator_next(struct qb_queue
*qb_queue)
return (next_res);
}
-static inline void qb_queue_avail(struct qb_queue *qb_queue, int *avail)
+static inline void qb_queue_avail(struct qb_queue *qb_queue, int32_t *avail)
{
pthread_mutex_lock(&qb_queue->mutex);
*avail = qb_queue->size - qb_queue->used - 2;
@@ -203,9 +203,9 @@ static inline void qb_queue_avail(struct qb_queue *qb_queue, int
*avail)
pthread_mutex_unlock(&qb_queue->mutex);
}
-static inline int qb_queue_used(struct qb_queue *qb_queue)
+static inline int32_t qb_queue_used(struct qb_queue *qb_queue)
{
- int used;
+ int32_t used;
pthread_mutex_lock(&qb_queue->mutex);
used = qb_queue->used;
@@ -214,9 +214,9 @@ static inline int qb_queue_used(struct qb_queue *qb_queue)
return (used);
}
-static inline int qb_queue_usedhw(struct qb_queue *qb_queue)
+static inline int32_t qb_queue_usedhw(struct qb_queue *qb_queue)
{
- int usedhw;
+ int32_t usedhw;
pthread_mutex_lock(&qb_queue->mutex);
usedhw = qb_queue->usedhw;
diff --git a/include/qb/qbtimer.h b/include/qb/qbtimer.h
index a131dea..daf2ad1 100644
--- a/include/qb/qbtimer.h
+++ b/include/qb/qbtimer.h
@@ -30,15 +30,15 @@ extern "C" {
typedef void *qb_timer_handle;
-int qb_timer_init(void (*serialize_lock) (void),
- void (*serialize_unlock) (void), int sched_priority);
+int32_t qb_timer_init(void (*serialize_lock) (void),
+ void (*serialize_unlock) (void), int32_t sched_priority);
-int qb_timer_add_duration(uint64_t nanosec_duration,
+int32_t qb_timer_add_duration(uint64_t nanosec_duration,
void *data,
void (*timer_fn) (void *data),
qb_timer_handle * handle);
-int qb_timer_add_absolute(uint64_t nanoseconds_from_epoch,
+int32_t qb_timer_add_absolute(uint64_t nanoseconds_from_epoch,
void *data,
void (*timer_fn) (void *data),
qb_timer_handle * handle);
diff --git a/include/qb/qbwthread.h b/include/qb/qbwthread.h
index 8ba44aa..c3368cc 100644
--- a/include/qb/qbwthread.h
+++ b/include/qb/qbwthread.h
@@ -29,22 +29,22 @@ extern "C" {
/* *INDENT-ON* */
struct qb_wthread_group {
- int threadcount;
- int last_scheduled;
+ int32_t threadcount;
+ int32_t last_scheduled;
struct qb_wthread_t *threads;
void (*worker_fn) (void *thread_state, void *work_item);
};
-int qb_wthread_group_init(struct qb_wthread_group *worker_thread_group,
- int threads,
- int items_max,
- int item_size,
- int thread_state_size,
+int32_t qb_wthread_group_init(struct qb_wthread_group *worker_thread_group,
+ int32_t threads,
+ int32_t items_max,
+ int32_t item_size,
+ int32_t thread_state_size,
void (*thread_state_constructor) (void *),
void (*worker_fn) (void *thread_state,
void *work_item));
-int qb_wthread_group_work_add(struct qb_wthread_group
+int32_t qb_wthread_group_work_add(struct qb_wthread_group
*worker_thread_group, void *item);
void qb_wthread_group_wait(struct qb_wthread_group *worker_thread_group);
diff --git a/include/tlist.h b/include/tlist.h
index b4674bd..e324f80 100644
--- a/include/tlist.h
+++ b/include/tlist.h
@@ -56,7 +56,7 @@ struct timerlist {
struct timerlist_timer {
struct qb_list_head list;
uint64_t expire_time;
- int is_absolute_timer;
+ int32_t is_absolute_timer;
void (*timer_fn) (void *data);
void *data;
timer_handle handle_addr;
@@ -123,7 +123,7 @@ static inline void timerlist_add(struct timerlist *timerlist,
{
struct qb_list_head *timer_list = 0;
struct timerlist_timer *timer_from_list;
- int found;
+ int32_t found;
for (found = 0, timer_list = timerlist->timer_head.next;
timer_list != &timerlist->timer_head;
@@ -143,7 +143,7 @@ static inline void timerlist_add(struct timerlist *timerlist,
}
}
-static inline int timerlist_add_absolute(struct timerlist *timerlist,
+static inline int32_t timerlist_add_absolute(struct timerlist *timerlist,
void (*timer_fn) (void *data),
void *data,
uint64_t nano_from_epoch,
@@ -169,7 +169,7 @@ static inline int timerlist_add_absolute(struct timerlist *timerlist,
return (0);
}
-static inline int timerlist_add_duration(struct timerlist *timerlist,
+static inline int32_t timerlist_add_duration(struct timerlist *timerlist,
void (*timer_fn) (void *data),
void *data,
uint64_t nano_duration,
diff --git a/lib/hash.c b/lib/hash.c
index d02eb67..cd4984c 100644
--- a/lib/hash.c
+++ b/lib/hash.c
@@ -59,7 +59,7 @@ static uint32_t hash_fnv(const void *value, uint32_t valuelen, uint32_t
order)
uint8_t *cd = (uint8_t *) value;
uint8_t *ed = (uint8_t *) value + valuelen;
uint32_t hash_result = 0x811c9dc5;
- int res;
+ int32_t res;
while (cd < ed) {
hash_result ^= *cd;
@@ -74,7 +74,7 @@ int32_t qb_hash_initialize(qb_handle_t * handle,
uint32_t order, uint32_t context_size)
{
struct hash_table *hash_table;
- int i;
+ int32_t i;
uint64_t size;
int32_t res;
@@ -119,9 +119,9 @@ int32_t qb_hash_key_set(qb_handle_t handle,
struct hash_table *hash_table;
uint32_t hash_entry;
struct qb_list_head *list;
- int found = 0;
+ int32_t found = 0;
struct hash_node *hash_node;
- int res = 0;
+ int32_t res = 0;
res =
qb_hdb_handle_get(&qb_hash_handle_db, handle, (void *)&hash_table);
@@ -262,7 +262,7 @@ int32_t qb_hash_key_context_get(qb_handle_t handle,
const char *key, void **context)
{
struct hash_table *hash_table;
- int res = 0;
+ int32_t res = 0;
qb_hdb_handle_get(&qb_hash_handle_db, handle, (void *)&hash_table);
qb_hdb_handle_put(&qb_hash_handle_db, handle);
diff --git a/lib/ipc_int.h b/lib/ipc_int.h
index f208a42..1065d2e 100644
--- a/lib/ipc_int.h
+++ b/lib/ipc_int.h
@@ -68,7 +68,7 @@ enum res_init_types {
};
typedef struct {
- int service __attribute__ ((aligned(8)));
+ int32_t service __attribute__ ((aligned(8)));
uint64_t semkey __attribute__ ((aligned(8)));
char control_file[64] __attribute__ ((aligned(8)));
char request_file[64] __attribute__ ((aligned(8)));
@@ -81,7 +81,7 @@ typedef struct {
} mar_req_setup_t __attribute__ ((aligned(8)));
typedef struct {
- int error __attribute__ ((aligned(8)));
+ int32_t error __attribute__ ((aligned(8)));
} mar_res_setup_t __attribute__ ((aligned(8)));
typedef struct {
@@ -121,7 +121,7 @@ typedef struct {
} mar_req_qb_ipcc_zc_execute_t __attribute__ ((aligned(8)));
struct qb_ipcs_zc_header {
- int map_size;
+ int32_t map_size;
uint64_t server_address;
};
diff --git a/lib/plugin_loader.c b/lib/plugin_loader.c
index aa7b30f..c487fb3 100644
--- a/lib/plugin_loader.c
+++ b/lib/plugin_loader.c
@@ -36,10 +36,10 @@
struct plugin_component_instance {
struct plugin_iface *ifaces;
- int iface_count;
+ int32_t iface_count;
qb_handle_t comp_handle;
void *dl_handle;
- int refcount;
+ int32_t refcount;
char library_name[256];
};
@@ -70,9 +70,9 @@ static struct hdb_handle_database plugin_iface_instance_database = {
static qb_handle_t g_component_handle = 0xFFFFFFFF;
#if defined(QB_LINUX) || defined(QB_SOLARIS)
-static int plugin_select_so(const struct dirent *dirent)
+static int32_t plugin_select_so(const struct dirent *dirent)
#else
-static int plugin_select_so(struct dirent *dirent)
+static int32_t plugin_select_so(struct dirent *dirent)
#endif
{
size_t len;
@@ -89,9 +89,9 @@ static int plugin_select_so(struct dirent *dirent)
}
#if defined(QB_LINUX) || defined(QB_SOLARIS)
-static int pathlist_select(const struct dirent *dirent)
+static int32_t pathlist_select(const struct dirent *dirent)
#else
-static int pathlist_select(struct dirent *dirent)
+static int32_t pathlist_select(struct dirent *dirent)
#endif
{
if (fnmatch("*.conf", dirent->d_name, 0) == 0) {
@@ -111,7 +111,7 @@ static inline struct plugin_component_instance *plugin_comp_find(const
char
struct plugin_component_instance *instance;
void *instance_p = NULL;
qb_handle_t component_handle = 0;
- int i;
+ int32_t i;
/*
* Try to find interface in already loaded component
@@ -137,7 +137,7 @@ static inline struct plugin_component_instance *plugin_comp_find(const
char
return (NULL);
}
-static inline int plugin_lib_loaded(char *library_name)
+static inline int32_t plugin_lib_loaded(char *library_name)
{
struct plugin_component_instance *instance;
void *instance_p = NULL;
@@ -208,7 +208,7 @@ static void ld_library_path_build(void)
free(my_ld_library_path);
}
-static int ldso_path_build(const char *path, const char *filename)
+static int32_t ldso_path_build(const char *path, const char *filename)
{
FILE *fp;
char string[1024];
@@ -216,7 +216,7 @@ static int ldso_path_build(const char *path, const char *filename)
char newpath[1024];
char *newpath_tmp;
char *new_filename;
- int j;
+ int32_t j;
struct dirent **scandir_list;
uint32_t scandir_entries;
@@ -269,18 +269,18 @@ static int ldso_path_build(const char *path, const char *filename)
}
#if defined (QB_SOLARIS) && !defined(HAVE_SCANDIR)
-static int scandir(const char *dir, struct dirent ***namelist,
- int (*filter) (const struct dirent *),
- int (*compar) (const struct dirent **,
+static int32_t scandir(const char *dir, struct dirent ***namelist,
+ int32_t (*filter) (const struct dirent *),
+ int32_t (*compar) (const struct dirent **,
const struct dirent **))
{
DIR *d;
struct dirent *entry;
struct dirent *result;
struct dirent **names = NULL;
- int namelist_items = 0, namelist_size = 0;
+ int32_t namelist_items = 0, namelist_size = 0;
size_t len;
- int return_code;
+ int32_t return_code;
d = opendir(dir);
if (d == NULL)
@@ -323,7 +323,7 @@ static int scandir(const char *dir, struct dirent ***namelist,
(void)closedir(d);
if ((namelist_items > 1) && (compar != NULL)) {
qsort(names, namelist_items, sizeof(struct dirent *),
- (int (*)(const void *, const void *))compar);
+ (int32_t (*)(const void *, const void *))compar);
}
*namelist = names;
@@ -332,7 +332,7 @@ static int scandir(const char *dir, struct dirent ***namelist,
fail:
{
- int err = errno;
+ int32_t err = errno;
(void)closedir(d);
while (namelist_items != 0) {
namelist_items--;
@@ -348,21 +348,21 @@ fail:
#endif
#if defined (QB_SOLARIS) && !defined(HAVE_ALPHASORT)
-static int alphasort(const struct dirent **a, const struct dirent **b)
+static int32_t alphasort(const struct dirent **a, const struct dirent **b)
{
return strcmp((*a)->d_name, (*b)->d_name);
}
#endif
-static int interface_find_and_load(const char *path,
+static int32_t interface_find_and_load(const char *path,
const char *iface_name,
- int version, struct plugin_component_instance
+ int32_t version, struct plugin_component_instance
**instance_ret, uint32_t *iface_number)
{
struct plugin_component_instance *instance;
void *dl_handle;
struct dirent **scandir_list;
- int scandir_entries;
+ int32_t scandir_entries;
uint32_t libs_to_scan;
char dl_name[1024];
#ifdef QB_SOLARIS
@@ -426,7 +426,7 @@ static int interface_find_and_load(const char *path,
/* scanning for pluginso loop */
if (scandir_entries > 0) {
- int i;
+ int32_t i;
for (i = 0; i < scandir_entries; i++) {
free(scandir_list[i]);
}
@@ -438,7 +438,7 @@ static int interface_find_and_load(const char *path,
found:
*instance_ret = instance;
if (scandir_entries > 0) {
- int i;
+ int32_t i;
for (i = 0; i < scandir_entries; i++) {
free(scandir_list[i]);
}
@@ -450,9 +450,9 @@ found:
static uint32_t plugin_initialized = 0;
-int plugin_ifact_reference(qb_handle_t * iface_handle,
+int32_t plugin_ifact_reference(qb_handle_t * iface_handle,
const char *iface_name,
- int version, void **iface, void *context)
+ int32_t version, void **iface, void *context)
{
struct plugin_iface_instance *iface_instance;
struct plugin_component_instance *instance;
@@ -511,10 +511,10 @@ found:
return (0);
}
-int plugin_ifact_release(qb_handle_t handle)
+int32_t plugin_ifact_release(qb_handle_t handle)
{
struct plugin_iface_instance *iface_instance;
- int res = 0;
+ int32_t res = 0;
res = qb_hdb_handle_get(&plugin_iface_instance_database,
handle, (void *)&iface_instance);
diff --git a/lib/poll.c b/lib/poll.c
index 9fd89df..553ffe3 100644
--- a/lib/poll.c
+++ b/lib/poll.c
@@ -34,7 +34,7 @@
#include "tlist.h"
#include "util_int.h"
-typedef int (*dispatch_fn_t) (qb_handle_t hdb_handle, int fd, int revents,
+typedef int32_t (*dispatch_fn_t) (qb_handle_t hdb_handle, int32_t fd, int32_t revents,
void *data);
struct qb_poll_entry {
@@ -46,9 +46,9 @@ struct qb_poll_entry {
struct qb_poll_instance {
struct qb_poll_entry *poll_entries;
struct pollfd *ufds;
- int poll_entry_count;
+ int32_t poll_entry_count;
struct timerlist timerlist;
- int stop_requested;
+ int32_t stop_requested;
};
QB_HDB_DECLARE(poll_instance_database, NULL);
@@ -85,10 +85,10 @@ error_exit:
return (-1);
}
-int qb_poll_destroy(qb_handle_t handle)
+int32_t qb_poll_destroy(qb_handle_t handle)
{
struct qb_poll_instance *poll_instance;
- int res = 0;
+ int32_t res = 0;
res = qb_hdb_handle_get(&poll_instance_database, handle,
(void *)&poll_instance);
@@ -108,19 +108,19 @@ error_exit:
return (res);
}
-int qb_poll_dispatch_add(qb_handle_t handle,
- int fd,
- int events,
+int32_t qb_poll_dispatch_add(qb_handle_t handle,
+ int32_t fd,
+ int32_t events,
void *data,
- int (*dispatch_fn) (qb_handle_t hdb_handle_t,
- int fd, int revents, void *data))
+ int32_t (*dispatch_fn) (qb_handle_t hdb_handle_t,
+ int32_t fd, int32_t revents, void *data))
{
struct qb_poll_instance *poll_instance;
struct qb_poll_entry *poll_entries;
struct pollfd *ufds;
- int found = 0;
- int install_pos;
- int res = 0;
+ int32_t found = 0;
+ int32_t install_pos;
+ int32_t res = 0;
res = qb_hdb_handle_get(&poll_instance_database, handle,
(void *)&poll_instance);
@@ -183,16 +183,16 @@ error_exit:
return (res);
}
-int qb_poll_dispatch_modify(qb_handle_t handle,
- int fd,
- int events,
- int (*dispatch_fn) (qb_handle_t hdb_handle_t,
- int fd,
- int revents, void *data))
+int32_t qb_poll_dispatch_modify(qb_handle_t handle,
+ int32_t fd,
+ int32_t events,
+ int32_t (*dispatch_fn) (qb_handle_t hdb_handle_t,
+ int32_t fd,
+ int32_t revents, void *data))
{
struct qb_poll_instance *poll_instance;
- int i;
- int res = 0;
+ int32_t i;
+ int32_t res = 0;
res = qb_hdb_handle_get(&poll_instance_database, handle,
(void *)&poll_instance);
@@ -223,11 +223,11 @@ error_exit:
return (res);
}
-int qb_poll_dispatch_delete(qb_handle_t handle, int fd)
+int32_t qb_poll_dispatch_delete(qb_handle_t handle, int32_t fd)
{
struct qb_poll_instance *poll_instance;
- int i;
- int res = 0;
+ int32_t i;
+ int32_t res = 0;
res = qb_hdb_handle_get(&poll_instance_database, handle,
(void *)&poll_instance);
@@ -257,13 +257,13 @@ error_exit:
return (res);
}
-int qb_poll_timer_add(qb_handle_t handle,
- int msec_duration, void *data,
+int32_t qb_poll_timer_add(qb_handle_t handle,
+ int32_t msec_duration, void *data,
void (*timer_fn) (void *data),
qb_poll_timer_handle * timer_handle_out)
{
struct qb_poll_instance *poll_instance;
- int res = 0;
+ int32_t res = 0;
if (timer_handle_out == NULL) {
res = -ENOENT;
@@ -287,10 +287,10 @@ error_exit:
return (res);
}
-int qb_poll_timer_delete(qb_handle_t handle, qb_poll_timer_handle th)
+int32_t qb_poll_timer_delete(qb_handle_t handle, qb_poll_timer_handle th)
{
struct qb_poll_instance *poll_instance;
- int res = 0;
+ int32_t res = 0;
if (th == 0) {
return (0);
@@ -310,7 +310,7 @@ error_exit:
return (res);
}
-int qb_poll_stop(qb_handle_t handle)
+int32_t qb_poll_stop(qb_handle_t handle)
{
struct qb_poll_instance *poll_instance;
int32_t res;
@@ -329,13 +329,13 @@ error_exit:
return (res);
}
-int qb_poll_run(qb_handle_t handle)
+int32_t qb_poll_run(qb_handle_t handle)
{
struct qb_poll_instance *poll_instance;
- int i;
+ int32_t i;
uint64_t expire_timeout_msec = -1;
- int res;
- int poll_entry_count;
+ int32_t res;
+ int32_t poll_entry_count;
res = qb_hdb_handle_get(&poll_instance_database, handle,
(void *)&poll_instance);
@@ -401,11 +401,11 @@ error_exit:
}
#ifdef COMPILE_OUT
-void qb_poll_print_state(qb_handle_t handle, int fd)
+void qb_poll_print_state(qb_handle_t handle, int32_t fd)
{
struct qb_poll_instance *poll_instance;
- int i;
- int res = 0;
+ int32_t i;
+ int32_t res = 0;
res = qb_hdb_handle_get(&poll_instance_database, handle,
(void *)&poll_instance);
if (res != 0) {
diff --git a/lib/ringbuffer_int.h b/lib/ringbuffer_int.h
index ffa304e..68c3269 100644
--- a/lib/ringbuffer_int.h
+++ b/lib/ringbuffer_int.h
@@ -83,7 +83,7 @@ struct qb_ringbuffer_s {
#if defined(_SEM_SEMUN_UNDEFINED)
union semun {
- int val;
+ int32_t val;
struct semid_ds *buf;
unsigned short int *array;
struct seminfo *__buf;
diff --git a/lib/timer.c b/lib/timer.c
index b9dba2f..4a615cb 100644
--- a/lib/timer.c
+++ b/lib/timer.c
@@ -43,7 +43,7 @@ static pthread_attr_t thread_attr;
static struct timerlist timers_timerlist;
-static int sched_priority = 0;
+static int32_t sched_priority = 0;
static void (*timer_serialize_lock_fn) (void);
@@ -58,7 +58,7 @@ extern void pthread_exit(void *) __attribute__ ((noreturn));
*/
static void *prioritized_timer_thread(void *data)
{
- int fds;
+ int32_t fds;
uint64_t timeout;
#if defined(HAVE_PTHREAD_SETSCHEDPARAM) && defined(HAVE_SCHED_GET_PRIORITY_MAX)
@@ -95,7 +95,7 @@ static void *prioritized_timer_thread(void *data)
}
}
-static void sigusr1_handler(int num)
+static void sigusr1_handler(int32_t num)
{
#ifdef qb_SOLARIS
/* Rearm the signal facility */
@@ -103,10 +103,10 @@ static void sigusr1_handler(int num)
#endif
}
-int qb_timer_init(void (*serialize_lock_fn) (void),
- void (*serialize_unlock_fn) (void), int sched_priority_in)
+int32_t qb_timer_init(void (*serialize_lock_fn) (void),
+ void (*serialize_unlock_fn) (void), int32_t sched_priority_in)
{
- int res;
+ int32_t res;
timer_serialize_lock_fn = serialize_lock_fn;
timer_serialize_unlock_fn = serialize_unlock_fn;
@@ -126,12 +126,12 @@ int qb_timer_init(void (*serialize_lock_fn) (void),
return (res);
}
-int qb_timer_add_absolute(uint64_t nanosec_from_epoch,
+int32_t qb_timer_add_absolute(uint64_t nanosec_from_epoch,
void *data,
void (*timer_fn) (void *data), timer_handle * handle)
{
- int res;
- int unlock;
+ int32_t res;
+ int32_t unlock;
if (pthread_equal(pthread_self(), expiry_thread) != 0) {
unlock = 0;
@@ -153,12 +153,12 @@ int qb_timer_add_absolute(uint64_t nanosec_from_epoch,
return (res);
}
-int qb_timer_add_duration(uint64_t nanosec_duration,
+int32_t qb_timer_add_duration(uint64_t nanosec_duration,
void *data,
void (*timer_fn) (void *data), timer_handle * handle)
{
- int res;
- int unlock;
+ int32_t res;
+ int32_t unlock;
if (pthread_equal(pthread_self(), expiry_thread) != 0) {
unlock = 0;
@@ -181,7 +181,7 @@ int qb_timer_add_duration(uint64_t nanosec_duration,
void qb_timer_delete(timer_handle th)
{
- int unlock;
+ int32_t unlock;
if (th == 0) {
return;
@@ -218,7 +218,7 @@ uint64_t qb_timer_time_get(void)
uint64_t qb_timer_expire_time_get(timer_handle th)
{
- int unlock;
+ int32_t unlock;
uint64_t expire;
if (th == 0) {
diff --git a/lib/tsafe.c b/lib/tsafe.c
index fbdaa22..1cf2c09 100644
--- a/lib/tsafe.c
+++ b/lib/tsafe.c
@@ -67,8 +67,8 @@
* known not to be thread safe (see man pthreads).
*/
-static int tsafe_disabled = 1;
-static int tsafe_inited = 0;
+static int32_t tsafe_disabled = 1;
+static int32_t tsafe_inited = 0;
static char **coro_environ;
static void atfork_prepare(void);
static void atfork_parent(void);
@@ -82,8 +82,8 @@ static pthread_mutex_t tsafe_enabled_mutex = PTHREAD_MUTEX_INITIALIZER;
void qb_tsafe_init(char **envp)
{
- int i;
- int size = 1;
+ int32_t i;
+ int32_t size = 1;
for (i = 0; envp[i] != NULL; i++) {
size++;
@@ -212,8 +212,8 @@ int pthread_create(pthread_t * thread, const pthread_attr_t * attr,
char *getenv(const char *name)
{
static char *(*real_getenv) (const char *name) = NULL;
- int entry;
- int found = 0;
+ int32_t entry;
+ int32_t found = 0;
char *eq;
size_t name_len;
diff --git a/lib/util.c b/lib/util.c
index ed9682b..76204dd 100644
--- a/lib/util.c
+++ b/lib/util.c
@@ -48,7 +48,7 @@ struct qb_thread_lock_s {
qb_thread_lock_t *qb_thread_lock_create(qb_thread_lock_type_t type)
{
struct qb_thread_lock_s *tl = malloc(sizeof(struct qb_thread_lock_s));
- int res;
+ int32_t res;
#if defined(HAVE_PTHREAD_SPIN_LOCK)
if (type == QB_THREAD_LOCK_SHORT) {
@@ -70,7 +70,7 @@ qb_thread_lock_t *qb_thread_lock_create(qb_thread_lock_type_t type)
int32_t qb_thread_lock(qb_thread_lock_t * tl)
{
- int res;
+ int32_t res;
#if defined(HAVE_PTHREAD_SPIN_LOCK)
if (tl->type == QB_THREAD_LOCK_SHORT) {
res = pthread_spin_lock(&tl->spinlock);
@@ -84,7 +84,7 @@ int32_t qb_thread_lock(qb_thread_lock_t * tl)
int32_t qb_thread_unlock(qb_thread_lock_t * tl)
{
- int res;
+ int32_t res;
#if defined(HAVE_PTHREAD_SPIN_LOCK)
if (tl->type == QB_THREAD_LOCK_SHORT) {
res = pthread_spin_unlock(&tl->spinlock);
@@ -98,7 +98,7 @@ int32_t qb_thread_unlock(qb_thread_lock_t * tl)
int32_t qb_thread_trylock(qb_thread_lock_t * tl)
{
- int res;
+ int32_t res;
#if defined(HAVE_PTHREAD_SPIN_LOCK)
if (tl->type == QB_THREAD_LOCK_SHORT) {
res = pthread_spin_trylock(&tl->spinlock);
diff --git a/lib/wthread.c b/lib/wthread.c
index baab797..f531e9e 100644
--- a/lib/wthread.c
+++ b/lib/wthread.c
@@ -87,16 +87,16 @@ static void *start_worker_thread(void *thread_data_in)
return (NULL);
}
-int qb_wthread_group_init(struct qb_wthread_group *worker_thread_group,
- int threads,
- int items_max,
- int item_size,
- int thread_state_size,
+int32_t qb_wthread_group_init(struct qb_wthread_group *worker_thread_group,
+ int32_t threads,
+ int32_t items_max,
+ int32_t item_size,
+ int32_t thread_state_size,
void (*thread_state_constructor) (void *),
void (*worker_fn) (void *thread_state,
void *work_item))
{
- int i;
+ int32_t i;
worker_thread_group->threadcount = threads;
worker_thread_group->last_scheduled = 0;
@@ -142,10 +142,10 @@ int qb_wthread_group_init(struct qb_wthread_group
*worker_thread_group,
return (0);
}
-int qb_wthread_group_work_add(struct qb_wthread_group *worker_thread_group,
+int32_t qb_wthread_group_work_add(struct qb_wthread_group *worker_thread_group,
void *item)
{
- int schedule;
+ int32_t schedule;
schedule =
(worker_thread_group->last_scheduled +
@@ -169,7 +169,7 @@ int qb_wthread_group_work_add(struct qb_wthread_group
*worker_thread_group,
void qb_wthread_group_wait(struct qb_wthread_group *worker_thread_group)
{
- int i;
+ int32_t i;
for (i = 0; i < worker_thread_group->threadcount; i++) {
pthread_mutex_lock(&worker_thread_group->threads[i].
@@ -188,7 +188,7 @@ void qb_wthread_group_wait(struct qb_wthread_group
*worker_thread_group)
void qb_wthread_group_exit(struct qb_wthread_group *worker_thread_group)
{
- int i;
+ int32_t i;
for (i = 0; i < worker_thread_group->threadcount; i++) {
pthread_cancel(worker_thread_group->threads[i].thread_id);
diff --git a/tests/bmc.c b/tests/bmc.c
index f8fc33a..004baf2 100644
--- a/tests/bmc.c
+++ b/tests/bmc.c
@@ -31,8 +31,8 @@
#include <unistd.h>
#include <signal.h>
-int blocking = 1;
-int verbose = 0;
+int32_t blocking = 1;
+int32_t verbose = 0;
#define ITERATIONS 10000
static struct timeval tv1, tv2, tv_elapsed;
@@ -56,7 +56,7 @@ static void bm_start(void)
gettimeofday(&tv1, NULL);
}
-static void bm_finish(const char *operation, int size)
+static void bm_finish(const char *operation, int32_t size)
{
float ops_per_sec;
float mbs_per_sec;
@@ -100,7 +100,7 @@ static void bmc_send_nozc(uint32_t size)
struct iovec iov[2];
qb_ipc_request_header_t req_header;
qb_ipc_response_header_t res_header;
- int res;
+ int32_t res;
req_header.id = 0;
req_header.size = sizeof(qb_ipc_request_header_t) + size;
@@ -145,7 +145,7 @@ static void show_usage(const char *name)
printf("\n");
}
-static void sigterm_handler(int num)
+static void sigterm_handler(int32_t num)
{
printf("writer: %s(%d)\n", __func__, num);
qb_ipcc_service_disconnect(bmc_ipc_handle);
@@ -159,11 +159,11 @@ static void libqb_log_writer(const char *file_name,
printf("libqb: %s:%d %s\n", file_name, file_line, msg);
}
-int main(int argc, char *argv[])
+int32_t main(int32_t argc, char *argv[])
{
const char *options = "nvh";
- int opt;
- int i, j;
+ int32_t opt;
+ int32_t i, j;
size_t size;
qb_util_set_log_function(libqb_log_writer);
diff --git a/tests/bmcpt.c b/tests/bmcpt.c
index 01403e5..3280ec6 100644
--- a/tests/bmcpt.c
+++ b/tests/bmcpt.c
@@ -37,7 +37,7 @@ struct bm_ctx {
struct timeval tv2;
struct timeval tv_elapsed;
float mbs;
- int multi;
+ int32_t multi;
uint32_t counter;
};
@@ -56,7 +56,7 @@ static void bm_start(struct bm_ctx *ctx)
gettimeofday(&ctx->tv1, NULL);
}
-static void bm_finish(struct bm_ctx *ctx, const char *operation, int size)
+static void bm_finish(struct bm_ctx *ctx, const char *operation, int32_t size)
{
float ops_per_sec;
float mbs_per_sec;
@@ -100,7 +100,7 @@ static void bmc_send_nozc(struct bm_ctx *ctx, uint32_t size)
struct iovec iov[2];
qb_ipc_request_header_t req_header;
qb_ipc_response_header_t res_header;
- int res;
+ int32_t res;
req_header.id = 0;
req_header.size = sizeof(qb_ipc_request_header_t) + size;
@@ -122,7 +122,7 @@ repeat_send:
}
uint32_t alarm_notice = 0;
-static void sigalrm_handler(int num)
+static void sigalrm_handler(int32_t num)
{
alarm_notice = 1;
}
@@ -147,12 +147,12 @@ static void *benchmark(void *ctx)
#define THREADS 4
-int main(void)
+int32_t main(void)
{
struct bm_ctx bm_ctx[THREADS];
pthread_t threads[THREADS];
pthread_attr_t thread_attr[THREADS];
- int i, j;
+ int32_t i, j;
float total_mbs;
void *retval;
diff --git a/tests/bms.c b/tests/bms.c
index d90bbfd..73e0d80 100644
--- a/tests/bms.c
+++ b/tests/bms.c
@@ -46,8 +46,8 @@
#include <qb/qbpoll.h>
#include <qb/qbipcs.h>
-int blocking = 1;
-int verbose = 0;
+int32_t blocking = 1;
+int32_t verbose = 0;
static qb_handle_t bms_poll_handle;
@@ -57,8 +57,8 @@ struct lib_handler {
struct service_engine {
uint32_t private_data_size;
- int (*lib_init_fn) (void *conn);
- int (*lib_exit_fn) (void *conn);
+ int32_t (*lib_init_fn) (void *conn);
+ int32_t (*lib_exit_fn) (void *conn);
struct lib_handler *lib_engine;
};
@@ -77,7 +77,7 @@ static void bms_benchmark_one_fn(void *conn, const void *msg)
}
}
-int ii = 0;
+int32_t ii = 0;
static void bms_benchmark_two_fn(void *conn, const void *msg)
{
const qb_ipc_request_header_t *req = msg;
@@ -105,7 +105,7 @@ static void bms_benchmark_two_fn(void *conn, const void *msg)
qb_ipcs_response_send(conn, &res_done, sizeof(res_done));
}
-static int bms_lib_init_fn(void *conn)
+static int32_t bms_lib_init_fn(void *conn)
{
if (verbose) {
printf("%s:%d %s\n", __FILE__, __LINE__, __func__);
@@ -113,7 +113,7 @@ static int bms_lib_init_fn(void *conn)
return (0);
}
-static int bms_lib_exit_fn(void *conn)
+static int32_t bms_lib_exit_fn(void *conn)
{
if (verbose) {
printf("%s:%d %s\n", __FILE__, __LINE__, __func__);
@@ -150,7 +150,7 @@ static void bms_serialize_unlock(void)
/*
* Provides the glue from bms to the IPC Service
*/
-static int bms_private_data_size_get(uint32_t service)
+static int32_t bms_private_data_size_get(uint32_t service)
{
return (services[service].private_data_size);
}
@@ -171,7 +171,7 @@ static qb_ipcs_handler_fn_lvalue bms_handler_fn_get(uint32_t service,
return (services[service].lib_engine[id].lib_handler_fn);
}
-static int bms_security_valid(int euid, int egid)
+static int32_t bms_security_valid(int32_t euid, int32_t egid)
{
if (euid == 0 || egid == 0) {
return (1);
@@ -180,7 +180,7 @@ static int bms_security_valid(int euid, int egid)
return (0);
}
-static int bms_service_available(uint32_t service)
+static int32_t bms_service_available(uint32_t service)
{
if (verbose) {
printf("%s:%d %s\n", __FILE__, __LINE__, __func__);
@@ -188,7 +188,7 @@ static int bms_service_available(uint32_t service)
return (service < 1);
}
-static int bms_sending_allowed(uint32_t service,
+static int32_t bms_sending_allowed(uint32_t service,
uint32_t id,
const void *msg,
void *sending_allowed_private_data)
@@ -212,8 +212,8 @@ static void ipc_fatal_error(const char *error_msg)
exit(1);
}
-static int bms_poll_handler_accept(qb_handle_t handle,
- int fd, int revent, void *context)
+static int32_t bms_poll_handler_accept(qb_handle_t handle,
+ int32_t fd, int32_t revent, void *context)
{
if (verbose) {
printf("%s:%d %s\n", __FILE__, __LINE__, __func__);
@@ -221,13 +221,13 @@ static int bms_poll_handler_accept(qb_handle_t handle,
return (qb_ipcs_handler_accept(fd, revent, context));
}
-static int bms_poll_handler_dispatch(qb_handle_t handle,
- int fd, int revent, void *context)
+static int32_t bms_poll_handler_dispatch(qb_handle_t handle,
+ int32_t fd, int32_t revent, void *context)
{
return (qb_ipcs_handler_dispatch(fd, revent, context));
}
-static void bms_poll_accept_add(int fd)
+static void bms_poll_accept_add(int32_t fd)
{
if (verbose) {
printf("%s:%d %s\n", __FILE__, __LINE__, __func__);
@@ -236,7 +236,7 @@ static void bms_poll_accept_add(int fd)
bms_poll_handler_accept);
}
-static void bms_poll_dispatch_add(int fd, void *context)
+static void bms_poll_dispatch_add(int32_t fd, void *context)
{
if (verbose) {
printf("%s:%d %s\n", __FILE__, __LINE__, __func__);
@@ -245,7 +245,7 @@ static void bms_poll_dispatch_add(int fd, void *context)
bms_poll_handler_dispatch);
}
-static void bms_poll_dispatch_modify(int fd, int events)
+static void bms_poll_dispatch_modify(int32_t fd, int32_t events)
{
if (verbose) {
printf("%s:%d %s\n", __FILE__, __LINE__, __func__);
@@ -280,7 +280,7 @@ struct qb_ipcs_init_state ipc_init_state = {
.handler_fn_get = bms_handler_fn_get
};
-static void sigusr1_handler(int num)
+static void sigusr1_handler(int32_t num)
{
printf("%s(%d)\n", __func__, num);
qb_ipcs_ipc_exit();
@@ -300,10 +300,10 @@ static void show_usage(const char *name)
printf("\n");
}
-int main(int argc, char *argv[])
+int32_t main(int32_t argc, char *argv[])
{
const char *options = "nvh";
- int opt;
+ int32_t opt;
while ((opt = getopt(argc, argv, options)) != -1) {
switch (opt) {
diff --git a/tests/check_hash.c b/tests/check_hash.c
index 89fb78f..e91fc61 100644
--- a/tests/check_hash.c
+++ b/tests/check_hash.c
@@ -28,7 +28,7 @@ START_TEST(test_hash_load)
{
char word[1000];
FILE *fp;
- int res = 0;
+ int32_t res = 0;
qb_handle_t handle = 0;
void *value;
uint64_t value_len;
@@ -92,9 +92,9 @@ END_TEST static Suite *hash_suite(void)
return s;
}
-int main(void)
+int32_t main(void)
{
- int number_failed;
+ int32_t number_failed;
Suite *s = hash_suite();
SRunner *sr = srunner_create(s);
diff --git a/tests/check_plugin.c b/tests/check_plugin.c
index d38a5d7..ad24e09 100644
--- a/tests/check_plugin.c
+++ b/tests/check_plugin.c
@@ -113,9 +113,9 @@ END_TEST static Suite *plugin_suite(void)
return s;
}
-int main(void)
+int32_t main(void)
{
- int number_failed;
+ int32_t number_failed;
Suite *s = plugin_suite();
SRunner *sr = srunner_create(s);
diff --git a/tests/check_rb.c b/tests/check_rb.c
index 9b8a2c2..e262876 100644
--- a/tests/check_rb.c
+++ b/tests/check_rb.c
@@ -35,8 +35,8 @@ START_TEST(test_ring_buffer1)
qb_ipc_request_header_t *hdr;
char *str;
qb_ringbuffer_t *rb;
- int i;
- int b;
+ int32_t i;
+ int32_t b;
ssize_t actual;
ssize_t avail;
@@ -161,7 +161,7 @@ END_TEST START_TEST(test_ring_buffer4)
{
qb_ringbuffer_t *t;
char data[] = "1234567891";
- int i;
+ int32_t i;
char *new_data;
ssize_t l;
@@ -206,9 +206,9 @@ static void libqb_log_fn(const char *file_name,
printf("libqb: %s:%d %s\n", file_name, file_line, msg);
}
-int main(void)
+int32_t main(void)
{
- int number_failed;
+ int32_t number_failed;
Suite *s = rb_suite();
SRunner *sr = srunner_create(s);
diff --git a/tests/libtest_a.c b/tests/libtest_a.c
index 6b59fd3..67a5075 100644
--- a/tests/libtest_a.c
+++ b/tests/libtest_a.c
@@ -25,7 +25,7 @@
/*
* Version 0 of the interface
*/
-static int iface1_constructor(void *context);
+static int32_t iface1_constructor(void *context);
static void iface1_destructor(void *context);
@@ -38,7 +38,7 @@ static void iface1_func3(void);
/*
* Version 1 of the interface
*/
-static int iface1_ver1_constructor(void *context);
+static int32_t iface1_ver1_constructor(void *context);
static void iface1_ver1_destructor(void *context);
@@ -102,7 +102,7 @@ static struct plugin_comp test_comp = {
.ifaces = iface1
};
-static int iface1_constructor(void *context)
+static int32_t iface1_constructor(void *context)
{
printf("A - version 0 constructor context %p\n", context);
return (0);
@@ -128,7 +128,7 @@ static void iface1_func3(void)
printf("A - version 0 func3\n");
}
-static int iface1_ver1_constructor(void *context)
+static int32_t iface1_ver1_constructor(void *context)
{
printf("A - version 1 constructor context %p\n", context);
return (0);
diff --git a/tests/libtest_b.c b/tests/libtest_b.c
index e9d1563..e372c76 100644
--- a/tests/libtest_b.c
+++ b/tests/libtest_b.c
@@ -25,7 +25,7 @@
/*
* Version 0 of the interface
*/
-static int iface1_constructor(void *context);
+static int32_t iface1_constructor(void *context);
static void iface1_destructor(void *context);
@@ -38,7 +38,7 @@ static void iface1_func3(void);
/*
* Version 1 of the interface
*/
-static int iface1_ver1_constructor(void *context);
+static int32_t iface1_ver1_constructor(void *context);
static void iface1_ver1_destructor(void *context);
@@ -106,7 +106,7 @@ struct plugin_comp test_comp = {
.ifaces = iface1
};
-static int iface1_constructor(void *context)
+static int32_t iface1_constructor(void *context)
{
printf("B - version 0 constructor context %p\n", context);
return (0);
@@ -132,7 +132,7 @@ static void iface1_func3(void)
printf("B - version 0 func3\n");
}
-static int iface1_ver1_constructor(void *context)
+static int32_t iface1_ver1_constructor(void *context)
{
printf("B - version 1 constructor context %p\n", context);
return (0);
diff --git a/tests/rbreader.c b/tests/rbreader.c
index fc5dfdb..de7debc 100644
--- a/tests/rbreader.c
+++ b/tests/rbreader.c
@@ -10,7 +10,7 @@
#define BUFFER_CHUNK_SIZE (50*50*10)
static qb_ringbuffer_t *rb = NULL;
-static void sigterm_handler(int num)
+static void sigterm_handler(int32_t num)
{
printf("reader: %s(%d)\n", __func__, num);
qb_rb_close(rb);
@@ -24,7 +24,7 @@ static void libqb_log_writer(const char *file_name,
printf("libqb:reader: %s:%d %s\n", file_name, file_line, msg);
}
-int main(int argc, char *argv[])
+int32_t main(int32_t argc, char *argv[])
{
ssize_t num_read;
int8_t buffer[BUFFER_CHUNK_SIZE];
diff --git a/tests/rbwriter.c b/tests/rbwriter.c
index e619d42..fda4a7e 100644
--- a/tests/rbwriter.c
+++ b/tests/rbwriter.c
@@ -48,7 +48,7 @@ do { \
} \
} while (0)
-static void sigterm_handler(int num)
+static void sigterm_handler(int32_t num)
{
printf("writer: %s(%d)\n", __func__, num);
qb_rb_close(rb);
@@ -67,7 +67,7 @@ static void bm_start(void)
gettimeofday(&tv1, NULL);
}
-static void bm_finish(const char *operation, int size)
+static void bm_finish(const char *operation, int32_t size)
{
float ops_per_sec;
float mbs_per_sec;
@@ -126,12 +126,12 @@ static void show_usage(const char *name)
printf("\n");
}
-int main(int argc, char *argv[])
+int32_t main(int32_t argc, char *argv[])
{
const char *options = "vh";
- int opt;
- int i, j;
- int size;
+ int32_t opt;
+ int32_t i, j;
+ int32_t size;
while ((opt = getopt(argc, argv, options)) != -1) {
switch (opt) {
--
1.6.6.1