From: Yuval Shaia <yuval.shaia@oracle.com>
To: peter.maydell@linaro.org, qemu-devel@nongnu.org,
samuel.thibault@ens-lyon.org, jan.kiszka@siemens.com
Cc: yuval.shaia@oracle.com
Subject: [Qemu-devel] [PATCH] cutils: Define min and max marcos
Date: Fri, 25 Nov 2016 12:31:26 +0200 [thread overview]
Message-ID: <1480069886-11703-1-git-send-email-yuval.shaia@oracle.com> (raw)
Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
---
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 <math.h>
#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
--
1.8.3.1
next reply other threads:[~2016-11-25 10:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-25 10:31 Yuval Shaia [this message]
2016-11-25 15:26 ` [Qemu-devel] [PATCH] cutils: Define min and max marcos Markus Armbruster
2016-11-27 14:10 ` Samuel Thibault
2016-11-27 22:18 ` Yuval Shaia
2016-11-27 22:20 ` Samuel Thibault
2016-11-27 22:49 ` Yuval Shaia
2016-11-29 6:43 ` no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1480069886-11703-1-git-send-email-yuval.shaia@oracle.com \
--to=yuval.shaia@oracle.com \
--cc=jan.kiszka@siemens.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=samuel.thibault@ens-lyon.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).