]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
rawmidi: substream_status: use uint64_t for avail and xrun properties
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sun, 14 Jun 2020 12:23:36 +0000 (21:23 +0900)
committer坂本 貴史 <o-takashi@sakamocchi.jp>
Sun, 14 Jun 2020 13:07:29 +0000 (22:07 +0900)
The avail and xrun members in struct snd_rawmidi_params are defined as
size_t type. The size_t is long type, thus the size is different between
32 bit ABI and 64 bit ABI. This commit uses uint64_t type for the
properties so that the size is the same as these two ABIs.

Fixes: 2371b927816d ("rawmidi: substream_status: add properties")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
src/rawmidi/substream-status.c

index 6dca740d7f60b71cc6481075f31ebc678f8e35de..a766517104f50d8592ebf5c2ecf8ef7f6cee84ed 100644 (file)
@@ -34,10 +34,10 @@ static void rawmidi_substream_status_get_property(GObject *obj, guint id,
 
     switch (id) {
     case RAWMIDI_SUBSTREAM_STATUS_PROP_AVAIL:
-        g_value_set_long(val, priv->status.avail);
+        g_value_set_uint64(val, priv->status.avail);
         break;
     case RAWMIDI_SUBSTREAM_STATUS_PROP_XRUN:
-        g_value_set_long(val, priv->status.xruns);
+        g_value_set_uint64(val, priv->status.xruns);
         break;
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, id, spec);
@@ -52,18 +52,18 @@ static void alsarawmidi_substream_status_class_init(ALSARawmidiSubstreamStatusCl
     gobject_class->get_property = rawmidi_substream_status_get_property;
 
     rawmidi_substream_status_props[RAWMIDI_SUBSTREAM_STATUS_PROP_AVAIL] =
-        g_param_spec_ulong("avail", "avail",
-               "The size of available space in intermediate buffer.",
-                          0, G_MAXULONG,
-                          0,
-                          G_PARAM_READABLE);
+        g_param_spec_uint64("avail", "avail",
+                            "The size of available space in intermediate buffer.",
+                            0, G_MAXUINT64,
+                            0,
+                            G_PARAM_READABLE);
 
     rawmidi_substream_status_props[RAWMIDI_SUBSTREAM_STATUS_PROP_XRUN] =
-        g_param_spec_ulong("xruns", "xruns",
-               "The count of XRUNs since the last query of status.",
-                           0, G_MAXULONG,
-                           0,
-                           G_PARAM_READABLE);
+        g_param_spec_uint64("xruns", "xruns",
+                            "The count of XRUNs since the last query of status.",
+                            0, G_MAXUINT64,
+                            0,
+                            G_PARAM_READABLE);
 
     g_object_class_install_properties(gobject_class,
                                       RAWMIDI_SUBSTREAM_STATUS_PROP_COUNT,