]> git.alsa-project.org Git - alsa-gobject.git/commitdiff
seq: user_client: remove useless argument of delete_port()
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Tue, 12 May 2020 02:06:48 +0000 (11:06 +0900)
committer坂本 貴史 <o-takashi@sakamocchi.jp>
Tue, 12 May 2020 02:48:24 +0000 (11:48 +0900)
In implementation of ALSA sequencer core, the port owned by client can
be deleted by userspace applications which opens the client, therefore
it's necessary and sufficient to have an argument just for the numerical
ID of port.

This commit removes the useless argument for port information.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
src/seq/user-client.c
src/seq/user-client.h

index 058613b09930d81ab2a134505f6bad99b98e3657..04052c171d9c095739a15c492440ee8779ea02fb 100644 (file)
@@ -269,28 +269,23 @@ void alsaseq_user_client_update_port(ALSASeqUserClient *self,
 /**
  * alsaseq_user_client_delete_port:
  * @self: A #ALSASeqUserClient.
- * @port_info: A #ALSASeqPortInfo.
  * @port_id: The numerical ID of port.
  * @error: A #GError.
  *
  * Delete a port from the client.
  */
 void alsaseq_user_client_delete_port(ALSASeqUserClient *self,
-                                     ALSASeqPortInfo *port_info,
                                      guint8 port_id, GError **error)
 {
     ALSASeqUserClientPrivate *priv;
-    struct snd_seq_port_info *info;
+    struct snd_seq_port_info info = {0};
 
     g_return_if_fail(ALSASEQ_IS_USER_CLIENT(self));
-    g_return_if_fail(ALSASEQ_IS_PORT_INFO(port_info));
     priv = alsaseq_user_client_get_instance_private(self);
 
-    seq_port_info_refer_private(port_info, &info);
-
-    info->addr.client = priv->client_id;
-    info->addr.port = port_id;
-    if (ioctl(priv->fd, SNDRV_SEQ_IOCTL_DELETE_PORT, info) < 0)
+    info.addr.client = priv->client_id;
+    info.addr.port = port_id;
+    if (ioctl(priv->fd, SNDRV_SEQ_IOCTL_DELETE_PORT, &info) < 0)
         generate_error(error, errno);
 }
 
index 74ff0a4906b5db6e682c36a019130224e037c4ff..7b703be2996a3f27a2b59a494c4f44caeafde1e5 100644 (file)
@@ -88,7 +88,6 @@ void alsaseq_user_client_update_port(ALSASeqUserClient *self,
                                      guint8 port_id, GError **error);
 
 void alsaseq_user_client_delete_port(ALSASeqUserClient *self,
-                                     ALSASeqPortInfo *port_info,
                                      guint8 port_id, GError **error);
 
 void alsaseq_user_client_set_pool(ALSASeqUserClient *self,