aboutsummaryrefslogtreecommitdiffstats
path: root/community/dircproxy/fix-gcc4-issue.patch
blob: a839ee8abc92a9fc3fbabfd04a21e412e2e0a00e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
From 35eee84559717e378bf11a882bea9cf0b1b95238 Mon Sep 17 00:00:00 2001
From: fharvey <fharvey@36e7e03e-8437-11dd-8f23-d9c8888c2974>
Date: Sun, 19 Feb 2006 16:46:06 +0000
Subject: [PATCH] Fix GCC 4.0 issue, tanks to lewk@*.edu. Close #39 and #46

---
 src/dcc_net.c    | 3 ++-
 src/irc_server.c | 6 ++++--
 src/net.c        | 3 +--
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/dcc_net.c b/src/dcc_net.c
index 6b90f29..1902561 100644
--- a/src/dcc_net.c
+++ b/src/dcc_net.c
@@ -368,7 +368,8 @@ int dccnet_expunge_proxies(void) {
       n = p->next;
       _dccnet_free(p);
 
-      p = (l ? l->next : proxies) = n;
+      if (l) l->next = n; else proxies = n;
+      p = n;
     } else {
       l = p;
       p = p->next;
diff --git a/src/irc_server.c b/src/irc_server.c
index 38f4768..4ffdfca 100644
--- a/src/irc_server.c
+++ b/src/irc_server.c
@@ -788,7 +788,8 @@ static int _ircserver_gotmsg(struct ircproxy *p, const char *str) {
               free(s);
 
               /* Was in the squelch list, so remove it and stop looking */
-              s = (l ? l->next : p->squelch_modes) = n;
+	      if (l) l->next = n; else p->squelch_modes = n;
+	      s = n;
               squelch = 1;
               break;
             } else {
@@ -829,7 +830,8 @@ static int _ircserver_gotmsg(struct ircproxy *p, const char *str) {
               free(s);
 
               /* Was in the squelch list, so remove it and stop looking */
-              s = (l ? l->next : p->squelch_modes) = n;
+	      if (l) l->next = n; else p->squelch_modes = n;
+	      s = n;
               squelch = 1;
               break;
             } else {
diff --git a/src/net.c b/src/net.c
index a971fea..8147acd 100644
--- a/src/net.c
+++ b/src/net.c
@@ -459,8 +459,7 @@ static int _net_buffer(struct sockinfo *s, int buff, int mode,
     return 0;
   }
   
-  l = &(buff == SB_IN ? s->in_buff_last : s->out_buff_last);
-
+  l = (buff == SB_IN) ? &s->in_buff_last : &s->out_buff_last;
   /* Check whether we can just add to the existing buffer */
   if ((mode == SM_RAW) && *l && ((*l)->mode == mode)) {
     (*l)->data = realloc((*l)->data, (*l)->len + len);