This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc 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]

[PATCH] various C99 conversion for files in sysdeps


Hi.

Here are a set of patches for converting more files in the sysdeps/
directory to use the C99 initializer syntax. Many of these patches
I can not test as I don't have access to a system where these files
would be used, but files that would be pulled in on a build for
i586-pc-linux-gnu seem to be alright.

2002-12-16  Art Haas  <ahaas@airmail.net>

	* sysdeps/arm/bits/huge_val.h: Convert GCC extension initializer
	syntax to C99.
	* sysdeps/generic/bp-semctl.h: Same.
	* sysdeps/i386/bits/huge_val.h: Same.
	* sysdeps/ia64/bits/huge_val.h: Same.
	* sysdeps/ieee754/bits/huge_val.h: Same.
	* sysdeps/m68k/bits/huge_val.h: Same.
	* sysdeps/s390/bits/huge_val.h: Same.
	* sysdeps/sh/bits/huge_val.h: Same.
	* sysdeps/sh/sh4/fpu/bits/huge_val.h: Same.
	* sysdeps/sparc/sparc32/fpu/bits/huge_val.h: Same.
	* sysdeps/sparc/sparc64/fpu/bits/huge_val.h: Same.
	* sysdeps/unix/sysv/aix/setitimer.c: Same.
	* sysdeps/unix/sysv/aix/sleep.c: Same.
	* sysdeps/unix/sysv/aix/usleep.c: Same.

Index: sysdeps/arm/bits/huge_val.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/arm/bits/huge_val.h,v
retrieving revision 1.6
diff -u -r1.6 huge_val.h
--- sysdeps/arm/bits/huge_val.h	6 Jul 2001 04:55:48 -0000	1.6
+++ sysdeps/arm/bits/huge_val.h	16 Dec 2002 15:33:39 -0000
@@ -38,7 +38,7 @@
 #  define HUGE_VAL \
   (__extension__							      \
    ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; })   \
-    { __l: 0x000000007ff00000ULL }).__d)
+    { .__l = 0x000000007ff00000ULL }).__d)
 
 # endif
 
Index: sysdeps/generic/bp-semctl.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/generic/bp-semctl.h,v
retrieving revision 1.4
diff -u -r1.4 bp-semctl.h
--- sysdeps/generic/bp-semctl.h	6 Jul 2001 04:55:48 -0000	1.4
+++ sysdeps/generic/bp-semctl.h	16 Dec 2002 15:33:39 -0000
@@ -41,7 +41,7 @@
     case SETALL:
       {
 	struct semid_ds ds;
-	union semun un = { buf: &ds };
+	union semun un = { .buf = &ds };
 	unsigned int length = ~0;
 
 	/* It's unfortunate that we need to make a recursive
Index: sysdeps/i386/bits/huge_val.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/i386/bits/huge_val.h,v
retrieving revision 1.7
diff -u -r1.7 huge_val.h
--- sysdeps/i386/bits/huge_val.h	6 Jul 2001 04:55:53 -0000	1.7
+++ sysdeps/i386/bits/huge_val.h	16 Dec 2002 15:33:44 -0000
@@ -34,7 +34,7 @@
 # define __huge_val_t	union { unsigned char __c[8]; double __d; }
 # ifdef	__GNUC__
 #  define HUGE_VAL	(__extension__ \
-			 ((__huge_val_t) { __c: __HUGE_VAL_bytes }).__d)
+			 ((__huge_val_t) { .__c = __HUGE_VAL_bytes }).__d)
 # else	/* Not GCC.  */
 static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
 #  define HUGE_VAL	(__huge_val.__d)
@@ -58,7 +58,7 @@
 #  define __huge_valf_t	union { unsigned char __c[4]; float __f; }
 #  ifdef	__GNUC__
 #   define HUGE_VALF	(__extension__ \
-			 ((__huge_valf_t) { __c: __HUGE_VALF_bytes }).__f)
+			 ((__huge_valf_t) { .__c = __HUGE_VALF_bytes }).__f)
 #  else	/* Not GCC.  */
 static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes };
 #   define HUGE_VALF	(__huge_valf.__f)
@@ -70,7 +70,7 @@
 #  define __huge_vall_t	union { unsigned char __c[12]; long double __ld; }
 #  ifdef __GNUC__
 #   define HUGE_VALL	(__extension__ \
