summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-03-04 18:12:01 +0000
committerPeter Maydell <peter.maydell@linaro.org>2014-03-04 18:12:02 +0000
commitac458e121c398c8619b2a7735e87e37b73c0b687 (patch)
tree50880d4bb3bd0278f3b2af6720484f6651b7dd40
parente00ef747f08db1c7dd58a5366db4dc3038a7307f (diff)
parent25254a7191cdaa6cc10edb7bdbbfd0a6d02b9905 (diff)
downloadqemu-ac458e121c398c8619b2a7735e87e37b73c0b687.tar.gz
Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-2014-03-04' into staging
trivial patches for 2014-03-04 # gpg: Signature made Tue 04 Mar 2014 06:13:56 GMT using RSA key ID 74F0C838 # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>" # gpg: aka "Michael Tokarev <mjt@corpit.ru>" # gpg: aka "Michael Tokarev <mjt@debian.org>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D 4324 457C E0A0 8044 65C5 # Subkey fingerprint: E190 8639 3B10 B51B AC2C 8B73 5253 C5AD 74F0 C838 * remotes/mjt/tags/trivial-patches-2014-03-04: vl: Remove unneeded include file qga: Remove unneeded include file qemu-img: Remove unneeded include files exec: Remove unneeded include files util/iov: Use qemu/sockets.h instead of conditional code qjson.h: Remove spurious GCC_FMT_ATTR markup from qobject_from_json() declaration tests/test-int128: Don't use __noclone__ attribute on clang stubs: Optimize dependencies for gdbstub.c tcg: Fix typo in comment (dependancies -> dependencies) bswap: Modify prototypes of st[wl]_{le, be}_p (avoid type conversions) bswap: Modify prototype of stb_p (avoid type conversions) object: Report type in error when not user creatable. include/qemu/host-utils.h: Trivial typo: ctz->cto Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--exec.c4
-rw-r--r--include/qapi/qmp/qjson.h2
-rw-r--r--include/qemu/bswap.h10
-rw-r--r--include/qemu/host-utils.h2
-rw-r--r--qemu-img.c6
-rw-r--r--qga/main.c1
-rw-r--r--qmp.c4
-rw-r--r--stubs/gdbstub.c4
-rw-r--r--tcg/tcg.c2
-rw-r--r--tests/test-int128.c15
-rw-r--r--util/iov.c9
-rw-r--r--vl.c4
12 files changed, 29 insertions, 34 deletions
diff --git a/exec.c b/exec.c
index b69fd295f9..680268a163 100644
--- a/exec.c
+++ b/exec.c
@@ -17,9 +17,7 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
-#ifdef _WIN32
-#include <windows.h>
-#else
+#ifndef _WIN32
#include <sys/types.h>
#include <sys/mman.h>
#endif
diff --git a/include/qapi/qmp/qjson.h b/include/qapi/qmp/qjson.h
index 73351ed6d6..ee4d31a46a 100644
--- a/include/qapi/qmp/qjson.h
+++ b/include/qapi/qmp/qjson.h
@@ -19,7 +19,7 @@
#include "qapi/qmp/qobject.h"
#include "qapi/qmp/qstring.h"
-QObject *qobject_from_json(const char *string) GCC_FMT_ATTR(1, 0);
+QObject *qobject_from_json(const char *string);
QObject *qobject_from_jsonf(const char *string, ...) GCC_FMT_ATTR(1, 2);
QObject *qobject_from_jsonv(const char *string, va_list *ap) GCC_FMT_ATTR(1, 0);
diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h
index 437b8e0a9e..0cb7c05554 100644
--- a/include/qemu/bswap.h
+++ b/include/qemu/bswap.h
@@ -228,7 +228,7 @@ static inline int ldsb_p(const void *ptr)
return *(int8_t *)ptr;
}
-static inline void stb_p(void *ptr, int v)
+static inline void stb_p(void *ptr, uint8_t v)
{
*(uint8_t *)ptr = v;
}
@@ -300,12 +300,12 @@ static inline uint64_t ldq_le_p(const void *ptr)
return le_bswap(ldq_p(ptr), 64);
}
-static inline void stw_le_p(void *ptr, int v)
+static inline void stw_le_p(void *ptr, uint16_t v)
{
stw_p(ptr, le_bswap(v, 16));
}
-static inline void stl_le_p(void *ptr, int v)
+static inline void stl_le_p(void *ptr, uint32_t v)
{
stl_p(ptr, le_bswap(v, 32));
}
@@ -365,12 +365,12 @@ static inline uint64_t ldq_be_p(const void *ptr)
return be_bswap(ldq_p(ptr), 64);
}
-static inline void stw_be_p(void *ptr, int v)
+static inline void stw_be_p(void *ptr, uint16_t v)
{
stw_p(ptr, be_bswap(v, 16));
}
-static inline void stl_be_p(void *ptr, int v)
+static inline void stl_be_p(void *ptr, uint32_t v)
{
stl_p(ptr, be_bswap(v, 32));
}
diff --git a/include/qemu/host-utils.h b/include/qemu/host-utils.h
index de85d282d0..285c5fbab8 100644
--- a/include/qemu/host-utils.h
+++ b/include/qemu/host-utils.h
@@ -217,7 +217,7 @@ static inline int ctz64(uint64_t val)
}
/**
- * ctz64 - count trailing ones in a 64-bit value.
+ * cto64 - count trailing ones in a 64-bit value.
* @val: The value to search
*
* Returns 64 if the value is -1.
diff --git a/qemu-img.c b/qemu-img.c
index 78fc86826c..886db881b3 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -32,12 +32,6 @@
#include "block/block_int.h"
#include "block/qapi.h"
#include <getopt.h>
-#include <stdio.h>
-#include <stdarg.h>
-
-#ifdef _WIN32
-#include <windows.h>
-#endif
typedef struct img_cmd_t {
const char *name;
diff --git a/qga/main.c b/qga/main.c
index cfca291b43..d838c3e32a 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -35,7 +35,6 @@
#ifdef _WIN32
#include "qga/service-win32.h"
#include "qga/vss-win32.h"
-#include <windows.h>
#endif
#ifdef __linux__
#include <linux/fs.h>
diff --git a/qmp.c b/qmp.c
index d0d98e777b..f556a04d19 100644
--- a/qmp.c
+++ b/qmp.c
@@ -556,8 +556,8 @@ void object_add(const char *type, const char *id, const QDict *qdict,
}
if (!object_dynamic_cast(obj, TYPE_USER_CREATABLE)) {
- error_setg(&local_err, "object '%s' isn't supported by object-add",
- id);
+ error_setg(&local_err, "object type '%s' isn't supported by object-add",
+ type);
goto out;
}
diff --git a/stubs/gdbstub.c b/stubs/gdbstub.c
index c1dbfe7fb7..f6a4553a31 100644
--- a/stubs/gdbstub.c
+++ b/stubs/gdbstub.c
@@ -1,4 +1,6 @@
-#include "qemu-common.h"
+#include "stdbool.h" /* bool (in exec/gdbstub.h) */
+#include "stddef.h" /* NULL */
+#include "exec/gdbstub.h" /* xml_builtin */
const char *const xml_builtin[][2] = {
{ NULL, NULL }
diff --git a/tcg/tcg.c b/tcg/tcg.c
index ffc851e0c6..f1e0763432 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -41,7 +41,7 @@
#include "qemu/host-utils.h"
#include "qemu/timer.h"
-/* Note: the long term plan is to reduce the dependancies on the QEMU
+/* Note: the long term plan is to reduce the dependencies on the QEMU
CPU definitions. Currently they are used for qemu_ld/st
instructions */
#define NO_CPU_IO_DEFS
diff --git a/tests/test-int128.c b/tests/test-int128.c
index 5aca032e0c..0772ef7538 100644
--- a/tests/test-int128.c
+++ b/tests/test-int128.c
@@ -11,6 +11,19 @@
#include "qemu/int128.h"
#include "qemu/osdep.h"
+/* clang doesn't support __noclone__ but it does have a mechanism for
+ * telling us this. We assume that if we don't have __has_attribute()
+ * then this is GCC and that GCC always supports __noclone__.
+ */
+#if defined(__has_attribute)
+#if !__has_attribute(__noclone__)
+#define ATTRIBUTE_NOCLONE
+#endif
+#endif
+#ifndef ATTRIBUTE_NOCLONE
+#define ATTRIBUTE_NOCLONE __attribute__((__noclone__))
+#endif
+
static uint32_t tests[8] = {
0x00000000, 0x00000001, 0x7FFFFFFE, 0x7FFFFFFF,
0x80000000, 0x80000001, 0xFFFFFFFE, 0xFFFFFFFF,
@@ -164,7 +177,7 @@ static void test_gt(void)
/* Make sure to test undefined behavior at runtime! */
-static void __attribute__((__noinline__, __noclone__))
+static void __attribute__((__noinline__)) ATTRIBUTE_NOCLONE
test_rshift_one(uint32_t x, int n, uint64_t h, uint64_t l)
{
Int128 a = expand(x);
diff --git a/util/iov.c b/util/iov.c
index 03934da74d..6569b5aae1 100644
--- a/util/iov.c
+++ b/util/iov.c
@@ -17,14 +17,7 @@
*/
#include "qemu/iov.h"
-
-#ifdef _WIN32
-# include <windows.h>
-# include <winsock2.h>
-#else
-# include <sys/types.h>
-# include <sys/socket.h>
-#endif
+#include "qemu/sockets.h"
size_t iov_from_buf(const struct iovec *iov, unsigned int iov_cnt,
size_t offset, const void *buf, size_t bytes)
diff --git a/vl.c b/vl.c
index 52ee67e4be..685a7a9f45 100644
--- a/vl.c
+++ b/vl.c
@@ -38,10 +38,6 @@
#include <libvdeplug.h>
#endif
-#ifdef _WIN32
-#include <windows.h>
-#endif
-
#ifdef CONFIG_SDL
#if defined(__APPLE__) || defined(main)
#include <SDL.h>