aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2024-08-07 17:09:44 +0200
committerCorinna Vinschen <corinna@vinschen.de>2024-08-07 17:10:03 +0200
commit50cf10dfa485682f08d2975d69cee0a3b63c81b9 (patch)
treeada53be7578e1c42b1d37a7a64400d5a6a8f67a7
parentf0c79f8ef7dad65f43bd4227ee3479c0e278781f (diff)
downloadnewlib-50cf10dfa485682f08d2975d69cee0a3b63c81b9.zip
newlib-50cf10dfa485682f08d2975d69cee0a3b63c81b9.tar.gz
newlib-50cf10dfa485682f08d2975d69cee0a3b63c81b9.tar.bz2
Cygwin: asm/socket.h: drop outdated casts
The _IOR anbd _IOW macros cast the sizeof of their third arg uselessly to long. The _IO definitions have been taken from BSD in 1995 and never changed again. The fact that the sizeof() gets cast to long is probably a remnant from the past when the stuff was supposed to be used on 16 bit machines, but the value was supposed to be 32 bit. Given that the values are not supposed to be ever bigger than 32 bit, we drop the (long) cast. Compare with current FreeBSD, which does not cast at all. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r--winsup/cygwin/include/asm/socket.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/winsup/cygwin/include/asm/socket.h b/winsup/cygwin/include/asm/socket.h
index 9aeb889..276df3a 100644
--- a/winsup/cygwin/include/asm/socket.h
+++ b/winsup/cygwin/include/asm/socket.h
@@ -17,8 +17,8 @@ details. */
#define IOC_IN 0x80000000 /* copy in parameters */
#define _IO(x,y) (IOC_VOID|(x<<8)|y)
-#define _IOR(x,y,t) (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y)
-#define _IOW(x,y,t) (IOC_IN|(((long)sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y)
+#define _IOR(x,y,t) (IOC_OUT|((sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y)
+#define _IOW(x,y,t) (IOC_IN|((sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y)
#define SIOCATMARK _IOR('s', 7, long) /* at oob mark? */
#define FIONREAD _IOR('f', 127, long) /* get # bytes to read */