From 0cce01d388e60da92cf60a93b1459835c05d2bc1 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Sun, 13 Nov 2011 00:22:09 +0100 Subject: [PATCH] Fix -Wformat errors found in ircd-ratbox. We cannot use -Wformat meaningfully but ircd-ratbox trunk can. --- modules/core/m_join.c | 3 ++- modules/m_services.c | 2 +- modules/m_testline.c | 4 ++-- modules/m_topic.c | 3 ++- modules/m_trace.c | 10 +++++----- modules/m_users.c | 4 ++-- src/messages.tab | 8 ++++---- src/s_user.c | 13 +++++++------ 8 files changed, 25 insertions(+), 22 deletions(-) diff --git a/modules/core/m_join.c b/modules/core/m_join.c index f5edea230..052545269 100644 --- a/modules/core/m_join.c +++ b/modules/core/m_join.c @@ -363,7 +363,8 @@ m_join(struct Client *client_p, struct Client *source_p, int parc, const char *p sendto_one(source_p, form_str(RPL_TOPICWHOTIME), me.name, source_p->name, chptr->chname, - chptr->topic_info, chptr->topic_time); + chptr->topic_info, + (unsigned long)chptr->topic_time); } channel_member_names(chptr, source_p, 1); diff --git a/modules/m_services.c b/modules/m_services.c index 1bbc4db69..32a1622a7 100644 --- a/modules/m_services.c +++ b/modules/m_services.c @@ -330,7 +330,7 @@ h_svc_stats(hook_data_int *data) { sendto_one_numeric(data->client, RPL_STATSULINE, form_str(RPL_STATSULINE), - ptr->data, "*", "*", "s"); + (const char *)ptr->data, "*", "*", "s"); } } } diff --git a/modules/m_testline.c b/modules/m_testline.c index 05b7148b4..0eb1fcb63 100644 --- a/modules/m_testline.c +++ b/modules/m_testline.c @@ -149,14 +149,14 @@ mo_testline(struct Client *client_p, struct Client *source_p, int parc, const ch sendto_one(source_p, form_str(RPL_TESTLINE), me.name, source_p->name, '!', - duration / 60, + duration / 60L, host, "Reject cache"); if(aconf == NULL && (duration = is_throttle_ip((struct sockaddr *)&ip))) sendto_one(source_p, form_str(RPL_TESTLINE), me.name, source_p->name, '!', - duration / 60, + duration / 60L, host, "Throttled"); } diff --git a/modules/m_topic.c b/modules/m_topic.c index 15cc4756e..9effb2abf 100644 --- a/modules/m_topic.c +++ b/modules/m_topic.c @@ -163,7 +163,8 @@ m_topic(struct Client *client_p, struct Client *source_p, int parc, const char * sendto_one(source_p, form_str(RPL_TOPICWHOTIME), me.name, source_p->name, chptr->chname, - chptr->topic_info, chptr->topic_time); + chptr->topic_info, + (unsigned long)chptr->topic_time); } } diff --git a/modules/m_trace.c b/modules/m_trace.c index 25206e56c..4d273688c 100644 --- a/modules/m_trace.c +++ b/modules/m_trace.c @@ -386,8 +386,8 @@ report_this_status(struct Client *source_p, struct Client *target_p) sendto_one_numeric(source_p, tnumeric, form_str(tnumeric), class_name, name, show_ip(source_p, target_p) ? ip : empty_sockhost, - rb_current_time() - target_p->localClient->lasttime, - rb_current_time() - target_p->localClient->last); + (unsigned long)(rb_current_time() - target_p->localClient->lasttime), + (unsigned long)(rb_current_time() - target_p->localClient->last)); cnt++; } @@ -403,7 +403,8 @@ report_this_status(struct Client *source_p, struct Client *target_p) sendto_one_numeric(source_p, RPL_TRACESERVER, form_str(RPL_TRACESERVER), class_name, servcount, usercount, name, *(target_p->serv->by) ? target_p->serv->by : "*", "*", - me.name, rb_current_time() - target_p->localClient->lasttime); + me.name, + (unsigned long)(rb_current_time() - target_p->localClient->lasttime)); cnt++; } @@ -411,8 +412,7 @@ report_this_status(struct Client *source_p, struct Client *target_p) default: /* ...we actually shouldn't come here... --msa */ sendto_one_numeric(source_p, RPL_TRACENEWTYPE, - form_str(RPL_TRACENEWTYPE), - me.name, source_p->name, name); + form_str(RPL_TRACENEWTYPE), name); cnt++; break; } diff --git a/modules/m_users.c b/modules/m_users.c index 80b8b801d..32a15656d 100644 --- a/modules/m_users.c +++ b/modules/m_users.c @@ -56,9 +56,9 @@ m_users(struct Client *client_p, struct Client *source_p, int parc, const char * { sendto_one_numeric(source_p, RPL_LOCALUSERS, form_str(RPL_LOCALUSERS), - rb_dlink_list_length(&lclient_list), + (int)rb_dlink_list_length(&lclient_list), Count.max_loc, - rb_dlink_list_length(&lclient_list), + (int)rb_dlink_list_length(&lclient_list), Count.max_loc); sendto_one_numeric(source_p, RPL_GLOBALUSERS, diff --git a/src/messages.tab b/src/messages.tab index 63e852072..8e51e858e 100644 --- a/src/messages.tab +++ b/src/messages.tab @@ -232,7 +232,7 @@ static const char * replies[] = { /* 209 RPL_TRACECLASS, */ "Class %s %d", /* 210 */ NULL, /* 211 RPL_STATSLINKINFO, */ NULL, -/* 212 RPL_STATSCOMMANDS, */ "%s %u %u :%u", +/* 212 RPL_STATSCOMMANDS, */ "%s %u %lu :%u", /* 213 RPL_STATSCLINE, */ "C %s %s %s %d %s", /* 214 RPL_STATSNLINE, */ NULL, /* 215 RPL_STATSILINE, */ "I %s %s %s@%s %d %s", @@ -271,11 +271,11 @@ static const char * replies[] = { /* 248 RPL_STATSULINE, */ "U %s %s@%s %s", /* 249 RPL_STATSDEBUG */ NULL, -/* 250 RPL_STATSCONN, */ ":Highest connection count: %d (%d clients) (%d connections received)", +/* 250 RPL_STATSCONN, */ ":Highest connection count: %d (%d clients) (%lu connections received)", /* 251 RPL_LUSERCLIENT, */ ":There are %d users and %d invisible on %d servers", /* 252 RPL_LUSEROP, */ "%d :IRC Operators online", /* 253 RPL_LUSERUNKNOWN, */ "%d :unknown connection(s)", -/* 254 RPL_LUSERCHANNELS, */ "%d :channels formed", +/* 254 RPL_LUSERCHANNELS, */ "%lu :channels formed", /* 255 RPL_LUSERME, */ ":I have %d clients and %d servers", /* 256 RPL_ADMINME, */ ":Administrative info about %s", /* 257 RPL_ADMINLOC1, */ ":%s", @@ -343,7 +343,7 @@ static const char * replies[] = { /* 319 RPL_WHOISCHANNELS, */ ":%s 319 %s %s :", /* 320 */ NULL, /* 321 RPL_LISTSTART, */ ":%s 321 %s Channel :Users Name", -/* 322 RPL_LIST, */ ":%s 322 %s %s%s %d :%s", +/* 322 RPL_LIST, */ ":%s 322 %s %s%s %lu :%s", /* 323 RPL_LISTEND, */ ":%s 323 %s :End of /LIST", /* 324 RPL_CHANNELMODEIS, */ ":%s 324 %s %s %s", /* 325 RPL_CHANNELMLOCKIS, */ ":%s 325 %s %s %s :is the current channel mode-lock", diff --git a/src/s_user.c b/src/s_user.c index e3c7a2f2b..ce282f2e1 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -152,7 +152,8 @@ show_lusers(struct Client *source_p) sendto_one_numeric(source_p, RPL_LUSERCLIENT, form_str(RPL_LUSERCLIENT), (Count.total - Count.invisi), - Count.invisi, rb_dlink_list_length(&global_serv_list)); + Count.invisi, + (int)rb_dlink_list_length(&global_serv_list)); if(rb_dlink_list_length(&oper_list) > 0) sendto_one_numeric(source_p, RPL_LUSEROP, @@ -161,7 +162,7 @@ show_lusers(struct Client *source_p) if(rb_dlink_list_length(&unknown_list) > 0) sendto_one_numeric(source_p, RPL_LUSERUNKNOWN, form_str(RPL_LUSERUNKNOWN), - rb_dlink_list_length(&unknown_list)); + (int)rb_dlink_list_length(&unknown_list)); if(rb_dlink_list_length(&global_channel_list) > 0) sendto_one_numeric(source_p, RPL_LUSERCHANNELS, @@ -169,14 +170,14 @@ show_lusers(struct Client *source_p) rb_dlink_list_length(&global_channel_list)); sendto_one_numeric(source_p, RPL_LUSERME, form_str(RPL_LUSERME), - rb_dlink_list_length(&lclient_list), - rb_dlink_list_length(&serv_list)); + (int)rb_dlink_list_length(&lclient_list), + (int)rb_dlink_list_length(&serv_list)); sendto_one_numeric(source_p, RPL_LOCALUSERS, form_str(RPL_LOCALUSERS), - rb_dlink_list_length(&lclient_list), + (int)rb_dlink_list_length(&lclient_list), Count.max_loc, - rb_dlink_list_length(&lclient_list), + (int)rb_dlink_list_length(&lclient_list), Count.max_loc); sendto_one_numeric(source_p, RPL_GLOBALUSERS, form_str(RPL_GLOBALUSERS),