qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: "James Hogan" <james.hogan@imgtec.com>,
	patches@linaro.org, "Leon Alrae" <leon.alrae@imgtec.com>,
	"Andreas Färber" <afaerber@suse.de>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"Richard Henderson" <rth@twiddle.net>
Subject: [Qemu-devel] [PATCH 6/6] fpu: Replace uint8 typedef with uint8_t
Date: Tue, 12 Jan 2016 12:55:15 +0000	[thread overview]
Message-ID: <1452603315-27030-7-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1452603315-27030-1-git-send-email-peter.maydell@linaro.org>

Replace the uint8 softfloat-specific typedef with uint8_t.
This change was made with

find include hw fpu target-* -name '*.[ch]' | xargs sed -i -e 's/\buint8\b/uint8_t/g'

together with manual removal of the typedef definition and
manual fixing of more erroneous uses found via test compilation.

It turns out that the only code using this type is an accidental
use where uint8_t was intended anyway...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 crypto/secret.c         |  2 +-
 hw/net/vmware_utils.h   |  2 +-
 include/fpu/softfloat.h | 13 ++++---------
 migration/ram.c         |  2 +-
 4 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/crypto/secret.c b/crypto/secret.c
index 9a9257a..a799da1 100644
--- a/crypto/secret.c
+++ b/crypto/secret.c
@@ -434,7 +434,7 @@ int qcrypto_secret_lookup(const char *secretid,
         return -1;
     }
 
-    *data = g_new0(uint8, secret->rawlen + 1);
+    *data = g_new0(uint8_t, secret->rawlen + 1);
     memcpy(*data, secret->rawdata, secret->rawlen);
     (*data)[secret->rawlen] = '\0';
     *datalen = secret->rawlen;
diff --git a/hw/net/vmware_utils.h b/hw/net/vmware_utils.h
index c2c2f90..c0dbb2f 100644
--- a/hw/net/vmware_utils.h
+++ b/hw/net/vmware_utils.h
@@ -49,7 +49,7 @@ vmw_shmem_rw(hwaddr addr, void *buf, int len, int is_write)
 }
 
 static inline void
-vmw_shmem_set(hwaddr addr, uint8 val, int len)
+vmw_shmem_set(hwaddr addr, uint8_t val, int len)
 {
     int i;
     VMW_SHPRN("SHMEM set: %" PRIx64 ", len: %d (value 0x%X)", addr, len, val);
diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
index a6842ad..575a739 100644
--- a/include/fpu/softfloat.h
+++ b/include/fpu/softfloat.h
@@ -90,16 +90,11 @@ this code that are retained.
 #include "config-host.h"
 #include "qemu/osdep.h"
 
-/*----------------------------------------------------------------------------
-| Each of the following `typedef's defines the most convenient type that holds
-| integers of at least as many bits as specified.  For example, `uint8' should
-| be the most convenient type that can hold unsigned integers of as many as
-| 8 bits.  The `flag' type must be able to hold either a 0 or 1.  For most
-| implementations of C, `flag', `uint8', and `int8' should all be `typedef'ed
-| to the same as `int'.
-*----------------------------------------------------------------------------*/
+/* This 'flag' type must be able to hold at least 0 and 1. It should
+ * probably be replaced with 'bool' but the uses would need to be audited
+ * to check that they weren't accidentally relying on it being a larger type.
+ */
 typedef uint8_t flag;
-typedef uint8_t uint8;
 
 #define LIT64( a ) a##LL
 
diff --git a/migration/ram.c b/migration/ram.c
index 0490f00..73ed944 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -264,7 +264,7 @@ struct DecompressParam {
     QemuMutex mutex;
     QemuCond cond;
     void *des;
-    uint8 *compbuf;
+    uint8_t *compbuf;
     int len;
 };
 typedef struct DecompressParam DecompressParam;
-- 
1.9.1

  parent reply	other threads:[~2016-01-12 12:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-12 12:55 [Qemu-devel] [PATCH 0/6] Get rid of confusing softfloat-specific integer types Peter Maydell
2016-01-12 12:55 ` [Qemu-devel] [PATCH 1/6] fpu: Replace int64 typedef with int64_t Peter Maydell
2016-01-12 12:55 ` [Qemu-devel] [PATCH 2/6] fpu: Replace uint64 typedef with uint64_t Peter Maydell
2016-01-12 14:31   ` James Hogan
2016-01-12 17:08     ` Leon Alrae
2016-01-12 12:55 ` [Qemu-devel] [PATCH 3/6] fpu: Replace int32 typedef with int32_t Peter Maydell
2016-01-12 12:55 ` [Qemu-devel] [PATCH 4/6] fpu: Replace uint32 typedef with uint32_t Peter Maydell
2016-01-12 12:55 ` [Qemu-devel] [PATCH 5/6] fpu: Replace int8 typedef with int8_t Peter Maydell
2016-01-12 12:55 ` Peter Maydell [this message]
2016-01-12 15:58 ` [Qemu-devel] [PATCH 0/6] Get rid of confusing softfloat-specific integer types Richard Henderson
2016-01-12 16:59 ` Leon Alrae
2016-01-13 15:59 ` Aurelien Jarno
2016-01-19 15:24 ` Peter Maydell

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=1452603315-27030-7-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=afaerber@suse.de \
    --cc=aurelien@aurel32.net \
    --cc=james.hogan@imgtec.com \
    --cc=leon.alrae@imgtec.com \
    --cc=patches@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).