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.
This commit is contained in:
Alberts Muktupāvels 2015-07-10 21:54:14 +03:00
parent 26ea473077
commit b7bce32944
2 changed files with 11 additions and 11 deletions

View File

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

View File

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