From 5c01fc8bd7f859e8af13c89d705510e59cb4270f Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Mon, 27 Jun 2022 12:04:33 -0500 Subject: [PATCH] Cast time_t to long long when printing --- extensions/m_ojoin.c | 2 +- include/messages.h | 4 ++-- ircd/client.c | 8 ++++---- librb/src/event.c | 4 ++-- modules/core/m_join.c | 2 +- modules/core/m_mode.c | 2 +- modules/m_stats.c | 4 ++-- modules/m_topic.c | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/extensions/m_ojoin.c b/extensions/m_ojoin.c index 3b04a71f..38b35d1e 100644 --- a/extensions/m_ojoin.c +++ b/extensions/m_ojoin.c @@ -134,7 +134,7 @@ mo_ojoin(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source sendto_one(source_p, form_str(RPL_TOPIC), me.name, source_p->name, chptr->chname, chptr->topic); sendto_one(source_p, form_str(RPL_TOPICWHOTIME), me.name, - source_p->name, chptr->chname, chptr->topic_info, chptr->topic_time); + source_p->name, chptr->chname, chptr->topic_info, (long long)chptr->topic_time); } source_p->localClient->last_join_time = rb_current_time(); diff --git a/include/messages.h b/include/messages.h index 9a587096..4e6b74e0 100644 --- a/include/messages.h +++ b/include/messages.h @@ -101,11 +101,11 @@ #define NUMERIC_STR_323 ":%s 323 %s :End of /LIST" #define NUMERIC_STR_324 ":%s 324 %s %s %s" #define NUMERIC_STR_325 ":%s 325 %s %s %s :is the current channel mode-lock" -#define NUMERIC_STR_329 ":%s 329 %s %s %lu" +#define NUMERIC_STR_329 ":%s 329 %s %s %lld" #define NUMERIC_STR_330 "%s %s :is logged in as" #define NUMERIC_STR_331 ":%s 331 %s %s :No topic is set." #define NUMERIC_STR_332 ":%s 332 %s %s :%s" -#define NUMERIC_STR_333 ":%s 333 %s %s %s %lu" +#define NUMERIC_STR_333 ":%s 333 %s %s %s %lld" #define NUMERIC_STR_337 "%s :%s" #define NUMERIC_STR_338 "%s %s :actually using host" #define NUMERIC_STR_341 ":%s 341 %s %s %s" diff --git a/ircd/client.c b/ircd/client.c index 3c332bb8..24738ae0 100644 --- a/ircd/client.c +++ b/ircd/client.c @@ -1573,11 +1573,11 @@ exit_local_server(struct Client *client_p, struct Client *source_p, struct Clien remove_dependents(client_p, source_p, from, IsPerson(from) ? newcomment : comment, comment1); sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s was connected" - " for %ld seconds. %d/%d sendK/recvK.", - source_p->name, (long) rb_current_time() - source_p->localClient->firsttime, sendk, recvk); + " for %lld seconds. %d/%d sendK/recvK.", + source_p->name, (long long)(rb_current_time() - source_p->localClient->firsttime), sendk, recvk); - ilog(L_SERVER, "%s was connected for %ld seconds. %d/%d sendK/recvK.", - source_p->name, (long) rb_current_time() - source_p->localClient->firsttime, sendk, recvk); + ilog(L_SERVER, "%s was connected for %lld seconds. %d/%d sendK/recvK.", + source_p->name, (long long)(rb_current_time() - source_p->localClient->firsttime), sendk, recvk); if(has_id(source_p)) del_from_id_hash(source_p->id, source_p); diff --git a/librb/src/event.c b/librb/src/event.c index 17589610..9f90b972 100644 --- a/librb/src/event.c +++ b/librb/src/event.c @@ -307,8 +307,8 @@ rb_dump_events(void (*func) (char *, void *), void *ptr) RB_DLINK_FOREACH(dptr, event_list.head) { ev = dptr->data; - snprintf(buf, sizeof buf, "%-28s %-4ld seconds (frequency=%d)", ev->name, - ev->when - (long)rb_current_time(), (int)ev->frequency); + snprintf(buf, sizeof buf, "%-28s %-4lld seconds (frequency=%d)", ev->name, + (long long)(ev->when - rb_current_time()), (int)ev->frequency); func(buf, ptr); } } diff --git a/modules/core/m_join.c b/modules/core/m_join.c index 18e9a1ca..c5cac107 100644 --- a/modules/core/m_join.c +++ b/modules/core/m_join.c @@ -374,7 +374,7 @@ m_join(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p sendto_one(source_p, form_str(RPL_TOPICWHOTIME), me.name, source_p->name, chptr->chname, chptr->topic_info, - (unsigned long)chptr->topic_time); + (long long)chptr->topic_time); } channel_member_names(chptr, source_p, 1); diff --git a/modules/core/m_mode.c b/modules/core/m_mode.c index ab054fd8..f78b59f4 100644 --- a/modules/core/m_mode.c +++ b/modules/core/m_mode.c @@ -132,7 +132,7 @@ m_mode(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p operspy ? channel_modes(chptr, &me) : channel_modes(chptr, source_p)); sendto_one(source_p, form_str(RPL_CREATIONTIME), - me.name, source_p->name, parv[1], chptr->channelts); + me.name, source_p->name, parv[1], (long long)chptr->channelts); } else { diff --git a/modules/m_stats.c b/modules/m_stats.c index 790472b3..50007bb6 100644 --- a/modules/m_stats.c +++ b/modules/m_stats.c @@ -960,8 +960,8 @@ stats_usage (struct Client *source_p) (int) (rus.ru_stime.tv_sec % 60)); sendto_one_numeric(source_p, RPL_STATSDEBUG, "R :RSS %ld ShMem %ld Data %ld Stack %ld", - rus.ru_maxrss, (rus.ru_ixrss / rup), - (rus.ru_idrss / rup), (rus.ru_isrss / rup)); + rus.ru_maxrss, (long)(rus.ru_ixrss / rup), + (long)(rus.ru_idrss / rup), (long)(rus.ru_isrss / rup)); sendto_one_numeric(source_p, RPL_STATSDEBUG, "R :Swaps %d Reclaims %d Faults %d", (int) rus.ru_nswap, (int) rus.ru_minflt, (int) rus.ru_majflt); diff --git a/modules/m_topic.c b/modules/m_topic.c index e4e734b2..214e4a94 100644 --- a/modules/m_topic.c +++ b/modules/m_topic.c @@ -173,7 +173,7 @@ m_topic(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_ sendto_one(source_p, form_str(RPL_TOPICWHOTIME), me.name, source_p->name, chptr->chname, chptr->topic_info, - (unsigned long)chptr->topic_time); + (long long)chptr->topic_time); } } }