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>
This commit is contained in:
Eduardo Habkost 2020-08-31 17:07:33 -04:00
parent db1015e92e
commit 8110fa1d94
791 changed files with 1987 additions and 2423 deletions

View file

@ -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 {

View file

@ -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);

View file

@ -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)
{

View file

@ -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);

View file

@ -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)

View file

@ -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)
{

View file

@ -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)

View file

@ -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)
{

View file

@ -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)

View file

@ -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);