aboutsummaryrefslogtreecommitdiff
path: root/src/irc.c
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-04-09 06:19:28 -0400
committerB. Watson <urchlay@slackware.uk>2026-04-09 06:19:49 -0400
commitf3af088deabc1c3f90d22c43dcda9c5b8344bc86 (patch)
tree6fda6c8161aac8828a69dc1df1ff8bd9b701ed6e /src/irc.c
parent9d460b1c0cb573fc56799de236a1a8dd4cc6cdc0 (diff)
downloadfujinet-chat-f3af088deabc1c3f90d22c43dcda9c5b8344bc86.tar.gz
Rewrite the guts of print_ping_time() yet again. 7593 bytes free.
Diffstat (limited to 'src/irc.c')
-rw-r--r--src/irc.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/irc.c b/src/irc.c
index d052937..14bef03 100644
--- a/src/irc.c
+++ b/src/irc.c
@@ -107,7 +107,7 @@ static void do_priv_nick(void) {
}
}
-/* this ping calculation relies on the assumption that
+/* the ping calculation in jifsec.s relies on the assumption that
nobody's ping time will ever be more than 9 minutes. anyone
that lagged will have been disconnected from the server already.
if this assumption turns out to be false, the ping time displayed
@@ -119,19 +119,12 @@ static void do_priv_nick(void) {
the compiled code smaller, but it grew by ~50 bytes. avoid.
*/
static void print_ping_time(char *p) {
- extern void print_jif_sec(unsigned int j);
- static unsigned int now, pingtime;
-
- now = read_rtclok();
- pingtime = (unsigned int)a2uint(p);
-
- /* correct for rtclock rollover (every ~9 mins) */
- if(now < pingtime) now |= 0x8000;
+ extern void calc_ping_time(unsigned int j);
scr_print_active("*** ");
scr_print_active(msg_src);
scr_print_active(" lag: ");
- print_jif_sec(now - pingtime);
+ calc_ping_time(p);
scr_putc_active('s');
}