From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by sourceware.org (Postfix) with ESMTPS id D906A3857802 for ; Mon, 5 Oct 2020 12:52:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D906A3857802 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 095ClGPc007757; Mon, 5 Oct 2020 14:52:36 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 3402tj0a72-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 05 Oct 2020 14:52:36 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 2375010002A; Mon, 5 Oct 2020 14:52:35 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag1node1.st.com [10.75.127.1]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 151722AE6AE; Mon, 5 Oct 2020 14:52:35 +0200 (CEST) Received: from localhost (10.75.127.44) by SFHDAG1NODE1.st.com (10.75.127.1) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 5 Oct 2020 14:52:34 +0200 From: =?UTF-8?q?Torbj=C3=B6rn=20SVENSSON?= To: Subject: [PATCH v2] libc/time: Move internal newlib tz-structs to local.h Date: Mon, 5 Oct 2020 14:50:13 +0200 Message-ID: <20201005125011.28344-1-torbjorn.svensson@st.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.75.127.44] X-ClientProxiedBy: SFHDAG5NODE1.st.com (10.75.127.13) To SFHDAG1NODE1.st.com (10.75.127.1) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-10-05_07:2020-10-02, 2020-10-05 signatures=0 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Oct 2020 12:52:40 -0000 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 --- 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