-			 ((__huge_vall_t) { __c: __HUGE_VALL_bytes }).__ld)
+			 ((__huge_vall_t) { .__c = __HUGE_VALL_bytes }).__ld)
 #  else	/* Not GCC.  */
 static __huge_vall_t __huge_vall = { __HUGE_VALL_bytes };
 #   define HUGE_VALL	(__huge_vall.__ld)
Index: sysdeps/ia64/bits/huge_val.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/ia64/bits/huge_val.h,v
retrieving revision 1.2
diff -u -r1.2 huge_val.h
--- sysdeps/ia64/bits/huge_val.h	6 Jul 2001 04:55:54 -0000	1.2
+++ sysdeps/ia64/bits/huge_val.h	16 Dec 2002 15:33:47 -0000
@@ -34,7 +34,7 @@
 # define __huge_val_t	union { unsigned char __c[8]; double __d; }
 # ifdef	__GNUC__
 #  define HUGE_VAL	(__extension__ \
-			 ((__huge_val_t) { __c: __HUGE_VAL_bytes }).__d)
+			 ((__huge_val_t) { .__c = __HUGE_VAL_bytes }).__d)
 # else	/* Not GCC.  */
 static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
 #  define HUGE_VAL	(__huge_val.__d)
@@ -58,7 +58,7 @@
 #  define __huge_valf_t	union { unsigned char __c[4]; float __f; }
 #  ifdef	__GNUC__
 #   define HUGE_VALF	(__extension__ \
-			 ((__huge_valf_t) { __c: __HUGE_VALF_bytes }).__f)
+			 ((__huge_valf_t) { .__c = __HUGE_VALF_bytes }).__f)
 #  else	/* Not GCC.  */
 static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes };
 #   define HUGE_VALF	(__huge_valf.__f)
@@ -70,7 +70,7 @@
 #  define __huge_vall_t	union { unsigned char __c[16]; long double __ld; }
 #  ifdef __GNUC__
 #   define HUGE_VALL	(__extension__ \
-			 ((__huge_vall_t) { __c: __HUGE_VALL_bytes }).__ld)
+			 ((__huge_vall_t) { .__c = __HUGE_VALL_bytes }).__ld)
 #  else	/* Not GCC.  */
 static __huge_vall_t __huge_vall = { __HUGE_VALL_bytes };
 #   define HUGE_VALL	(__huge_vall.__ld)
Index: sysdeps/ieee754/bits/huge_val.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/ieee754/bits/huge_val.h,v
retrieving revision 1.7
diff -u -r1.7 huge_val.h
--- sysdeps/ieee754/bits/huge_val.h	6 Jul 2001 04:55:54 -0000	1.7
+++ sysdeps/ieee754/bits/huge_val.h	16 Dec 2002 15:33:48 -0000
@@ -37,7 +37,7 @@
 #  define HUGE_VAL \
   (__extension__							      \
    ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; })   \
-    { __l: 0x7ff0000000000000ULL }).__d)
+    { .__l = 0x7ff0000000000000ULL }).__d)
 
 # endif
 
@@ -75,7 +75,7 @@
 #   define HUGE_VALF \
   (__extension__							      \
    ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; })    \
-    { __l: 0x7f800000UL }).__d)
+    { .__l = 0x7f800000UL }).__d)
 
 #  endif
 
Index: sysdeps/m68k/bits/huge_val.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/m68k/bits/huge_val.h,v
retrieving revision 1.6
diff -u -r1.6 huge_val.h
--- sysdeps/m68k/bits/huge_val.h	6 Jul 2001 04:55:55 -0000	1.6
+++ sysdeps/m68k/bits/huge_val.h	16 Dec 2002 15:33:49 -0000
@@ -39,7 +39,7 @@
 #  define HUGE_VAL					\
   (__extension__					\
    ((union { unsigned long long __l; double __d; })	\
-    { __l: 0x7ff0000000000000ULL }).__d)
+    { .__l = 0x7ff0000000000000ULL }).__d)
 
 # endif
 
@@ -68,12 +68,12 @@
 #   define HUGE_VALF					\
   (__extension__					\
    ((union { unsigned long __l; float __f; })		\
-    { __l: 0x7f800000UL }).__f)
+    { .__l = 0x7f800000UL }).__f)
 
 #   define HUGE_VALL					\
   (__extension__					\
    ((union { unsigned long __l[3]; long double __ld; })	\
-    { __l: { 0x7fff0000UL, 0x80000000UL, 0UL } }).__ld)
+    { .__l = { 0x7fff0000UL, 0x80000000UL, 0UL } }).__ld)
 
 #  else /* not GCC */
 
