fix ret/err bug in irc_conn_send, supress unused-argument warnings
authorTero Marttila <terom@fixme.fi>
Mon, 09 Mar 2009 16:30:30 +0200
changeset 24 08a26d0b9afd
parent 23 542c73d07d3c
child 25 56367df4ce5b
fix ret/err bug in irc_conn_send, supress unused-argument warnings
src/irc_conn.c
--- a/src/irc_conn.c	Sun Mar 08 17:17:37 2009 +0200
+++ b/src/irc_conn.c	Mon Mar 09 16:30:30 2009 +0200
@@ -11,6 +11,9 @@
  */
 static void on_RPL_WELCOME (struct irc_conn *conn, const struct irc_line *line, void *arg)
 {
+    (void) line;
+    (void) arg;
+
     // update state
     conn->registered = true;
 
@@ -24,6 +27,8 @@
  */ 
 static void on_PING (struct irc_conn *conn, const struct irc_line *line, void *arg)
 {
+    (void) arg;
+
     // just reply
     irc_conn_PONG(conn, line->args[0]);
 }
@@ -128,6 +133,7 @@
 {
     char line_buf[IRC_LINE_MAX + 2];
     err_t err;
+    int ret;
 
     // format
     if ((err = irc_line_build(line, line_buf)))
@@ -141,7 +147,7 @@
 
     // send using line_proto
     // XXX: ignore output-buffering
-    return (err = line_proto_send(conn->lp, line_buf)) < 0 ? err : SUCCESS;
+    return (ret = line_proto_send(conn->lp, line_buf)) < 0 ? -ret : SUCCESS;
 }
 
 err_t irc_conn_NICK (struct irc_conn *conn, const char *nickname)