aboutsummaryrefslogtreecommitdiff
path: root/chardev
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2020-08-31 17:07:33 -0400
committerEduardo Habkost <ehabkost@redhat.com>2020-09-09 09:27:09 -0400
commit8110fa1d94f2997badc2af39231a1d279c5bb1ee (patch)
tree6bff28c7907dfb0cbb367ca113f4d02ea03f3a51 /chardev
parentdb1015e92e04835c9eb50c29625fe566d1202dbd (diff)
Use DECLARE_*CHECKER* macros
Generated using: $ ./scripts/codeconverter/converter.py -i \ --pattern=TypeCheckMacro $(git grep -l '' -- '*.[ch]') Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-12-ehabkost@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-13-ehabkost@redhat.com> Message-Id: <20200831210740.126168-14-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'chardev')
-rw-r--r--chardev/baum.c3
-rw-r--r--chardev/char-pty.c3
-rw-r--r--chardev/char-ringbuf.c4
-rw-r--r--chardev/char-socket.c4
-rw-r--r--chardev/char-udp.c3
-rw-r--r--chardev/char-win-stdio.c4
-rw-r--r--chardev/chardev-internal.h3
-rw-r--r--chardev/msmouse.c4
-rw-r--r--chardev/testdev.c4
-rw-r--r--chardev/wctablet.c4
10 files changed, 20 insertions, 16 deletions
diff --git a/chardev/baum.c b/chardev/baum.c
index cb906060d9..5deca778bc 100644
--- a/chardev/baum.c
+++ b/chardev/baum.c
@@ -105,7 +105,8 @@ struct BaumChardev {
typedef struct BaumChardev BaumChardev;
#define TYPE_CHARDEV_BRAILLE "chardev-braille"
-#define BAUM_CHARDEV(obj) OBJECT_CHECK(BaumChardev, (obj), TYPE_CHARDEV_BRAILLE)
+DECLARE_INSTANCE_CHECKER(BaumChardev, BAUM_CHARDEV,
+ TYPE_CHARDEV_BRAILLE)
/* Let's assume NABCC by default */
enum way {
diff --git a/chardev/char-pty.c b/chardev/char-pty.c
index 963fe4f0ca..a2d1e7c985 100644
--- a/chardev/char-pty.c
+++ b/chardev/char-pty.c
@@ -45,7 +45,8 @@ struct PtyChardev {
};
typedef struct PtyChardev PtyChardev;
-#define PTY_CHARDEV(obj) OBJECT_CHECK(PtyChardev, (obj), TYPE_CHARDEV_PTY)
+DECLARE_INSTANCE_CHECKER(PtyChardev, PTY_CHARDEV,
+ TYPE_CHARDEV_PTY)
static void pty_chr_state(Chardev *chr, int connected);
diff --git a/chardev/char-ringbuf.c b/chardev/char-ringbuf.c
index 301a5d8634..d40d21d3cf 100644
--- a/chardev/char-ringbuf.c
+++ b/chardev/char-ringbuf.c
@@ -42,8 +42,8 @@ struct RingBufChardev {
};
typedef struct RingBufChardev RingBufChardev;
-#define RINGBUF_CHARDEV(obj) \
- OBJECT_CHECK(RingBufChardev, (obj), TYPE_CHARDEV_RINGBUF)
+DECLARE_INSTANCE_CHECKER(RingBufChardev, RINGBUF_CHARDEV,
+ TYPE_CHARDEV_RINGBUF)
static size_t ringbuf_count(const Chardev *chr)
{
diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index 9435b7d643..95e45812d5 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -88,8 +88,8 @@ struct SocketChardev {
};
typedef struct SocketChardev SocketChardev;
-#define SOCKET_CHARDEV(obj) \
- OBJECT_CHECK(SocketChardev, (obj), TYPE_CHARDEV_SOCKET)
+DECLARE_INSTANCE_CHECKER(SocketChardev, SOCKET_CHARDEV,
+ TYPE_CHARDEV_SOCKET)
static gboolean socket_reconnect_timeout(gpointer opaque);
static void tcp_chr_telnet_init(Chardev *chr);
diff --git a/chardev/char-udp.c b/chardev/char-udp.c
index 58be3487e6..16b5dbce58 100644
--- a/chardev/char-udp.c
+++ b/chardev/char-udp.c
@@ -45,7 +45,8 @@ struct UdpChardev {
};
typedef struct UdpChardev UdpChardev;
-#define UDP_CHARDEV(obj) OBJECT_CHECK(UdpChardev, (obj), TYPE_CHARDEV_UDP)
+DECLARE_INSTANCE_CHECKER(UdpChardev, UDP_CHARDEV,
+ TYPE_CHARDEV_UDP)
/* Called with chr_write_lock held. */
static int udp_chr_write(Chardev *chr, const uint8_t *buf, int len)
diff --git a/chardev/char-win-stdio.c b/chardev/char-win-stdio.c
index 980e0d1356..a4771ab82e 100644
--- a/chardev/char-win-stdio.c
+++ b/chardev/char-win-stdio.c
@@ -40,8 +40,8 @@ struct WinStdioChardev {
};
typedef struct WinStdioChardev WinStdioChardev;
-#define WIN_STDIO_CHARDEV(obj) \
- OBJECT_CHECK(WinStdioChardev, (obj), TYPE_CHARDEV_WIN_STDIO)
+DECLARE_INSTANCE_CHECKER(WinStdioChardev, WIN_STDIO_CHARDEV,
+ TYPE_CHARDEV_WIN_STDIO)
static void win_stdio_wait_func(void *opaque)
{
diff --git a/chardev/chardev-internal.h b/chardev/chardev-internal.h
index 2926a326e0..aba0240759 100644
--- a/chardev/chardev-internal.h
+++ b/chardev/chardev-internal.h
@@ -54,7 +54,8 @@ struct MuxChardev {
};
typedef struct MuxChardev MuxChardev;
-#define MUX_CHARDEV(obj) OBJECT_CHECK(MuxChardev, (obj), TYPE_CHARDEV_MUX)
+DECLARE_INSTANCE_CHECKER(MuxChardev, MUX_CHARDEV,
+ TYPE_CHARDEV_MUX)
#define CHARDEV_IS_MUX(chr) \
object_dynamic_cast(OBJECT(chr), TYPE_CHARDEV_MUX)
diff --git a/chardev/msmouse.c b/chardev/msmouse.c
index 0a7926697c..eb9231dcdb 100644
--- a/chardev/msmouse.c
+++ b/chardev/msmouse.c
@@ -45,8 +45,8 @@ struct MouseChardev {
typedef struct MouseChardev MouseChardev;
#define TYPE_CHARDEV_MSMOUSE "chardev-msmouse"
-#define MOUSE_CHARDEV(obj) \
- OBJECT_CHECK(MouseChardev, (obj), TYPE_CHARDEV_MSMOUSE)
+DECLARE_INSTANCE_CHECKER(MouseChardev, MOUSE_CHARDEV,
+ TYPE_CHARDEV_MSMOUSE)
static void msmouse_chr_accept_input(Chardev *chr)
{
diff --git a/chardev/testdev.c b/chardev/testdev.c
index bbae59c941..a92caca3c3 100644
--- a/chardev/testdev.c
+++ b/chardev/testdev.c
@@ -40,8 +40,8 @@ struct TestdevChardev {
typedef struct TestdevChardev TestdevChardev;
#define TYPE_CHARDEV_TESTDEV "chardev-testdev"
-#define TESTDEV_CHARDEV(obj) \
- OBJECT_CHECK(TestdevChardev, (obj), TYPE_CHARDEV_TESTDEV)
+DECLARE_INSTANCE_CHECKER(TestdevChardev, TESTDEV_CHARDEV,
+ TYPE_CHARDEV_TESTDEV)
/* Try to interpret a whole incoming packet */
static int testdev_eat_packet(TestdevChardev *testdev)
diff --git a/chardev/wctablet.c b/chardev/wctablet.c
index 361a12fdd4..95e005f5a5 100644
--- a/chardev/wctablet.c
+++ b/chardev/wctablet.c
@@ -86,8 +86,8 @@ struct TabletChardev {
typedef struct TabletChardev TabletChardev;
#define TYPE_CHARDEV_WCTABLET "chardev-wctablet"
-#define WCTABLET_CHARDEV(obj) \
- OBJECT_CHECK(TabletChardev, (obj), TYPE_CHARDEV_WCTABLET)
+DECLARE_INSTANCE_CHECKER(TabletChardev, WCTABLET_CHARDEV,
+ TYPE_CHARDEV_WCTABLET)
static void wctablet_chr_accept_input(Chardev *chr);