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] C99 initializers for login/tst-utmp.c


Hi.

Here's a small patch for switching the file to use C99 initializers.

Happy New Year to all.

Art Haas

2003-01-02  Art Haas  <ahaas@airmail.net>

	* login/tst-utmp.c: Convert GCC extension initializer syntax to
	C99.

Index: login/tst-utmp.c
===================================================================
RCS file: /cvs/glibc/libc/login/tst-utmp.c,v
retrieving revision 1.5
diff -u -r1.5 tst-utmp.c
--- login/tst-utmp.c	26 Aug 2002 11:36:07 -0000	1.5
+++ login/tst-utmp.c	2 Jan 2003 15:01:59 -0000
@@ -1,5 +1,5 @@
 /* Tests for UTMP functions.
-   Copyright (C) 1998, 2001-2002 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2001-2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Mark Kettenis <kettenis@phys.uva.nl>, 1998.
 
@@ -77,23 +77,23 @@
 struct utmp entry[] =
 {
 #if _HAVE_UT_TV || defined UTMPX
-#define UT(a)  ut_tv:{tv_sec:(a)}
+#define UT(a)  .ut_tv = { .tv_sec = (a)}
 #else
-#define UT(a)  ut_time:(a)
+#define UT(a)  .ut_time = (a)
 #endif
 
-  { ut_type: BOOT_TIME, ut_pid: 1, UT(1000) },
-  { ut_type: RUN_LVL, ut_pid: 1, UT(2000) },
-  { ut_type: INIT_PROCESS, ut_pid: 5, ut_id: "si", UT(3000) },
-  { ut_type: LOGIN_PROCESS, ut_pid: 23, ut_line: "tty1", ut_id: "1",
-    ut_user: "LOGIN", UT(4000) },
-  { ut_type: USER_PROCESS, ut_pid: 24, ut_line: "tty2", ut_id: "2",
-    ut_user: "albert", UT(8000) },
-  { ut_type: USER_PROCESS, ut_pid: 196, ut_line: "ttyp0", ut_id: "p0",
-    ut_user: "niels", UT(10000) },
-  { ut_type: DEAD_PROCESS, ut_line: "ttyp1", ut_id: "p1", UT(16000) },
-  { ut_type: EMPTY },
-  { ut_type: EMPTY }
+  { .ut_type = BOOT_TIME, .ut_pid = 1, UT(1000) },
+  { .ut_type = RUN_LVL, .ut_pid = 1, UT(2000) },
+  { .ut_type = INIT_PROCESS, .ut_pid = 5, .ut_id = "si", UT(3000) },
+  { .ut_type = LOGIN_PROCESS, .ut_pid = 23, .ut_line = "tty1", .ut_id = "1",
+    .ut_user = "LOGIN", UT(4000) },
+  { .ut_type = USER_PROCESS, .ut_pid = 24, .ut_line = "tty2", .ut_id = "2",
+    .ut_user = "albert", UT(8000) },
+  { .ut_type = USER_PROCESS, .ut_pid = 196, .ut_line = "ttyp0", .ut_id = "p0",
+    .ut_user = "niels", UT(10000) },
+  { .ut_type = DEAD_PROCESS, .ut_line = "ttyp1", .ut_id = "p1", UT(16000) },
+  { .ut_type = EMPTY },
+  { .ut_type = EMPTY }
 };
 int num_entries = sizeof entry / sizeof (struct utmp);
 
-- 
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]