This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Use const instead of __const


glibc now consistently uses the const keyword (ISO C90) instead of __const 
(originally for compatibility with traditional C - but traditional C 
support was actually removed long ago from both glibc and GCC).  I've 
applied these patches to update the ARM and MIPS ports.

Other ports should be updated similarly.  This isn't critical - both const 
and __const are keywords in GCC - but it's cleaner, more consistent with 
libc and may help with compatibility with non-GNU compilers, since the 
#define of __const to const for non-GNU compilers has been removed from 
sys/cdefs.h in libc.

diff --git a/ChangeLog.arm b/ChangeLog.arm
index 377439a..62531a4 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,5 +1,9 @@
 2012-01-08  Joseph Myers  <joseph@codesourcery.com>
 
+	* sysdeps/arm/eabi/bits/fenv.h: Use const instead of __const.
+
+2012-01-08  Joseph Myers  <joseph@codesourcery.com>
+
 	* sysdeps/arm/sysdep.h: Don't test or define NO_UNDERSCORES.
 	* sysdeps/unix/arm/start.c: Don't test HAVE_WEAK_SYMBOLS or
 	NO_UNDERSCORES.
diff --git a/sysdeps/arm/eabi/bits/fenv.h b/sysdeps/arm/eabi/bits/fenv.h
index 816ebe7..3bef398 100644
--- a/sysdeps/arm/eabi/bits/fenv.h
+++ b/sysdeps/arm/eabi/bits/fenv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2004, 2005, 2012 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
@@ -70,5 +70,5 @@ fenv_t;
 
 #ifdef __USE_GNU
 /* Floating-point environment where none of the exceptions are masked.  */
-# define FE_NOMASK_ENV  ((__const fenv_t *) -2)
+# define FE_NOMASK_ENV  ((const fenv_t *) -2)
 #endif
diff --git a/ChangeLog.mips b/ChangeLog.mips
index 73da420..81ea2a3 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,13 @@
+2012-01-08  Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/mips/bits/fenv.h: Use const instead of __const.
+	* sysdeps/unix/sysv/linux/mips/bits/resource.h: Likewise.
+	* sysdeps/unix/sysv/linux/mips/bits/socket.h: Likewise.
+	* sysdeps/unix/sysv/linux/mips/sys/cachectl.h: Likewise.
+	* sysdeps/unix/sysv/linux/mips/sys/epoll.h: Likewise.
+	* sysdeps/unix/sysv/linux/mips/sys/sysmips.h: Likewise.
+	* sysdeps/unix/sysv/linux/mips/sys/timerfd.h: Likewise.
+
 2012-01-07  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/mips/nptl/shlib-versions: New.
diff --git a/sysdeps/mips/bits/fenv.h b/sysdeps/mips/bits/fenv.h
index 24e0694..8efb890 100644
--- a/sysdeps/mips/bits/fenv.h
+++ b/sysdeps/mips/bits/fenv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2000, 2012 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
@@ -69,9 +69,9 @@ typedef struct
 fenv_t;
 
 /* If the default argument is used we use this value.  */
-#define FE_DFL_ENV	((__const fenv_t *) -1)
+#define FE_DFL_ENV	((const fenv_t *) -1)
 
 #ifdef __USE_GNU
 /* Floating-point environment where none of the exception is masked.  */
-# define FE_NOMASK_ENV  ((__const fenv_t *) -2)
+# define FE_NOMASK_ENV  ((const fenv_t *) -2)
 #endif
diff --git a/sysdeps/unix/sysv/linux/mips/bits/resource.h b/sysdeps/unix/sysv/linux/mips/bits/resource.h
index f64e9c0..519d736 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/resource.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/resource.h
@@ -1,6 +1,6 @@
 /* Bit values & structures for resource limits.  Linux/MIPS version.
    Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005, 2006, 2008,
-   2009, 2010, 2011 Free Software Foundation, Inc.
+   2009, 2010, 2011, 2012 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
@@ -254,13 +254,13 @@ __BEGIN_DECLS
 /* Modify and return resource limits of a process atomically.  */
 # ifndef __USE_FILE_OFFSET64
 extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource,
-		    __const struct rlimit *__new_limit,
+		    const struct rlimit *__new_limit,
 		    struct rlimit *__old_limit) __THROW;
 # else
 #  ifdef __REDIRECT_NTH
 extern int __REDIRECT_NTH (prlimit, (__pid_t __pid,
 				     enum __rlimit_resource __resource,
-				     __const struct rlimit *__new_limit,
+				     const struct rlimit *__new_limit,
 				     struct rlimit *__old_limit), prlimit64);
 #  else
 #   define prlimit prlimit64