Index: sysdeps/s390/bits/huge_val.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/s390/bits/huge_val.h,v
retrieving revision 1.4
diff -u -r1.4 huge_val.h
--- sysdeps/s390/bits/huge_val.h	6 Jul 2001 04:56:02 -0000	1.4
+++ sysdeps/s390/bits/huge_val.h	16 Dec 2002 15:33:55 -0000
@@ -35,7 +35,7 @@
 # define __huge_val_t	union { unsigned char __c[8]; double __d; }
 # ifdef __GNUC__
 #  define HUGE_VAL	(__extension__ \
-			 ((__huge_val_t) { __c: __HUGE_VAL_bytes }).__d)
+			 ((__huge_val_t) { .__c = __HUGE_VAL_bytes }).__d)
 # else	/* Not GCC.  */
 static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
 #  define HUGE_VAL	(__huge_val.__d)
@@ -55,7 +55,7 @@
 #  define __huge_valf_t	union { unsigned char __c[4]; float __f; }
 #  ifdef	__GNUC__
 #   define HUGE_VALF	(__extension__ \
-			 ((__huge_valf_t) { __c: __HUGE_VALF_bytes }).__f)
+			 ((__huge_valf_t) { .__c = __HUGE_VALF_bytes }).__f)
 #  else	/* Not GCC.  */
 static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes };
 #   define HUGE_VALF	(__huge_valf.__f)
Index: sysdeps/sh/bits/huge_val.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/sh/bits/huge_val.h,v
retrieving revision 1.2
diff -u -r1.2 huge_val.h
--- sysdeps/sh/bits/huge_val.h	6 Jul 2001 04:56:03 -0000	1.2
+++ sysdeps/sh/bits/huge_val.h	16 Dec 2002 15:33:55 -0000
@@ -38,7 +38,7 @@
 #  define HUGE_VAL \
   (__extension__							      \
    ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; })   \
-    { __l: 0x000000007ff00000ULL }).__d)
+    { .__l = 0x000000007ff00000ULL }).__d)
 
 # endif
 
@@ -76,7 +76,7 @@
 #   define HUGE_VALF \
   (__extension__							      \
    ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; })    \
-    { __l: 0x7f800000UL }).__d)
+    { .__l = 0x7f800000UL }).__d)
 
 #  endif
 
Index: sysdeps/sh/sh4/fpu/bits/huge_val.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/sh/sh4/fpu/bits/huge_val.h,v
retrieving revision 1.2
diff -u -r1.2 huge_val.h
--- sysdeps/sh/sh4/fpu/bits/huge_val.h	6 Jul 2001 04:56:04 -0000	1.2
+++ sysdeps/sh/sh4/fpu/bits/huge_val.h	16 Dec 2002 15:33:56 -0000
@@ -39,7 +39,7 @@
 #  define HUGE_VAL \
   (__extension__							      \
    ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; })   \
-    { __l: 0x000000007ff00000ULL }).__d)
+    { .__l = 0x000000007ff00000ULL }).__d)
 
 # endif
 
@@ -77,7 +77,7 @@
 #   define HUGE_VALF \
   (__extension__							      \
    ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; })    \
-    { __l: 0x7f800000UL }).__d)
+    { .__l = 0x7f800000UL }).__d)
 
 #  endif
 
Index: sysdeps/sparc/sparc32/fpu/bits/huge_val.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/sparc/sparc32/fpu/bits/huge_val.h,v
retrieving revision 1.6
diff -u -r1.6 huge_val.h
--- sysdeps/sparc/sparc32/fpu/bits/huge_val.h	6 Jul 2001 04:56:04 -0000	1.6
+++ sysdeps/sparc/sparc32/fpu/bits/huge_val.h	16 Dec 2002 15:33:56 -0000
@@ -38,7 +38,7 @@
 #  define HUGE_VAL \
   (__extension__							      \
    ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; })   \
-    { __l: 0x7ff0000000000000ULL }).__d)
+    { .__l = 0x7ff0000000000000ULL }).__d)
 
 # endif
 
@@ -75,7 +75,7 @@
 #   define HUGE_VALF \
   (__extension__							      \
    ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; })    \
