From: Torbjorn SVENSSON <torbjorn.svensson@st.com>
To: "newlib@sourceware.org" <newlib@sourceware.org>
Subject: RE: [PATCH v2] libc/time: Move internal newlib tz-structs to local.h
Date: Thu, 15 Oct 2020 06:52:19 +0000 [thread overview]
Message-ID: <AM6PR10MB219746DD837C1C4D80D4465881020@AM6PR10MB2197.EURPRD10.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20201005125011.28344-1-torbjorn.svensson@st.com>
Ping!
-----Original Message-----
From: Torbjorn SVENSSON <torbjorn.svensson@st.com>
Sent: den 5 oktober 2020 14:50
To: newlib@sourceware.org
Cc: Torbjorn SVENSSON <torbjorn.svensson@st.com>; jjohnstn@redhat.com
Subject: [PATCH v2] libc/time: Move internal newlib tz-structs to local.h
As discussed in GCC bug 97088
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97088), parameters in
prototypes of library functions should use reserved names, or no name
at all.
This patch moves the internal struct __tzrule_struct from the public
API to the internal headerfile newlib/libc/time/local.h.
Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@st.com>
---
newlib/libc/include/time.h | 20 --------------------
newlib/libc/sys/linux/include/time.h | 20 --------------------
newlib/libc/sys/phoenix/include/time.h | 17 -----------------
newlib/libc/time/local.h | 19 +++++++++++++++++++
4 files changed, 19 insertions(+), 57 deletions(-)
diff --git a/newlib/libc/include/time.h b/newlib/libc/include/time.h
index 3031590b4..ed6cc70fe 100644
--- a/newlib/libc/include/time.h
+++ b/newlib/libc/include/time.h
@@ -102,26 +102,6 @@ void tzset (void);
#endif
void _tzset_r (struct _reent *);
-typedef struct __tzrule_struct
-{
- char ch;
- int m;
- int n;
- int d;
- int s;
- time_t change;
- long offset; /* Match type of _timezone. */
-} __tzrule_type;
-
-typedef struct __tzinfo_struct
-{
- int __tznorth;
- int __tzyear;
- __tzrule_type __tzrule[2];
-} __tzinfo_type;
-
-__tzinfo_type *__gettzinfo (void);
-
/* getdate functions */
#ifdef HAVE_GETDATE
diff --git a/newlib/libc/sys/linux/include/time.h b/newlib/libc/sys/linux/include/time.h
index 5e61d2b65..917a35858 100644
--- a/newlib/libc/sys/linux/include/time.h
+++ b/newlib/libc/sys/linux/include/time.h
@@ -84,26 +84,6 @@ char *strptime (const char *, const char *, struct tm *);
void tzset (void);
void _tzset_r (struct _reent *);
-typedef struct __tzrule_struct
-{
- char ch;
- int m;
- int n;
- int d;
- int s;
- time_t change;
- long offset; /* Match type of _timezone. */
-} __tzrule_type;
-
-typedef struct __tzinfo_struct
-{
- int __tznorth;
- int __tzyear;
- __tzrule_type __tzrule[2];
-} __tzinfo_type;
-
-__tzinfo_type *__gettzinfo (void);
-
/* getdate functions */
#ifndef _REENT_ONLY
diff --git a/newlib/libc/sys/phoenix/include/time.h b/newlib/libc/sys/phoenix/include/time.h
index 3a9449c77..41fb137e4 100644
--- a/newlib/libc/sys/phoenix/include/time.h
+++ b/newlib/libc/sys/phoenix/include/time.h
@@ -40,23 +40,6 @@ extern char *_tzname[2];
#define tzname _tzname
#endif
-typedef struct __tzrule_struct {
- char ch;
- int m;
- int n;
- int d;
- int s;
- time_t change;
- long offset;
-} __tzrule_type;
-
-typedef struct __tzinfo_struct {
- int __tznorth;
- int __tzyear;
- __tzrule_type __tzrule[2];
-} __tzinfo_type;
-
-__tzinfo_type *__gettzinfo();
void tzset();
clock_t clock();
diff --git a/newlib/libc/time/local.h b/newlib/libc/time/local.h
index dce51cda2..290e1aee5 100644
--- a/newlib/libc/time/local.h
+++ b/newlib/libc/time/local.h
@@ -38,3 +38,22 @@ void _tzset_unlocked (void);
void __tz_lock (void);
void __tz_unlock (void);
+typedef struct __tzrule_struct
+{
+ char ch;
+ int m; /* Month of year if ch=M */
+ int n; /* Week of month if ch=M */
+ int d; /* Day of week if ch=M, day of year if ch=J or ch=D */
+ int s; /* Time of day in seconds */
+ time_t change;
+ long offset; /* Match type of _timezone. */
+} __tzrule_type;
+
+typedef struct __tzinfo_struct
+{
+ int __tznorth;
+ int __tzyear;
+ __tzrule_type __tzrule[2];
+} __tzinfo_type;
+
+__tzinfo_type *__gettzinfo (void);
--
2.18.0
next prev parent reply other threads:[~2020-10-15 6:52 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-01 14:17 [PATCH 0/3] libc: Comply with the libstdc++ test case names.cc Torbjörn SVENSSON
2020-10-01 14:17 ` [PATCH 1/3] libc/include/inttypes.h: Remove parameter name Torbjörn SVENSSON
2020-10-01 23:22 ` Jeff Johnston
2020-10-02 6:52 ` Torbjorn SVENSSON
2020-10-02 6:53 ` nrupp
2020-10-02 21:01 ` Jeff Johnston
2020-10-01 14:17 ` [PATCH 2/3] libc/include/wchar.h: " Torbjörn SVENSSON
2020-10-01 23:24 ` Jeff Johnston
2020-10-02 6:53 ` Torbjorn SVENSSON
2020-10-02 21:02 ` Jeff Johnston
2020-10-01 14:17 ` [PATCH 3/3] libc: Replace one letter member names in __tzrule_struct Torbjörn SVENSSON
2020-10-01 23:21 ` Jeff Johnston
2020-10-02 7:36 ` Torbjorn SVENSSON
2020-10-02 21:04 ` Jeff Johnston
2020-10-05 12:50 ` [PATCH v2] libc/time: Move internal newlib tz-structs to local.h Torbjörn SVENSSON
2020-10-15 6:52 ` Torbjorn SVENSSON [this message]
2020-10-15 10:21 ` Corinna Vinschen
2020-10-15 16:47 ` Torbjorn SVENSSON
2020-10-15 17:09 ` Jeff Johnston
2020-10-15 17:15 ` Corinna Vinschen
2020-10-15 17:11 ` Corinna Vinschen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AM6PR10MB219746DD837C1C4D80D4465881020@AM6PR10MB2197.EURPRD10.PROD.OUTLOOK.COM \
--to=torbjorn.svensson@st.com \
--cc=newlib@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).