Skip to content

Commit

Permalink
Avoid warnings in CPU_* macros when using const bitsets.
Browse files Browse the repository at this point in the history
(cherry picked from commit 03ebadd)
  • Loading branch information
Ulrich Drepper authored and Petr Baudis committed Nov 19, 2009
1 parent b12103e commit 488e337
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2009-11-19 Ulrich Drepper <drepper@redhat.com>

[BZ #10918]
* sysdeps/unix/sysv/linux/bits/sched.h (__CPU_ISSET_S): Use __const
in cast to not throw away const-ness of parameters.
(__CPU_EQUAL_S): Likewise.
(__CPU_OP_S): Likewise.

2009-11-17 Paolo Bonzini <bonzini@gnu.org>

* posix/bug-regex30.c: New file.
Expand Down
12 changes: 6 additions & 6 deletions sysdeps/unix/sysv/linux/bits/sched.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Definitions of constants and data structure for POSIX 1003.1b-1993
scheduling interface.
Copyright (C) 1996-1999,2001-2003,2005,2006,2007,2008
Copyright (C) 1996-1999,2001-2003,2005,2006,2007,2008,2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Expand Down Expand Up @@ -154,7 +154,7 @@ typedef struct
(__extension__ \
({ size_t __cpu = (cpu); \
__cpu < 8 * (setsize) \
? ((((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \
? ((((__const __cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \
& __CPUMASK (__cpu))) != 0 \
: 0; }))

Expand All @@ -167,8 +167,8 @@ typedef struct
# else
# define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \
(__extension__ \
({ __cpu_mask *__arr1 = (cpusetp1)->__bits; \
__cpu_mask *__arr2 = (cpusetp2)->__bits; \
({ __const __cpu_mask *__arr1 = (cpusetp1)->__bits; \
__const __cpu_mask *__arr2 = (cpusetp2)->__bits; \
size_t __imax = (setsize) / sizeof (__cpu_mask); \
size_t __i; \
for (__i = 0; __i < __imax; ++__i) \
Expand All @@ -180,8 +180,8 @@ typedef struct
# define __CPU_OP_S(setsize, destset, srcset1, srcset2, op) \
(__extension__ \
({ cpu_set_t *__dest = (destset); \
__cpu_mask *__arr1 = (srcset1)->__bits; \
__cpu_mask *__arr2 = (srcset2)->__bits; \
__const __cpu_mask *__arr1 = (srcset1)->__bits; \
__const __cpu_mask *__arr2 = (srcset2)->__bits; \
size_t __imax = (setsize) / sizeof (__cpu_mask); \
size_t __i; \
for (__i = 0; __i < __imax; ++__i) \
Expand Down

0 comments on commit 488e337

Please sign in to comment.