# HG changeset patch
# User john.levon(a)sun.com
# Date 1229367890 28800
# Node ID 728f90c86f2cd950463923c80fc57754d6e762eb
# Parent 6a8e82d7d2e166880fed8d7ad860a3e2e93d62be
Cast callbacks to the correct type
Avoid compiler warnings by performing the correct casts.
Signed-off-by: John Levon <john.levon(a)sun.com>
diff --git a/src/libvirt.c b/src/libvirt.c
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -5806,7 +5806,8 @@ virConnectDomainEventRegister(virConnect
}
if ((conn->driver) && (conn->driver->domainEventRegister))
- return conn->driver->domainEventRegister (conn, cb, opaque, freecb);
+ return conn->driver->domainEventRegister (conn, (void *)cb,
+ opaque, freecb);
return -1;
}
@@ -5835,9 +5836,9 @@ virConnectDomainEventDeregister(virConne
return (-1);
}
if ((conn->driver) && (conn->driver->domainEventDeregister))
- return conn->driver->domainEventDeregister (conn, cb);
-
- return -1;
-}
-
-
+ return conn->driver->domainEventDeregister (conn, (void *)cb);
+
+ return -1;
+}
+
+
diff --git a/src/remote_internal.c b/src/remote_internal.c
--- a/src/remote_internal.c
+++ b/src/remote_internal.c
@@ -4735,7 +4735,7 @@ static int remoteDomainEventRegister (vi
return -1;
}
if (virDomainEventCallbackListAdd(conn, priv->callbackList,
- callback, opaque, freecb) < 0) {
+ (virConnectDomainEventCallback)callback, opaque, freecb) < 0) {
error (conn, VIR_ERR_RPC, _("adding cb to list"));
return -1;
}
@@ -4757,7 +4757,7 @@ static int remoteDomainEventDeregister (
struct private_data *priv = conn->privateData;
if (virDomainEventCallbackListRemove(conn, priv->callbackList,
- callback) < 0) {
+ (virConnectDomainEventCallback)callback) < 0) {
error (conn, VIR_ERR_RPC, _("removing cb fron list"));
return -1;
}
diff --git a/src/xen_unified.c b/src/xen_unified.c
--- a/src/xen_unified.c
+++ b/src/xen_unified.c
@@ -1372,7 +1372,7 @@ xenUnifiedDomainEventRegister (virConnec
conn->refs++;
return virDomainEventCallbackListAdd(conn, priv->domainEventCallbacks,
- callback, opaque, freefunc);
+ (virConnectDomainEventCallback)callback, opaque, freefunc);
}
static int
@@ -1387,7 +1387,7 @@ xenUnifiedDomainEventDeregister (virConn
}
ret = virDomainEventCallbackListRemove(conn, priv->domainEventCallbacks,
- callback);
+ (virConnectDomainEventCallback)callback);
virUnrefConnect(conn);
return ret;
}