fix lvalue casts

This commit is contained in:
espie 2010-05-22 16:16:45 +00:00
parent ec292b4bde
commit 01a00395e2
2 changed files with 21 additions and 4 deletions

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-configure,v 1.2 2004/07/12 06:16:50 jolan Exp $
--- configure.orig Wed Apr 21 00:12:50 2004
+++ configure Mon Jul 12 00:58:47 2004
@@ -2530,7 +2530,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l
$OpenBSD: patch-configure,v 1.3 2010/05/22 16:16:45 espie Exp $
--- configure.orig Wed Apr 21 07:12:50 2004
+++ configure Sat May 22 16:35:06 2010
@@ -2530,7 +2530,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-src_peer_c,v 1.3 2010/05/22 16:16:45 espie Exp $
--- src/peer.c.orig Sat May 22 18:12:27 2010
+++ src/peer.c Sat May 22 18:15:28 2010
@@ -458,11 +458,11 @@ static int rate_timer( btPeerStatus *ps, time_t now) {
#define SHIFT_INT32(ptr,nbo,ival) \
(nbo=htonl(ival), memcpy(ptr,&nbo,sizeof(int32_t)), ptr+=sizeof(int32_t))
-#define SHIFT_BYTE(ptr,ival) ((*((unsigned char *)(ptr))++) = ival)
+#define SHIFT_BYTE(ptr,ival) ((*((unsigned char *)(ptr)) = (ival)),((ptr)++))
#define UNSHIFT_INT32(ptr,nbo,ival) \
(memcpy(&nbo,ptr,sizeof(int32_t)), ival=ntohl(nbo), ptr+=sizeof(int32_t))
-#define UNSHIFT_BYTE(ptr,ival) (ival = (*((unsigned char *)(ptr))++)
+#define UNSHIFT_BYTE(ptr,ival) ((ival) = *((unsigned char *)(ptr)),(ptr)++)
/*
* Return 1 if there are more messages waiting
* Return 0 on success,