Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/locale pacify lint.
details: https://anonhg.NetBSD.org/src/rev/e3e9d0238220
branches: trunk
changeset: 350351:e3e9d0238220
user: christos <christos%NetBSD.org@localhost>
date: Tue Jan 10 17:50:24 2017 +0000
description:
pacify lint.
diffstat:
lib/libc/locale/nl_langinfo.c | 108 +++++++++++++++++++++--------------------
1 files changed, 55 insertions(+), 53 deletions(-)
diffs (131 lines):
diff -r 3e51f6ede8f3 -r e3e9d0238220 lib/libc/locale/nl_langinfo.c
--- a/lib/libc/locale/nl_langinfo.c Tue Jan 10 17:46:47 2017 +0000
+++ b/lib/libc/locale/nl_langinfo.c Tue Jan 10 17:50:24 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nl_langinfo.c,v 1.17 2013/08/20 19:58:30 joerg Exp $ */
+/* $NetBSD: nl_langinfo.c,v 1.18 2017/01/10 17:50:24 christos Exp $ */
/*-
* Copyright (c)2008 Citrus Project,
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: nl_langinfo.c,v 1.17 2013/08/20 19:58:30 joerg Exp $");
+__RCSID("$NetBSD: nl_langinfo.c,v 1.18 2017/01/10 17:50:24 christos Exp $");
#include "namespace.h"
#include <sys/types.h>
@@ -102,59 +102,61 @@
[ ALT_DIGITS ] = 0,
};
+#define offsetofu16(a, b) ((uint16_t)offsetof(a, b))
+
static const uint16_t langinfo_offset[] = {
- [ D_T_FMT ] = offsetof(_TimeLocale, d_t_fmt),
- [ D_FMT ] = offsetof(_TimeLocale, d_fmt),
- [ T_FMT ] = offsetof(_TimeLocale, t_fmt),
- [ T_FMT_AMPM ] = offsetof(_TimeLocale, t_fmt_ampm),
- [ AM_STR ] = offsetof(_TimeLocale, am_pm[0]),
- [ PM_STR ] = offsetof(_TimeLocale, am_pm[1]),
- [ DAY_1 ] = offsetof(_TimeLocale, day[0]),
- [ DAY_2 ] = offsetof(_TimeLocale, day[1]),
- [ DAY_3 ] = offsetof(_TimeLocale, day[2]),
- [ DAY_4 ] = offsetof(_TimeLocale, day[3]),
- [ DAY_5 ] = offsetof(_TimeLocale, day[4]),
- [ DAY_6 ] = offsetof(_TimeLocale, day[5]),
- [ DAY_7 ] = offsetof(_TimeLocale, day[6]),
- [ ABDAY_1 ] = offsetof(_TimeLocale, abday[0]),
- [ ABDAY_2 ] = offsetof(_TimeLocale, abday[1]),
- [ ABDAY_3 ] = offsetof(_TimeLocale, abday[2]),
- [ ABDAY_4 ] = offsetof(_TimeLocale, abday[3]),
- [ ABDAY_5 ] = offsetof(_TimeLocale, abday[4]),
- [ ABDAY_6 ] = offsetof(_TimeLocale, abday[5]),
- [ ABDAY_7 ] = offsetof(_TimeLocale, abday[6]),
- [ MON_1 ] = offsetof(_TimeLocale, mon[0]),
- [ MON_2 ] = offsetof(_TimeLocale, mon[1]),
- [ MON_3 ] = offsetof(_TimeLocale, mon[2]),
- [ MON_4 ] = offsetof(_TimeLocale, mon[3]),
- [ MON_5 ] = offsetof(_TimeLocale, mon[4]),
- [ MON_6 ] = offsetof(_TimeLocale, mon[5]),
- [ MON_7 ] = offsetof(_TimeLocale, mon[6]),
- [ MON_8 ] = offsetof(_TimeLocale, mon[7]),
- [ MON_9 ] = offsetof(_TimeLocale, mon[8]),
- [ MON_10 ] = offsetof(_TimeLocale, mon[9]),
- [ MON_11 ] = offsetof(_TimeLocale, mon[10]),
- [ MON_12 ] = offsetof(_TimeLocale, mon[11]),
- [ ABMON_1 ] = offsetof(_TimeLocale, abmon[0]),
- [ ABMON_2 ] = offsetof(_TimeLocale, abmon[1]),
- [ ABMON_3 ] = offsetof(_TimeLocale, abmon[2]),
- [ ABMON_4 ] = offsetof(_TimeLocale, abmon[3]),
- [ ABMON_5 ] = offsetof(_TimeLocale, abmon[4]),
- [ ABMON_6 ] = offsetof(_TimeLocale, abmon[5]),
- [ ABMON_7 ] = offsetof(_TimeLocale, abmon[6]),
- [ ABMON_8 ] = offsetof(_TimeLocale, abmon[7]),
- [ ABMON_9 ] = offsetof(_TimeLocale, abmon[8]),
- [ ABMON_10 ] = offsetof(_TimeLocale, abmon[9]),
- [ ABMON_11 ] = offsetof(_TimeLocale, abmon[10]),
- [ ABMON_12 ] = offsetof(_TimeLocale, abmon[11]),
- [ RADIXCHAR ] = offsetof(_NumericLocale, decimal_point),
- [ THOUSEP ] = offsetof(_NumericLocale, thousands_sep),
- [ YESSTR ] = offsetof(_MessagesLocale, yesstr),
- [ YESEXPR ] = offsetof(_MessagesLocale, yesexpr),
- [ NOSTR ] = offsetof(_MessagesLocale, nostr),
- [ NOEXPR ] = offsetof(_MessagesLocale, noexpr),
+ [ D_T_FMT ] = offsetofu16(_TimeLocale, d_t_fmt),
+ [ D_FMT ] = offsetofu16(_TimeLocale, d_fmt),
+ [ T_FMT ] = offsetofu16(_TimeLocale, t_fmt),
+ [ T_FMT_AMPM ] = offsetofu16(_TimeLocale, t_fmt_ampm),
+ [ AM_STR ] = offsetofu16(_TimeLocale, am_pm[0]),
+ [ PM_STR ] = offsetofu16(_TimeLocale, am_pm[1]),
+ [ DAY_1 ] = offsetofu16(_TimeLocale, day[0]),
+ [ DAY_2 ] = offsetofu16(_TimeLocale, day[1]),
+ [ DAY_3 ] = offsetofu16(_TimeLocale, day[2]),
+ [ DAY_4 ] = offsetofu16(_TimeLocale, day[3]),
+ [ DAY_5 ] = offsetofu16(_TimeLocale, day[4]),
+ [ DAY_6 ] = offsetofu16(_TimeLocale, day[5]),
+ [ DAY_7 ] = offsetofu16(_TimeLocale, day[6]),
+ [ ABDAY_1 ] = offsetofu16(_TimeLocale, abday[0]),
+ [ ABDAY_2 ] = offsetofu16(_TimeLocale, abday[1]),
+ [ ABDAY_3 ] = offsetofu16(_TimeLocale, abday[2]),
+ [ ABDAY_4 ] = offsetofu16(_TimeLocale, abday[3]),
+ [ ABDAY_5 ] = offsetofu16(_TimeLocale, abday[4]),
+ [ ABDAY_6 ] = offsetofu16(_TimeLocale, abday[5]),
+ [ ABDAY_7 ] = offsetofu16(_TimeLocale, abday[6]),
+ [ MON_1 ] = offsetofu16(_TimeLocale, mon[0]),
+ [ MON_2 ] = offsetofu16(_TimeLocale, mon[1]),
+ [ MON_3 ] = offsetofu16(_TimeLocale, mon[2]),
+ [ MON_4 ] = offsetofu16(_TimeLocale, mon[3]),
+ [ MON_5 ] = offsetofu16(_TimeLocale, mon[4]),
+ [ MON_6 ] = offsetofu16(_TimeLocale, mon[5]),
+ [ MON_7 ] = offsetofu16(_TimeLocale, mon[6]),
+ [ MON_8 ] = offsetofu16(_TimeLocale, mon[7]),
+ [ MON_9 ] = offsetofu16(_TimeLocale, mon[8]),
+ [ MON_10 ] = offsetofu16(_TimeLocale, mon[9]),
+ [ MON_11 ] = offsetofu16(_TimeLocale, mon[10]),
+ [ MON_12 ] = offsetofu16(_TimeLocale, mon[11]),
+ [ ABMON_1 ] = offsetofu16(_TimeLocale, abmon[0]),
+ [ ABMON_2 ] = offsetofu16(_TimeLocale, abmon[1]),
+ [ ABMON_3 ] = offsetofu16(_TimeLocale, abmon[2]),
+ [ ABMON_4 ] = offsetofu16(_TimeLocale, abmon[3]),
+ [ ABMON_5 ] = offsetofu16(_TimeLocale, abmon[4]),
+ [ ABMON_6 ] = offsetofu16(_TimeLocale, abmon[5]),
+ [ ABMON_7 ] = offsetofu16(_TimeLocale, abmon[6]),
+ [ ABMON_8 ] = offsetofu16(_TimeLocale, abmon[7]),
+ [ ABMON_9 ] = offsetofu16(_TimeLocale, abmon[8]),
+ [ ABMON_10 ] = offsetofu16(_TimeLocale, abmon[9]),
+ [ ABMON_11 ] = offsetofu16(_TimeLocale, abmon[10]),
+ [ ABMON_12 ] = offsetofu16(_TimeLocale, abmon[11]),
+ [ RADIXCHAR ] = offsetofu16(_NumericLocale, decimal_point),
+ [ THOUSEP ] = offsetofu16(_NumericLocale, thousands_sep),
+ [ YESSTR ] = offsetofu16(_MessagesLocale, yesstr),
+ [ YESEXPR ] = offsetofu16(_MessagesLocale, yesexpr),
+ [ NOSTR ] = offsetofu16(_MessagesLocale, nostr),
+ [ NOEXPR ] = offsetofu16(_MessagesLocale, noexpr),
[ CRNCYSTR ] = 0,
- [ CODESET ] = offsetof(_RuneLocale, rl_codeset),
+ [ CODESET ] = offsetofu16(_RuneLocale, rl_codeset),
[ ERA ] = 0,
[ ERA_D_FMT ] = 0,
[ ERA_D_T_FMT ] = 0,
Home |
Main Index |
Thread Index |
Old Index