[PATCH spice-gtk 09/14] usb: use SPICE_CLIENT_ERROR_ prefix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



To be consistent with GLib idioms, the code should use a common prefix for errors.
---
 gtk/channel-usbredir.c |  4 ++--
 gtk/spice-client.h     | 11 +++++++++--
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/gtk/channel-usbredir.c b/gtk/channel-usbredir.c
index 239fe12..64487b3 100644
--- a/gtk/channel-usbredir.c
+++ b/gtk/channel-usbredir.c
@@ -654,12 +654,12 @@ static void usbredir_handle_msg(SpiceChannel *c, SpiceMsgIn *in)
             break;
         case usbredirhost_read_device_rejected:
             err = g_error_new(SPICE_CLIENT_ERROR,
-                              SPICE_CLIENT_USB_DEVICE_REJECTED,
+                              SPICE_CLIENT_ERROR_USB_DEVICE_REJECTED,
                               _("%s rejected by host"), desc);
             break;
         case usbredirhost_read_device_lost:
             err = g_error_new(SPICE_CLIENT_ERROR,
-                              SPICE_CLIENT_USB_DEVICE_LOST,
+                              SPICE_CLIENT_ERROR_USB_DEVICE_LOST,
                               _("%s disconnected (fatal IO error)"), desc);
             break;
         default:
diff --git a/gtk/spice-client.h b/gtk/spice-client.h
index 0e1e49d..e734cca 100644
--- a/gtk/spice-client.h
+++ b/gtk/spice-client.h
@@ -56,16 +56,23 @@ G_BEGIN_DECLS
 /**
  * SpiceClientError:
  * @SPICE_CLIENT_ERROR_FAILED: generic error code
+ * @SPICE_CLIENT_ERROR_USB_DEVICE_REJECTED: device redirection rejected by host
+ * @SPICE_CLIENT_ERROR_USB_DEVICE_LOST: device disconnected (fatal IO error)
  *
  * Error codes returned by spice-client API.
  */
 typedef enum
 {
     SPICE_CLIENT_ERROR_FAILED,
-    SPICE_CLIENT_USB_DEVICE_REJECTED,
-    SPICE_CLIENT_USB_DEVICE_LOST,
+    SPICE_CLIENT_ERROR_USB_DEVICE_REJECTED,
+    SPICE_CLIENT_ERROR_USB_DEVICE_LOST,
 } SpiceClientError;
 
+#ifndef SPICE_DISABLE_DEPRECATED
+#define SPICE_CLIENT_USB_DEVICE_REJECTED SPICE_CLIENT_ERROR_USB_DEVICE_REJECTED
+#define SPICE_CLIENT_USB_DEVICE_LOST SPICE_CLIENT_ERROR_USB_DEVICE_LOST
+#endif
+
 GQuark spice_client_error_quark(void);
 
 G_END_DECLS
-- 
1.8.5.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]