From patchwork Mon Jun 1 14:07:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 39398 X-Patchwork-Delegate: l.majewski@majess.pl Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 40995388B01A; Mon, 1 Jun 2020 14:08:10 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by sourceware.org (Postfix) with ESMTPS id CACE2383F848 for ; Mon, 1 Jun 2020 14:08:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CACE2383F848 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=lukma@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 49bH7p6Lxcz1qsbQ; Mon, 1 Jun 2020 16:08:06 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 49bH7p60Yjz1qwwd; Mon, 1 Jun 2020 16:08:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id e0I59G3ogxWI; Mon, 1 Jun 2020 16:08:05 +0200 (CEST) X-Auth-Info: WMdUIZKiuBZdNRFiumRwAZyyvtogJM/qegXxxpIdnq4= Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Mon, 1 Jun 2020 16:08:05 +0200 (CEST) From: Lukasz Majewski To: Joseph Myers , Paul Eggert , Adhemerval Zanella Subject: [RFC 06/12] y2038: Rename timespec_sub to __timespec_sub Date: Mon, 1 Jun 2020 16:07:34 +0200 Message-Id: <20200601140740.16371-7-lukma@denx.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200601140740.16371-1-lukma@denx.de> References: <20200601140740.16371-1-lukma@denx.de> MIME-Version: 1.0 X-Spam-Status: No, score=-21.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Florian Weimer , GNU C Library , Andreas Schwab , Alistair Francis Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" As the timespec_sub is used locally in glibc, its name shall begin with "__". This change adds this prefix. Tested with glibc/glibc-many-build --keep failed glibcs --- support/timespec-sub.c | 2 +- support/timespec.c | 4 ++-- support/timespec.h | 2 +- sysdeps/mach/clock_nanosleep.c | 4 ++-- sysdeps/pthread/posix-timer.h | 4 ++-- sysdeps/pthread/timer_gettime.c | 2 +- sysdeps/pthread/timer_settime.c | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/support/timespec-sub.c b/support/timespec-sub.c index 535a3b155b..836f1e4f70 100644 --- a/support/timespec-sub.c +++ b/support/timespec-sub.c @@ -27,7 +27,7 @@ #include "intprops.h" struct timespec -timespec_sub (struct timespec a, struct timespec b) +__timespec_sub (struct timespec a, struct timespec b) { time_t rs = a.tv_sec; time_t bs = b.tv_sec; diff --git a/support/timespec.c b/support/timespec.c index ea6b947546..3647caed36 100644 --- a/support/timespec.c +++ b/support/timespec.c @@ -29,7 +29,7 @@ test_timespec_before_impl (const char *file, int line, || (left.tv_sec == right.tv_sec && left.tv_nsec > right.tv_nsec)) { support_record_failure (); - const struct timespec diff = timespec_sub (left, right); + const struct timespec diff = __timespec_sub (left, right); printf ("%s:%d: %jd.%09jds not before %jd.%09jds " "(difference %jd.%09jds)\n", file, line, @@ -48,7 +48,7 @@ test_timespec_equal_or_after_impl (const char *file, int line, || (left.tv_sec == right.tv_sec && left.tv_nsec < right.tv_nsec)) { support_record_failure (); - const struct timespec diff = timespec_sub (right, left); + const struct timespec diff = __timespec_sub (right, left); printf ("%s:%d: %jd.%09jds not after %jd.%09jds " "(difference %jd.%09jds)\n", file, line, diff --git a/support/timespec.h b/support/timespec.h index 08df1d473b..9fdcea2fa4 100644 --- a/support/timespec.h +++ b/support/timespec.h @@ -26,7 +26,7 @@ struct timespec timespec_add (struct timespec, struct timespec) __attribute__((const)); -struct timespec timespec_sub (struct timespec, struct timespec) +struct timespec __timespec_sub (struct timespec, struct timespec) __attribute__((const)); static inline struct timespec diff --git a/sysdeps/mach/clock_nanosleep.c b/sysdeps/mach/clock_nanosleep.c index 23ebc15274..bb3c76a8ac 100644 --- a/sysdeps/mach/clock_nanosleep.c +++ b/sysdeps/mach/clock_nanosleep.c @@ -53,8 +53,8 @@ nanosleep_call (const struct timespec *req, struct timespec *rem) { struct timespec after, elapsed; __clock_gettime (CLOCK_REALTIME, &after); - timespec_sub (&elapsed, &after, &before); - timespec_sub (rem, req, &elapsed); + __timespec_sub (&elapsed, &after, &before); + __timespec_sub (rem, req, &elapsed); } return EINTR; diff --git a/sysdeps/pthread/posix-timer.h b/sysdeps/pthread/posix-timer.h index 7d9207e23d..115e5c931d 100644 --- a/sysdeps/pthread/posix-timer.h +++ b/sysdeps/pthread/posix-timer.h @@ -145,8 +145,8 @@ timespec_add (struct timespec *sum, const struct timespec *left, } static inline void -timespec_sub (struct timespec *diff, const struct timespec *left, - const struct timespec *right) +__timespec_sub (struct timespec *diff, const struct timespec *left, + const struct timespec *right) { diff->tv_sec = left->tv_sec - right->tv_sec; diff->tv_nsec = left->tv_nsec - right->tv_nsec; diff --git a/sysdeps/pthread/timer_gettime.c b/sysdeps/pthread/timer_gettime.c index 6cbf87f434..3f5e1bbab1 100644 --- a/sysdeps/pthread/timer_gettime.c +++ b/sysdeps/pthread/timer_gettime.c @@ -52,7 +52,7 @@ timer_gettime (timer_t timerid, struct itimerspec *value) { __clock_gettime (clock, &now); if (__timespec_compare (&now, &expiry) < 0) - timespec_sub (&value->it_value, &expiry, &now); + __timespec_sub (&value->it_value, &expiry, &now); else { value->it_value.tv_sec = 0; diff --git a/sysdeps/pthread/timer_settime.c b/sysdeps/pthread/timer_settime.c index b84da6e09f..fe4b32089d 100644 --- a/sysdeps/pthread/timer_settime.c +++ b/sysdeps/pthread/timer_settime.c @@ -84,7 +84,7 @@ timer_settime (timer_t timerid, int flags, const struct itimerspec *value, timer_addref (timer); } - timespec_sub (&ovalue->it_value, &timer->expirytime, &now); + __timespec_sub (&ovalue->it_value, &timer->expirytime, &now); } else {