From patchwork Fri Nov 25 10:31:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuval Shaia X-Patchwork-Id: 9447753 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C766E6071B for ; Fri, 25 Nov 2016 15:01:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B77D727D13 for ; Fri, 25 Nov 2016 15:01:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA17D27F85; Fri, 25 Nov 2016 15:01:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6A4A327D13 for ; Fri, 25 Nov 2016 15:01:21 +0000 (UTC) Received: from localhost ([::1]:46464 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cAI08-0006F1-G8 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 25 Nov 2016 10:01:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cADnF-0007bH-HK for qemu-devel@nongnu.org; Fri, 25 Nov 2016 05:31:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cADnB-000176-FU for qemu-devel@nongnu.org; Fri, 25 Nov 2016 05:31:45 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:18709) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cADnB-00014V-9J for qemu-devel@nongnu.org; Fri, 25 Nov 2016 05:31:41 -0500 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uAPAVXmt001912 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 25 Nov 2016 10:31:34 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id uAPAVWGj008395 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 25 Nov 2016 10:31:33 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id uAPAVUCS008862; Fri, 25 Nov 2016 10:31:31 GMT Received: from yuval-lap.localdomain (/77.138.186.148) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 25 Nov 2016 02:31:30 -0800 From: Yuval Shaia To: peter.maydell@linaro.org, qemu-devel@nongnu.org, samuel.thibault@ens-lyon.org, jan.kiszka@siemens.com Date: Fri, 25 Nov 2016 12:31:26 +0200 Message-Id: <1480069886-11703-1-git-send-email-yuval.shaia@oracle.com> X-Mailer: git-send-email 1.8.3.1 X-Source-IP: userv0021.oracle.com [156.151.31.71] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 141.146.126.69 X-Mailman-Approved-At: Fri, 25 Nov 2016 09:59:32 -0500 Subject: [Qemu-devel] [PATCH] cutils: Define min and max marcos X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yuval.shaia@oracle.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Yuval Shaia --- disas/m68k.c | 5 +---- include/qemu/cutils.h | 3 +++ slirp/slirp.h | 6 +----- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/disas/m68k.c b/disas/m68k.c index 8e7c3f7..7794abc 100644 --- a/disas/m68k.c +++ b/disas/m68k.c @@ -2,6 +2,7 @@ sourceware.org CVS. Original file boundaries marked with **** */ #include "qemu/osdep.h" +#include "qemu/cutils.h" #include #include "disas/bfd.h" @@ -4698,10 +4699,6 @@ get_field (const unsigned char *data, enum floatformat_byteorders order, return result; } -#ifndef min -#define min(a, b) ((a) < (b) ? (a) : (b)) -#endif - /* Convert from FMT to a double. FROM is the address of the extended float. Store the double in *TO. */ diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h index 3e4ea23..9bf0e37 100644 --- a/include/qemu/cutils.h +++ b/include/qemu/cutils.h @@ -180,4 +180,7 @@ bool buffer_is_zero(const void *buf, size_t len); int uleb128_encode_small(uint8_t *out, uint32_t n); int uleb128_decode_small(const uint8_t *in, uint32_t *n); +#define min(x, y) ((x) < (y) ? (x) : (y)) +#define max(x, y) ((x) > (y) ? (x) : (y)) + #endif diff --git a/slirp/slirp.h b/slirp/slirp.h index a1f3139..3da8239 100644 --- a/slirp/slirp.h +++ b/slirp/slirp.h @@ -2,6 +2,7 @@ #define SLIRP_H #include "qemu/host-utils.h" +#include "qemu/cutils.h" #include "slirp_config.h" #ifdef _WIN32 @@ -292,9 +293,4 @@ int tcp_emu(struct socket *, struct mbuf *); int tcp_ctl(struct socket *); struct tcpcb *tcp_drop(struct tcpcb *tp, int err); -#ifndef _WIN32 -#define min(x,y) ((x) < (y) ? (x) : (y)) -#define max(x,y) ((x) > (y) ? (x) : (y)) -#endif - #endif