@@ -268,7 +268,7 @@ extern int __REDIRECT_NTH (prlimit, (__pid_t __pid,
 # endif
 # ifdef __USE_LARGEFILE64
 extern int prlimit64 (__pid_t __pid, enum __rlimit_resource __resource,
-		      __const struct rlimit64 *__new_limit,
+		      const struct rlimit64 *__new_limit,
 		      struct rlimit64 *__old_limit) __THROW;
 # endif
 #endif
diff --git a/sysdeps/unix/sysv/linux/mips/bits/socket.h b/sysdeps/unix/sysv/linux/mips/bits/socket.h
index 4aacfae..cfd7dd7 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/socket.h
@@ -1,6 +1,6 @@
 /* System-specific socket constants and types.  Linux/MIPS version.
    Copyright (C) 1991, 92, 1994-1999, 2000, 2001, 2004, 2005, 2006, 2007, 2008,
-   2009, 2010, 2011 Free Software Foundation, Inc.
+   2009, 2010, 2011, 2012 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
@@ -424,7 +424,7 @@ __BEGIN_DECLS
    __THROW.  */
 extern int recvmmsg (int __fd, struct mmsghdr *__vmessages,
 		     unsigned int __vlen, int __flags,
-		     __const struct timespec *__tmo);
+		     const struct timespec *__tmo);
 
 /* Send a VLEN messages as described by VMESSAGES to socket FD.
    Return the number of datagrams successfully written or -1 for errors.
diff --git a/sysdeps/unix/sysv/linux/mips/sys/cachectl.h b/sysdeps/unix/sysv/linux/mips/sys/cachectl.h
index 3d9f914..650c609 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/cachectl.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/cachectl.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1995, 1996, 1997, 2000, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 2000, 2009, 2012
+   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
@@ -29,13 +30,13 @@
 __BEGIN_DECLS
 
 #ifdef __USE_MISC
-extern int cachectl (void *__addr, __const int __nbytes, __const int __op) __THROW;
+extern int cachectl (void *__addr, const int __nbytes, const int __op) __THROW;
 #endif
-extern int __cachectl (void *__addr, __const int __nbytes, __const int __op) __THROW;
+extern int __cachectl (void *__addr, const int __nbytes, const int __op) __THROW;
 #ifdef __USE_MISC
-extern int cacheflush (void *__addr, __const int __nbytes, __const int __op) __THROW;
+extern int cacheflush (void *__addr, const int __nbytes, const int __op) __THROW;
 #endif
-extern int _flush_cache (char *__addr, __const int __nbytes, __const int __op) __THROW;
+extern int _flush_cache (char *__addr, const int __nbytes, const int __op) __THROW;
 
 __END_DECLS
 
diff --git a/sysdeps/unix/sysv/linux/mips/sys/epoll.h b/sysdeps/unix/sysv/linux/mips/sys/epoll.h
index 51a657a..05b979b 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/epoll.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/epoll.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 2002-2006, 2007, 2008, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2006, 2007, 2008, 2011, 2012
+   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
@@ -137,7 +138,7 @@ extern int epoll_wait (int __epfd, struct epoll_event *__events,
    __THROW.  */
 extern int epoll_pwait (int __epfd, struct epoll_event *__events,
 			int __maxevents, int __timeout,
-			__const __sigset_t *__ss);
+			const __sigset_t *__ss);
 
 __END_DECLS
 
diff --git a/sysdeps/unix/sysv/linux/mips/sys/sysmips.h b/sysdeps/unix/sysv/linux/mips/sys/sysmips.h
index aefc52e..5534a1f 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/sysmips.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/sysmips.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1995, 1997, 2000, 2001, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1997, 2000, 2001, 2009, 2012
+   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
@@ -36,7 +37,7 @@
 
 __BEGIN_DECLS
 
-extern int sysmips (__const int __cmd, ...) __THROW;
+extern int sysmips (const int __cmd, ...) __THROW;
 
 __END_DECLS
 
diff --git a/sysdeps/unix/sysv/linux/mips/sys/timerfd.h b/sysdeps/unix/sysv/linux/mips/sys/timerfd.h
index ebd37ff..1238698 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/timerfd.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/timerfd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2008, 2012 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
@@ -49,7 +49,7 @@ extern int timerfd_create (clockid_t __clock_id, int __flags) __THROW;
    FLAGS has the TFD_TIMER_ABSTIME flag set the timeout value is
    absolute.  Optionally return the old expiration time in OTMR.  */
 extern int timerfd_settime (int __ufd, int __flags,
-			    __const struct itimerspec *__utmr,
+			    const struct itimerspec *__utmr,
 			    struct itimerspec *__otmr) __THROW;
 
 /* Return the next expiration time of UFD.  */

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]