From patchwork Thu Mar 31 11:35:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Huber X-Patchwork-Id: 52506 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 7C2A53876053 for ; Thu, 31 Mar 2022 11:38:06 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) by sourceware.org (Postfix) with ESMTPS id F15BA3839830 for ; Thu, 31 Mar 2022 11:35:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F15BA3839830 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embedded-brains.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embedded-brains.de Received: from sslproxy01.your-server.de ([78.46.139.224]) by dedi548.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nZt5K-000OPy-SW; Thu, 31 Mar 2022 13:35:26 +0200 Received: from [82.100.198.138] (helo=mail.embedded-brains.de) by sslproxy01.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nZt5F-000FlZ-Q0; Thu, 31 Mar 2022 13:35:21 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 6A2494800C9; Thu, 31 Mar 2022 13:35:21 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id U5oaxihq73Hx; Thu, 31 Mar 2022 13:35:21 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id DEB55480112; Thu, 31 Mar 2022 13:35:20 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id qXB2TL9siAza; Thu, 31 Mar 2022 13:35:20 +0200 (CEST) Received: from zimbra.eb.localhost (unknown [192.168.96.242]) by mail.embedded-brains.de (Postfix) with ESMTPSA id B0AB448010F; Thu, 31 Mar 2022 13:35:20 +0200 (CEST) From: Sebastian Huber To: gcc-patches@gcc.gnu.org Subject: [RFC/gcov 04/12] gcov: Make gcov_seek() static Date: Thu, 31 Mar 2022 13:35:07 +0200 Message-Id: <20220331113515.35764-5-sebastian.huber@embedded-brains.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220331113515.35764-1-sebastian.huber@embedded-brains.de> References: <20220331113515.35764-1-sebastian.huber@embedded-brains.de> MIME-Version: 1.0 X-Authenticated-Sender: smtp-embedded@poldinet.de X-Virus-Scanned: Clear (ClamAV 0.103.5/26498/Thu Mar 31 10:19:05 2022) X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" This function is only used by gcov_write_length() in the gcov-io.cc file. gcc/ * gcov-io.cc (gcov_seek): Make it static. * gcov-io.h (struct gcov_summary): Do not mention gcov_seek(). libgcc/ * libgcov.h (gcov_seek): Remove define and declaration. --- gcc/gcov-io.cc | 4 +--- gcc/gcov-io.h | 6 +++--- libgcc/libgcov.h | 2 -- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/gcc/gcov-io.cc b/gcc/gcov-io.cc index 017a6e32a5d..fee3130f94a 100644 --- a/gcc/gcov-io.cc +++ b/gcc/gcov-io.cc @@ -294,17 +294,15 @@ gcov_write_filename (const char *filename) gcov_write_string (filename); } -#endif /* Move to a given position in a gcov file. */ -GCOV_LINKAGE void +static void gcov_seek (gcov_position_t base) { fseek (gcov_var.file, base, SEEK_SET); } -#if !IN_LIBGCOV /* Write a tag TAG and reserve space for the record length. Return a value to be used for gcov_write_length. */ diff --git a/gcc/gcov-io.h b/gcc/gcov-io.h index afe74b002f1..204ae0ccf7f 100644 --- a/gcc/gcov-io.h +++ b/gcc/gcov-io.h @@ -340,9 +340,9 @@ struct gcov_summary /* Functions for reading and writing gcov files. In libgcov you can open the file for reading then writing. Elsewhere you can open the file either for reading or for writing. When reading a file you may - use the gcov_read_* functions, gcov_sync, gcov_position, & - gcov_error. When writing a file you may use the gcov_write - functions, gcov_seek & gcov_error. When a file is to be rewritten + use the gcov_read_* functions, gcov_sync, gcov_position, and + gcov_error. When writing a file you may use the gcov_write* + functions and gcov_error. When a file is to be rewritten you use the functions for reading, then gcov_rewrite then the functions for writing. Your file may become corrupted if you break these invariants. */ diff --git a/libgcc/libgcov.h b/libgcc/libgcov.h index f190547e819..487bd1464cd 100644 --- a/libgcc/libgcov.h +++ b/libgcc/libgcov.h @@ -115,7 +115,6 @@ typedef unsigned gcov_type_unsigned __attribute__ ((mode (QI))); #define gcov_open __gcov_open #define gcov_close __gcov_close #define gcov_position __gcov_position -#define gcov_seek __gcov_seek #define gcov_rewrite __gcov_rewrite #define gcov_is_error __gcov_is_error #define gcov_write_unsigned __gcov_write_unsigned @@ -346,7 +345,6 @@ extern int __gcov_execve (const char *, char *const [], char *const []) GCOV_LINKAGE void gcov_write_summary (gcov_unsigned_t /*tag*/, const struct gcov_summary *) ATTRIBUTE_HIDDEN; -GCOV_LINKAGE void gcov_seek (gcov_position_t /*position*/) ATTRIBUTE_HIDDEN; GCOV_LINKAGE void gcov_rewrite (void) ATTRIBUTE_HIDDEN; /* "Counts" stored in gcda files can be a real counter value, or