From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:48360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hEba1-0005n1-59 for qemu-devel@nongnu.org; Thu, 11 Apr 2019 11:25:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hEbZz-0006kr-76 for qemu-devel@nongnu.org; Thu, 11 Apr 2019 11:25:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43406) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hEbZx-0006aI-6W for qemu-devel@nongnu.org; Thu, 11 Apr 2019 11:25:30 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2CAC6653FC for ; Thu, 11 Apr 2019 15:25:25 +0000 (UTC) From: Markus Armbruster Date: Thu, 11 Apr 2019 17:25:20 +0200 Message-Id: <20190411152520.10061-18-armbru@redhat.com> In-Reply-To: <20190411152520.10061-1-armbru@redhat.com> References: <20190411152520.10061-1-armbru@redhat.com> Subject: [Qemu-devel] [PATCH 17/17] include: Move fprintf_function to disas/ List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: dgilbert@redhat.com The previous commits have eliminated fprintf_function outside disassemblers, simplifying code and cleaning up the ugly type-punning fprintf_function seems to attract. Move fprintf_function to include/disas/dis-asm.h to reduce the temptation to abuse it. I considered renaming it to fprintf_ftype (reverting that part of commit 6e2d864edf5, v0.14.0) to get us closer to binutils, but I figure the fork is too distant to make this worthwhile. Signed-off-by: Markus Armbruster --- include/disas/dis-asm.h | 5 +++-- include/qemu/fprintf-fn.h | 14 -------------- 2 files changed, 3 insertions(+), 16 deletions(-) delete mode 100644 include/qemu/fprintf-fn.h diff --git a/include/disas/dis-asm.h b/include/disas/dis-asm.h index 41b61c85f9..9240ec32c2 100644 --- a/include/disas/dis-asm.h +++ b/include/disas/dis-asm.h @@ -9,8 +9,6 @@ #ifndef DISAS_BFD_H #define DISAS_BFD_H -#include "qemu/fprintf-fn.h" - typedef void *PTR; typedef uint64_t bfd_vma; typedef int64_t bfd_signed_vma; @@ -243,6 +241,9 @@ typedef struct symbol_cache_entry } udata; } asymbol; +typedef int (*fprintf_function)(FILE *f, const char *fmt, ...) + GCC_FMT_ATTR(2, 3); + enum dis_insn_type { dis_noninsn, /* Not a valid instruction */ dis_nonbranch, /* Not a branch instruction */ diff --git a/include/qemu/fprintf-fn.h b/include/qemu/fprintf-fn.h deleted file mode 100644 index 9068a960b3..0000000000 --- a/include/qemu/fprintf-fn.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Typedef for fprintf-alike function pointers. - * - * This work is licensed under the terms of the GNU GPL, version 2 or later. - * See the COPYING file in the top-level directory. - */ - -#ifndef QEMU_FPRINTF_FN_H -#define QEMU_FPRINTF_FN_H - -typedef int (*fprintf_function)(FILE *f, const char *fmt, ...) - GCC_FMT_ATTR(2, 3); - -#endif -- 2.17.2