-    { __l: 0x7f800000UL }).__d)
+    { .__l = 0x7f800000UL }).__d)
 
 #  else /* not GCC */
 
@@ -102,7 +102,7 @@
 #    define HUGE_VALL \
   (__extension__									\
    ((union { struct { unsigned long __h, __l; } __i; long double __d; })		\
-    { __i: { __h: 0x7fff000000000000UL, __l: 0 } }).__d)
+    { .__i = { .__h = 0x7fff000000000000UL, .__l = 0 } }).__d)
 
 #   else /* not GCC */
 
Index: sysdeps/sparc/sparc64/fpu/bits/huge_val.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/sparc/sparc64/fpu/bits/huge_val.h,v
retrieving revision 1.6
diff -u -r1.6 huge_val.h
--- sysdeps/sparc/sparc64/fpu/bits/huge_val.h	6 Jul 2001 04:56:05 -0000	1.6
+++ sysdeps/sparc/sparc64/fpu/bits/huge_val.h	16 Dec 2002 15:33:56 -0000
@@ -38,7 +38,7 @@
 #  define HUGE_VAL \
   (__extension__							      \
    ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; })   \
-    { __l: 0x7ff0000000000000ULL }).__d)
+    { .__l = 0x7ff0000000000000ULL }).__d)
 
 # endif
 
@@ -75,7 +75,7 @@
 #   define HUGE_VALF \
   (__extension__							      \
    ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; })    \
-    { __l: 0x7f800000UL }).__d)
+    { .__l = 0x7f800000UL }).__d)
 
 #  else /* not GCC */
 
@@ -102,7 +102,7 @@
 #    define HUGE_VALL \
   (__extension__									\
    ((union { struct { unsigned long __h, __l; } __i; long double __d; })		\
-    { __i: { __h: 0x7fff000000000000UL, __l: 0 } }).__d)
+    { .__i = { .__h = 0x7fff000000000000UL, .__l = 0 } }).__d)
 
 #   else /* not GCC */
 
Index: sysdeps/unix/sysv/aix/setitimer.c
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/aix/setitimer.c,v
retrieving revision 1.2
diff -u -r1.2 setitimer.c
--- sysdeps/unix/sysv/aix/setitimer.c	6 Jul 2001 04:56:11 -0000	1.2
+++ sysdeps/unix/sysv/aix/setitimer.c	16 Dec 2002 15:33:59 -0000
@@ -56,7 +56,7 @@
     case -1: exit(-1);
     case  0:
        {
-        struct timespec ts ={tv_sec:(long int)new->it_value.tv_sec,tv_nsec:0};
+        struct timespec ts ={.tv_sec = (long int)new->it_value.tv_sec, .tv_nsec = 0};
         __libc_nanosleep(&ts,&ts);
 	__kill(getppid(), SIGALRM);
 	exit(0);
Index: sysdeps/unix/sysv/aix/sleep.c
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/aix/sleep.c,v
retrieving revision 1.2
diff -u -r1.2 sleep.c
--- sysdeps/unix/sysv/aix/sleep.c	6 Jul 2001 04:56:11 -0000	1.2
+++ sysdeps/unix/sysv/aix/sleep.c	16 Dec 2002 15:33:59 -0000
@@ -27,7 +27,7 @@
 __sleep (seconds)
      unsigned int seconds;
 {
-  struct timespec ts ={tv_sec:(long int)seconds,tv_nsec:0};
+  struct timespec ts ={.tv_sec = (long int)seconds, .tv_nsec = 0};
   __libc_nanosleep(&ts,&ts);
   return 0;
 }
Index: sysdeps/unix/sysv/aix/usleep.c
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/aix/usleep.c,v
retrieving revision 1.2
diff -u -r1.2 usleep.c
--- sysdeps/unix/sysv/aix/usleep.c	6 Jul 2001 04:56:11 -0000	1.2
+++ sysdeps/unix/sysv/aix/usleep.c	16 Dec 2002 15:33:59 -0000
@@ -28,7 +28,7 @@
 usleep (useconds)
      useconds_t useconds;
 {
-  struct timespec ts ={tv_sec:0,tv_nsec:(long int)useconds * 1000};
+  struct timespec ts ={.tv_sec = 0, .tv_nsec = (long int)useconds * 1000};
   __libc_nanosleep(&ts,&ts);
   return 0;
 }
-- 
They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety.
 -- Benjamin Franklin, Historical Review of Pennsylvania, 1759


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