[Spice-devel,spice-gtk,3/9] usb-device-manager: constify spice_usb_device_get_ functions

Submitted by Uri Lublin on March 25, 2013, 10:01 a.m.

Details

Message ID 1364205690-12784-4-git-send-email-uril@redhat.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Uri Lublin March 25, 2013, 10:01 a.m.
---
 gtk/usb-device-manager-priv.h |  8 ++++----
 gtk/usb-device-manager.c      | 16 ++++++++--------
 2 files changed, 12 insertions(+), 12 deletions(-)

Patch hide | download patch | download mbox

diff --git a/gtk/usb-device-manager-priv.h b/gtk/usb-device-manager-priv.h
index 51a38df..b6fa9c9 100644
--- a/gtk/usb-device-manager-priv.h
+++ b/gtk/usb-device-manager-priv.h
@@ -36,10 +36,10 @@  void spice_usb_device_manager_stop_event_listening(
 void spice_usb_device_manager_device_error(
     SpiceUsbDeviceManager *manager, SpiceUsbDevice *device, GError *err);

-guint8 spice_usb_device_get_busnum(SpiceUsbDevice *device);
-guint8 spice_usb_device_get_devaddr(SpiceUsbDevice *device);
-guint16 spice_usb_device_get_vid(SpiceUsbDevice *device);
-guint16 spice_usb_device_get_pid(SpiceUsbDevice *device);
+guint8 spice_usb_device_get_busnum(const SpiceUsbDevice *device);
+guint8 spice_usb_device_get_devaddr(const SpiceUsbDevice *device);
+guint16 spice_usb_device_get_vid(const SpiceUsbDevice *device);
+guint16 spice_usb_device_get_pid(const SpiceUsbDevice *device);

 #endif

diff --git a/gtk/usb-device-manager.c b/gtk/usb-device-manager.c
index eafed7c..4421c48 100644
--- a/gtk/usb-device-manager.c
+++ b/gtk/usb-device-manager.c
@@ -1477,36 +1477,36 @@  static SpiceUsbDeviceInfo *spice_usb_device_new(libusb_device *libdev)
     return info;
 }

-guint8 spice_usb_device_get_busnum(SpiceUsbDevice *device)
+guint8 spice_usb_device_get_busnum(const SpiceUsbDevice *device)
 {
-    SpiceUsbDeviceInfo *info = (SpiceUsbDeviceInfo *)device;
+    const SpiceUsbDeviceInfo *info = (const SpiceUsbDeviceInfo *)device;

     g_return_val_if_fail(info != NULL, 0);

     return info->busnum;
 }

-guint8 spice_usb_device_get_devaddr(SpiceUsbDevice *device)
+guint8 spice_usb_device_get_devaddr(const SpiceUsbDevice *device)
 {
-    SpiceUsbDeviceInfo *info = (SpiceUsbDeviceInfo *)device;
+    const SpiceUsbDeviceInfo *info = (const SpiceUsbDeviceInfo *)device;

     g_return_val_if_fail(info != NULL, 0);

     return info->devaddr;
 }

-guint16 spice_usb_device_get_vid(SpiceUsbDevice *device)
+guint16 spice_usb_device_get_vid(const SpiceUsbDevice *device)
 {
-    SpiceUsbDeviceInfo *info = (SpiceUsbDeviceInfo *)device;
+    const SpiceUsbDeviceInfo *info = (const SpiceUsbDeviceInfo *)device;

     g_return_val_if_fail(info != NULL, 0);

     return info->vid;
 }

-guint16 spice_usb_device_get_pid(SpiceUsbDevice *device)
+guint16 spice_usb_device_get_pid(const SpiceUsbDevice *device)
 {
-    SpiceUsbDeviceInfo *info = (SpiceUsbDeviceInfo *)device;
+    const SpiceUsbDeviceInfo *info = (const SpiceUsbDeviceInfo *)device;

     g_return_val_if_fail(info != NULL, 0);