summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberts Muktupāvels <alberts.muktupavels@gmail.com>2015-07-10 21:54:14 +0300
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2015-09-09 14:14:15 +0300
commitb7bce3294492bbeb453bb56110b9ef8583ac4512 (patch)
tree4eda6bb679bf8f6cb48351c8cda1ee23c5486b86
parent26ea4730772039ca93dff3eaaa2636e514916e3c (diff)
downloadlibgnome-volume-control-b7bce3294492bbeb453bb56110b9ef8583ac4512.tar.gz
gvc-mixer-ui-device: make stream-id unsigned int
GvcMixerStream id is unsigned int and starts with 1, so we can use 0 as invalid id. This fixes build error/warning - comparison between signed and unsigned integer expressions.
-rw-r--r--gvc-mixer-ui-device.c18
-rw-r--r--gvc-mixer-ui-device.h4
2 files changed, 11 insertions, 11 deletions
diff --git a/gvc-mixer-ui-device.c b/gvc-mixer-ui-device.c
index df2628e..285a0c0 100644
--- a/gvc-mixer-ui-device.c
+++ b/gvc-mixer-ui-device.c
@@ -33,7 +33,7 @@ struct GvcMixerUIDevicePrivate
GvcMixerCard *card;
gchar *port_name;
char *icon_name;
- gint stream_id;
+ guint stream_id;
guint id;
gboolean port_available;
@@ -102,7 +102,7 @@ gvc_mixer_ui_device_get_property (GObject *object,
g_value_set_string (value, self->priv->port_name);
break;
case PROP_STREAM_ID:
- g_value_set_int (value, self->priv->stream_id);
+ g_value_set_uint (value, self->priv->stream_id);
break;
case PROP_UI_DEVICE_TYPE:
g_value_set_uint (value, (guint)self->priv->type);
@@ -152,7 +152,7 @@ gvc_mixer_ui_device_set_property (GObject *object,
self->priv->port_name);
break;
case PROP_STREAM_ID:
- self->priv->stream_id = g_value_get_int (value);
+ self->priv->stream_id = g_value_get_uint (value);
g_debug ("gvc-mixer-output-set-property - sink/source id: %i\n",
self->priv->stream_id);
break;
@@ -262,11 +262,11 @@ gvc_mixer_ui_device_class_init (GvcMixerUIDeviceClass *klass)
G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_PORT_NAME, pspec);
- pspec = g_param_spec_int ("stream-id",
- "stream id assigned by gvc-stream",
- "Set/Get stream id",
- -1,
- G_MAXINT,
+ pspec = g_param_spec_uint ("stream-id",
+ "stream id assigned by gvc-stream",
+ "Set/Get stream id",
+ 0,
+ G_MAXUINT,
GVC_MIXER_UI_DEVICE_INVALID,
G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_STREAM_ID, pspec);
@@ -600,7 +600,7 @@ gvc_mixer_ui_device_get_id (GvcMixerUIDevice *device)
return device->priv->id;
}
-gint
+guint
gvc_mixer_ui_device_get_stream_id (GvcMixerUIDevice *device)
{
g_return_val_if_fail (GVC_IS_MIXER_UI_DEVICE (device), 0);
diff --git a/gvc-mixer-ui-device.h b/gvc-mixer-ui-device.h
index 0256f4a..69095cb 100644
--- a/gvc-mixer-ui-device.h
+++ b/gvc-mixer-ui-device.h
@@ -31,7 +31,7 @@ G_BEGIN_DECLS
#define GVC_IS_MIXER_UI_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GVC_TYPE_MIXER_UI_DEVICE))
#define GVC_MIXER_UI_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GVC_TYPE_MIXER_UI_DEVICE, GvcMixerUIDeviceClass))
-#define GVC_MIXER_UI_DEVICE_INVALID -1
+#define GVC_MIXER_UI_DEVICE_INVALID 0
typedef struct GvcMixerUIDevicePrivate GvcMixerUIDevicePrivate;
@@ -55,7 +55,7 @@ typedef enum
GType gvc_mixer_ui_device_get_type (void) G_GNUC_CONST;
guint gvc_mixer_ui_device_get_id (GvcMixerUIDevice *device);
-gint gvc_mixer_ui_device_get_stream_id (GvcMixerUIDevice *device);
+guint gvc_mixer_ui_device_get_stream_id (GvcMixerUIDevice *device);
const gchar * gvc_mixer_ui_device_get_description (GvcMixerUIDevice *device);
const gchar * gvc_mixer_ui_device_get_icon_name (GvcMixerUIDevice *device);
GIcon * gvc_mixer_ui_device_get_gicon (GvcMixerUIDevice *device);