1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-07 02:03:13 +02:00

Fixed some portability bugs (patch #5271)

This commit is contained in:
Sebastien Helleu
2006-10-12 17:16:14 +00:00
parent 481e6f8e7f
commit 9b91c91577
16 changed files with 38 additions and 28 deletions
+2 -4
View File
@@ -856,7 +856,6 @@ irc_cmd_recv_notice (t_irc_server *server, char *host, char *nick, char *argumen
{
char *host2, *pos, *pos2, *pos_usec;
struct timeval tv;
struct timezone tz;
long sec1, usec1, sec2, usec2, difftime;
t_irc_channel *ptr_channel;
int highlight;
@@ -922,7 +921,7 @@ irc_cmd_recv_notice (t_irc_server *server, char *host, char *nick, char *argumen
{
pos2[0] = '\0';
gettimeofday (&tv, &tz);
gettimeofday (&tv, NULL);
sec1 = atol (pos);
usec1 = atol (pos_usec);
sec2 = tv.tv_sec;
@@ -1191,7 +1190,6 @@ int
irc_cmd_recv_pong (t_irc_server *server, char *host, char *nick, char *arguments)
{
struct timeval tv;
struct timezone tz;
int old_lag;
/* make gcc happy */
@@ -1203,7 +1201,7 @@ irc_cmd_recv_pong (t_irc_server *server, char *host, char *nick, char *arguments
{
/* calculate lag (time diff with lag check) */
old_lag = server->lag;
gettimeofday (&tv, &tz);
gettimeofday (&tv, NULL);
server->lag = (int) get_timeval_diff (&(server->lag_check_time), &tv);
if (old_lag != server->lag)
gui_status_draw (gui_current_window->buffer, 1);
+1 -2
View File
@@ -458,7 +458,6 @@ irc_cmd_send_ctcp (t_irc_server *server, t_irc_channel *channel,
{
char *pos_type, *pos_args, *pos;
struct timeval tv;
struct timezone tz;
/* make gcc happy */
(void) channel;
@@ -500,7 +499,7 @@ irc_cmd_send_ctcp (t_irc_server *server, t_irc_channel *channel,
if ((ascii_strcasecmp (pos_type, "ping") == 0) && (!pos_args))
{
gettimeofday (&tv, &tz);
gettimeofday (&tv, NULL);
server_sendf (server, "PRIVMSG %s :\01PING %d %d\01\r\n",
arguments, tv.tv_sec, tv.tv_usec);
gui_printf (server->buffer, " %s%d %d\n",
+4
View File
@@ -36,6 +36,10 @@
#include "../gui/gui.h"
#ifndef NI_MAXHOST
#define NI_MAXHOST 256
#endif
/* prefixes for chat window */
#define PREFIX_SERVER "-@-"