mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-08 14:20:07 +00:00
Fix warnings when using <sys/select.h>.
gcc 4.4 is more picky. And the x86-64 version of <bits/select.h> contained a now unnecessary asm optimization. Remove it.
This commit is contained in:
parent
bfdb73e145
commit
eb0b6cb6e1
@ -1,3 +1,11 @@
|
||||
2009-06-14 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
[BZ #10229]
|
||||
* misc/sys/select.h (__NFDBITS): Expression should have type int.
|
||||
* sysdeps/x86_64/bits/select.h: Remove asm versions for __FD_SET,
|
||||
__FD_CLR, and __FD_ISSET. gcc nowadays generates better code from
|
||||
the C version.
|
||||
|
||||
2009-06-12 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* Versions.def: Add GLIBC_2.11 for libpthread.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* `fd_set' type and related macros, and `select'/`pselect' declarations.
|
||||
Copyright (C) 1996,97,98,99,2000,01,02,2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-2003, 2009 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -59,7 +59,7 @@ typedef long int __fd_mask;
|
||||
#undef __FDELT
|
||||
#undef __FDMASK
|
||||
/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */
|
||||
#define __NFDBITS (8 * sizeof (__fd_mask))
|
||||
#define __NFDBITS (8 * (int) sizeof (__fd_mask))
|
||||
#define __FDELT(d) ((d) / __NFDBITS)
|
||||
#define __FDMASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS))
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1997, 1998, 1999, 2001, 2008 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1997,1998,1999,2001,2008,2009 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -27,14 +27,8 @@
|
||||
|
||||
# if __WORDSIZE == 64
|
||||
# define __FD_ZERO_STOS "stosq"
|
||||
# define __FD_SET_BTS "btsq"
|
||||
# define __FD_CLR_BTR "btrq"
|
||||
# define __FD_ISSET_BT "btq"
|
||||
# else
|
||||
# define __FD_ZERO_STOS "stosl"
|
||||
# define __FD_SET_BTS "btsl"
|
||||
# define __FD_CLR_BTR "btrl"
|
||||
# define __FD_ISSET_BT "btl"
|
||||
# endif
|
||||
|
||||
# define __FD_ZERO(fdsp) \
|
||||
@ -48,26 +42,6 @@
|
||||
: "memory"); \
|
||||
} while (0)
|
||||
|
||||
# define __FD_SET(fd, fdsp) \
|
||||
__asm__ __volatile__ (__FD_SET_BTS " %1,%0" \
|
||||
: "=m" (__FDS_BITS (fdsp)[__FDELT (fd)]) \
|
||||
: "r" (((int) (fd)) % __NFDBITS) \
|
||||
: "cc","memory")
|
||||
# define __FD_CLR(fd, fdsp) \
|
||||
__asm__ __volatile__ (__FD_CLR_BTR " %1,%0" \
|
||||
: "=m" (__FDS_BITS (fdsp)[__FDELT (fd)]) \
|
||||
: "r" (((int) (fd)) % __NFDBITS) \
|
||||
: "cc","memory")
|
||||
# define __FD_ISSET(fd, fdsp) \
|
||||
(__extension__ \
|
||||
({register char __result; \
|
||||
__asm__ __volatile__ (__FD_ISSET_BT " %1,%2 ; setcb %b0" \
|
||||
: "=q" (__result) \
|
||||
: "r" (((int) (fd)) % __NFDBITS), \
|
||||
"m" (__FDS_BITS (fdsp)[__FDELT (fd)]) \
|
||||
: "cc"); \
|
||||
__result; }))
|
||||
|
||||
#else /* ! GNU CC */
|
||||
|
||||
/* We don't use `memset' because this would require a prototype and
|
||||
@ -79,8 +53,10 @@
|
||||
for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \
|
||||
__FDS_BITS (__arr)[__i] = 0; \
|
||||
} while (0)
|
||||
# define __FD_SET(d, set) (__FDS_BITS (set)[__FDELT (d)] |= __FDMASK (d))
|
||||
# define __FD_CLR(d, set) (__FDS_BITS (set)[__FDELT (d)] &= ~__FDMASK (d))
|
||||
# define __FD_ISSET(d, set) (__FDS_BITS (set)[__FDELT (d)] & __FDMASK (d))
|
||||
|
||||
#endif /* GNU CC */
|
||||
|
||||
#define __FD_SET(d, set) (__FDS_BITS (set)[__FDELT (d)] |= __FDMASK (d))
|
||||
#define __FD_CLR(d, set) (__FDS_BITS (set)[__FDELT (d)] &= ~__FDMASK (d))
|
||||
#define __FD_ISSET(d, set) \
|
||||
((__FDS_BITS (set)[__FDELT (d)] & __FDMASK (d)) != 0)
|
||||
|
Loading…
Reference in New Issue
Block a user