From patchwork Mon Feb 9 23:20:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 5007 Received: (qmail 15067 invoked by alias); 9 Feb 2015 23:35:45 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 15036 invoked by uid 89); 9 Feb 2015 23:35:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 09 Feb 2015 23:35:44 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t19NLcdv011726 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 9 Feb 2015 18:21:38 -0500 Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t19NKkuh026307 for ; Mon, 9 Feb 2015 18:21:37 -0500 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 18/36] Rename struct lzma_stream to avoid clash with system header Date: Mon, 9 Feb 2015 23:20:28 +0000 Message-Id: <1423524046-20605-19-git-send-email-palves@redhat.com> In-Reply-To: <1423524046-20605-1-git-send-email-palves@redhat.com> References: <1423524046-20605-1-git-send-email-palves@redhat.com> MIME-Version: 1.0 From: Tom Tromey /home/pedro/gdb/mygit/src/gdb/minidebug.c: At global scope: /home/pedro/gdb/mygit/src/gdb/minidebug.c:55:8: error: using typedef-name ‘lzma_stream’ after ‘struct’ struct lzma_stream ^ In file included from /usr/include/lzma.h:281:0, from /home/pedro/gdb/mygit/src/gdb/minidebug.c:28: /usr/include/lzma/base.h:498:3: note: ‘lzma_stream’ has a previous declaration here } lzma_stream; ^ gdb/ChangeLog: 2015-02-09 Tom Tromey * minidebug.c (struct lzma_stream): Rename to ... (struct gdb_lzma_stream): ... this. (lzma_open, lzma_pread, lzma_close, lzma_stat): Adjust. --- gdb/minidebug.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/gdb/minidebug.c b/gdb/minidebug.c index b6b6e89..cc20914 100644 --- a/gdb/minidebug.c +++ b/gdb/minidebug.c @@ -52,7 +52,7 @@ static lzma_allocator gdb_lzma_allocator = { alloc_lzma, free_lzma, NULL }; a section. This keeps only the last decompressed block in memory to allow larger data without using to much memory. */ -struct lzma_stream +struct gdb_lzma_stream { /* Section of input BFD from which we are decoding data. */ asection *section; @@ -70,8 +70,8 @@ struct lzma_stream find_separate_debug_file_in_section. OPEN_CLOSURE is 'asection *' of the section to decompress. - Return 'struct lzma_stream *' must be freed by caller by xfree, together - with its INDEX lzma data. */ + Return 'struct gdb_lzma_stream *' must be freed by caller by xfree, + together with its INDEX lzma data. */ static void * lzma_open (struct bfd *nbfd, void *open_closure) @@ -84,7 +84,7 @@ lzma_open (struct bfd *nbfd, void *open_closure) lzma_index *index; int ret; uint64_t memlimit = UINT64_MAX; - struct lzma_stream *lstream; + struct gdb_lzma_stream *lstream; size_t pos; size = bfd_get_section_size (section); @@ -118,7 +118,7 @@ lzma_open (struct bfd *nbfd, void *open_closure) } xfree (indexdata); - lstream = xzalloc (sizeof (struct lzma_stream)); + lstream = xzalloc (sizeof (struct gdb_lzma_stream)); lstream->section = section; lstream->index = index; @@ -127,13 +127,13 @@ lzma_open (struct bfd *nbfd, void *open_closure) /* bfd_openr_iovec PREAD_P implementation for find_separate_debug_file_in_section. Passed STREAM - is 'struct lzma_stream *'. */ + is 'struct gdb_lzma_stream *'. */ static file_ptr lzma_pread (struct bfd *nbfd, void *stream, void *buf, file_ptr nbytes, file_ptr offset) { - struct lzma_stream *lstream = stream; + struct gdb_lzma_stream *lstream = stream; bfd_size_type chunk_size; lzma_index_iter iter; gdb_byte *compressed, *uncompressed; @@ -214,13 +214,13 @@ lzma_pread (struct bfd *nbfd, void *stream, void *buf, file_ptr nbytes, /* bfd_openr_iovec CLOSE_P implementation for find_separate_debug_file_in_section. Passed STREAM - is 'struct lzma_stream *'. */ + is 'struct gdb_lzma_stream *'. */ static int lzma_close (struct bfd *nbfd, void *stream) { - struct lzma_stream *lstream = stream; + struct gdb_lzma_stream *lstream = stream; lzma_index_end (lstream->index, &gdb_lzma_allocator); xfree (lstream->data); @@ -232,14 +232,14 @@ lzma_close (struct bfd *nbfd, /* bfd_openr_iovec STAT_P implementation for find_separate_debug_file_in_section. Passed STREAM - is 'struct lzma_stream *'. */ + is 'struct gdb_lzma_stream *'. */ static int lzma_stat (struct bfd *abfd, void *stream, struct stat *sb) { - struct lzma_stream *lstream = stream; + struct gdb_lzma_stream *lstream = stream; sb->st_size = lzma_index_uncompressed_size (lstream->index); return 0;