Commit c530fb1e authored by Pekka Pessi's avatar Pekka Pessi

su, http, nth, sip, tport: removed some warnings.

darcs-hash:20061128195213-65a35-210b321f01bc3820a94b62d91fb2d378307042e5.gz
parent 1ec3aab4
......@@ -1197,7 +1197,7 @@ static int test_http_encoding(void)
http_t *http;
su_home_t *home;
char b[160];
int n;
size_t n;
BEGIN();
......
......@@ -810,7 +810,7 @@ int auc_register_plugin(auth_client_plugin_t const *plugin)
plugin->auc_authorize == NULL)
return errno = EFAULT, -1;
if (plugin->auc_size < sizeof (auth_client_t))
if (plugin->auc_size < (int) sizeof (auth_client_t))
return errno = EINVAL, -1;
for (i = 0; i < MAX_AUC; i++) {
......@@ -847,7 +847,7 @@ auth_client_t *ca_create(su_home_t *home,
break;
}
aucsize = auc ? auc->auc_size : (sizeof *ca);
aucsize = auc ? (size_t)auc->auc_size : (sizeof *ca);
size = aucsize + realmlen;
if (!auc)
size += strlen(scheme) + 1;
......
......@@ -485,7 +485,7 @@ char const *nth_site_server_version(void)
}
/** Get the time last time served. */
su_time_t const nth_site_access_time(nth_site_t const *site)
su_time_t nth_site_access_time(nth_site_t const *site)
{
su_time_t const never = { 0, 0 };
......
......@@ -170,7 +170,7 @@ NTH_DLL void nth_site_bind(nth_site_t *site,
nth_request_f *callback,
nth_site_magic_t *);
NTH_DLL su_time_t const nth_site_access_time(nth_site_t const *site);
NTH_DLL su_time_t nth_site_access_time(nth_site_t const *site);
NTH_DLL int nth_site_set_params(nth_site_t *site,
tag_type_t tag, tag_value_t value, ...);
......
......@@ -86,7 +86,7 @@ typedef struct {
} options_t;
typedef struct {
uint32_t N;
size_t N;
uint32_t bsize;
double buckets[32768];
} histogram_t;
......@@ -94,7 +94,7 @@ typedef struct {
static
histogram_t *histogram_create(uint64_t max, uint32_t bsize)
{
uint32_t N = (max + bsize - 1) / bsize;
size_t N = (max + bsize - 1) / bsize;
histogram_t *h = calloc(1, offsetof(histogram_t, buckets[N + 1]));
if (!h) { perror("calloc"); exit(1); }
h->N = N, h->bsize = bsize;
......@@ -116,7 +116,7 @@ double *histogram_update(histogram_t *h, uint32_t n)
static void
histogram_div(histogram_t *h, histogram_t const *n)
{
uint32_t i;
size_t i;
assert(h->N == n->N); assert(h->bsize == n->bsize);
for (i = 0; i <= h->N; i++) {
......@@ -332,7 +332,7 @@ int search_msg(char **bb, char const *protocol)
int validate_dump(char *b, off_t size, context_t *ctx)
{
int n = 0, N = 0;
size_t n = 0, N = 0;
struct message {
char *b;
int size;
......@@ -520,7 +520,7 @@ void sipstats(msg_t *msg, uint32_t msize, sipstats_t *ss, context_t *ctx)
sip_t const *sip = sip_object(msg);
msg_header_t *h;
sipstat_t *sss;
uint32_t n, bytes;
size_t n, bytes;
if (!sip)
return;
......@@ -545,7 +545,7 @@ void sipstats(msg_t *msg, uint32_t msize, sipstats_t *ss, context_t *ctx)
sss->headers += n;
bytes = sip->sip_payload ? sip->sip_payload->pl_len : 0;
bytes = sip->sip_payload ? (size_t)sip->sip_payload->pl_len : 0;
if (bytes) {
sss->payloads++;
......@@ -564,7 +564,7 @@ void sipstats(msg_t *msg, uint32_t msize, sipstats_t *ss, context_t *ctx)
void report_histogram(char const *title, histogram_t const *h)
{
int i, min_i, max_i;
size_t i, min_i, max_i;
for (i = 0; i < h->N && h->buckets[i] == 0.0; i++)
;
......
......@@ -60,7 +60,7 @@ struct su_home_s {
su_alock_t *suh_lock;
};
#define SU_HOME_INIT(obj) { 0 }
#define SU_HOME_INIT(obj) { 0, NULL, NULL }
SU_DLL void *su_home_new(isize_t size)
__attribute__((__malloc__));
......
......@@ -179,11 +179,11 @@ su_inline tag_value_t tag_uint_vr(unsigned *vp) { return (tag_value_t)vp; }
su_inline tag_value_t tag_bool_v(int v) { return v != 0; }
su_inline tag_value_t tag_bool_vr(int *vp) { return (tag_value_t)vp; }
su_inline tag_value_t tag_ptr_v(void *v) { return (tag_value_t)v; }
su_inline tag_value_t tag_ptr_vr(void *vp,
void *v) {return(tag_value_t)vp;}
su_inline tag_value_t tag_ptr_vr(void *vp, void *v)
{ (void)v; return(tag_value_t)vp; }
su_inline tag_value_t tag_cptr_v(void const *v) { return (tag_value_t)v; }
su_inline tag_value_t tag_cptr_vr(void *vp,
void const *v) {return(tag_value_t)vp;}
su_inline tag_value_t tag_cptr_vr(void *vp, void const *v)
{ (void)v; return(tag_value_t)vp; }
su_inline tag_value_t tag_cstr_v(char const *v) { return (tag_value_t)v; }
su_inline tag_value_t tag_cstr_vr(char const**vp) {return(tag_value_t)vp;}
su_inline tag_value_t tag_str_v(char const *v) { return (tag_value_t)v; }
......
......@@ -239,9 +239,10 @@ int su_wait(su_wait_t waits[], unsigned n, su_duration_t timeout)
return SU_WAIT_TIMEOUT;
if (i > 0) {
for (i = 0; i < n; i++) {
if (waits[i].revents)
return i;
unsigned j;
for (j = 0; j < n; j++) {
if (waits[j].revents)
return j;
}
}
......
......@@ -696,7 +696,7 @@ tport_test_run(tp_test_t *tt, unsigned timeout)
su_root_step(tt->tt_root, 500L);
if (!getenv("TPORT_TEST_DEBUG") &&
time(NULL) > now + timeout)
time(NULL) > (time_t)(now + timeout))
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment