(unsigned long long) stats.latency_low,
(unsigned long long) stats.latency_high,
(unsigned long long) stats.latency_avg,
- sqrt(stats.latency_ssquares / stats.count));
+ sqrt((double)stats.latency_ssquares / stats.count));
} else {
kdbus_printf("*** no packets received. bus stuck?\n");
}
stress_payload = malloc(env->payload);
ASSERT_NONZERO(stress_payload);
- for (int i = 0; i < env->payload; i++)
+ for (size_t i = 0; i < env->payload; i++)
stress_payload[i] = i;
// A pair consists of a reader and a sender
stress_payload = malloc(env->payload);
ASSERT_NONZERO(stress_payload);
- for (int i = 0; i < env->payload; i++)
+ for (size_t i = 0; i < env->payload; i++)
stress_payload[i] = i;
bandwidth_sender_thread(&(struct bandwidth_worker_data){ .i = 0, .env = env });
int ret;
struct kdbus_msg *msg = NULL;
const struct kdbus_item *item;
- uint64_t cookie = time(NULL) ^ 0xdeadbeef;
+ uint64_t cookie = ((uint64_t) time(NULL)) ^ 0xdeadbeef;
struct kdbus_conn *unpriv_conn = NULL;
struct kdbus_pids parent_pids = {
.pid = getppid(),
#include "kdbus-util.h"
#include "kdbus-enum.h"
+static wur uint64_t generate_cookie()
+{
+ return ((uint64_t) time(NULL)) ^ 0xdeadbeef;
+}
+
static wur int test_policy_priv_by_id(const char *bus,
struct kdbus_conn *conn_dst,
int parent_status,
int child_status)
{
- uint64_t expected_cookie = time(NULL) ^ 0xdeadbeef;
+ uint64_t expected_cookie = generate_cookie();
#ifdef TIZEN
parent_status = child_status = 0;
uid_t second_uid = UNPRIV_UID;
gid_t second_gid = UNPRIV_GID;
struct kdbus_conn *child_2 = conn_dst;
- uint64_t expected_cookie = time(NULL) ^ 0xdeadbeef;
+ uint64_t expected_cookie = generate_cookie();
#ifdef TIZEN
child_status = 0;
struct kdbus_conn *owner_a, *owner_b;
struct kdbus_conn *holder_a, *holder_b;
struct kdbus_policy_access access = {};
- uint64_t expected_cookie = time(NULL) ^ 0xdeadbeef;
+ uint64_t expected_cookie = generate_cookie();
ASSERT_NONZERO(owner_a = kdbus_hello(env->buspath, 0, NULL, 0));
}
if (e->hdr_size != sizeof(struct logger_entry)) {
- fprintf(stderr, "%d != %d\n", e->hdr_size, sizeof(struct logger_entry));
+ fprintf(stderr, "%d != %zu\n", (int) e->hdr_size, sizeof(struct logger_entry));
fprintf(stderr, "read: Invalid data\n");
ret = EXIT_FAILURE;
break;