cvs: php4 /ext/ircg ircg.c
| From: | Sascha Schumann | Date: | Wed, 12 Dec 2001 15:55:08 +0000 |
| Subject: | cvs: php4 /ext/ircg ircg.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-8588@lists.php.net to get a copy of this message | ||
sas Wed Dec 12 10:55:08 2001 EDT
Modified files:
/php4/ext/ircg ircg.c
Log:
Fix warnings and time_t/struct timeval braino
Index: php4/ext/ircg/ircg.c
diff -u php4/ext/ircg/ircg.c:1.123 php4/ext/ircg/ircg.c:1.124
--- php4/ext/ircg/ircg.c:1.123 Tue Dec 11 10:29:45 2001
+++ php4/ext/ircg/ircg.c Wed Dec 12 10:55:08 2001
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ircg.c,v 1.123 2001/12/11 15:29:45 sebastian Exp $ */
+/* $Id: ircg.c,v 1.124 2001/12/12 15:55:08 sas Exp $ */
/* {{{ includes */
@@ -209,6 +209,12 @@
static php_fmt_msgs_t fmt_msgs_default_compiled;
+static void format_msg(const format_msg_t *fmt_msg, smart_str *channel,
+ smart_str *to, smart_str *from, smart_str *msg, smart_str *result,
+ const char *username, int username_len);
+
+static void msg_send(php_irconn_t *conn, smart_str *msg);
+
/* }}} */
/* {{{ Default format messages */
@@ -695,16 +701,16 @@
break;
case -1: /* No message window yet. Buffer */
if (conn->buffer_count++ > 10) {
- time_t now;
+ struct timeval now;
smart_str_free_ex(msg, 1);
#if IRCG_API_VERSION >= 20010601
if (ircg_now_time_t != (time_t) 0)
- now = ircg_now_time_t;
+ now.tv_sec = ircg_now_time_t;
else
#endif
gettimeofday(&now, NULL);
- if ((now - conn->login) > 30)
+ if ((now.tv_sec - conn->login) > 30)
irc_disconnect(&conn->conn, "Timed out waiting for window");
return;
}
@@ -1755,6 +1761,7 @@
php_fmt_msgs_t *fmt_msgs = NULL;
php_irconn_t *conn;
int bailout_on_trivial = 1;
+ struct timeval tv;
if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 7
|| zend_get_parameters_ex(ZEND_NUM_ARGS(), &p1, &p2, &p3, &p4, &p5, &p6,
&p7) == FAILURE)
@@ -1839,7 +1846,10 @@
conn->login = ircg_now_time_t;
else
#endif
- gettimeofday(&conn->login, NULL);
+ {
+ gettimeofday(&tv, NULL);
+ conn->login = tv.tv_sec;
+ }
RETVAL_LONG(irconn_id);
}