From: "Tanjeff-N. Moos" <tanjeff@cccmz.de>
To: alsa-devel@alsa-project.org
Cc: Takashi Iwai <tiwai@suse.de>, "Tanjeff-N. Moos" <tanjeff@cccmz.de>
Subject: [PATCH 2/2] control: Minor documentation fixes.
Date: Sun, 25 Oct 2020 16:43:41 +0100 [thread overview]
Message-ID: <20201025154341.15875-2-tanjeff@cccmz.de> (raw)
In-Reply-To: <20201025154341.15875-1-tanjeff@cccmz.de>
Signed-off-by: Tanjeff-N. Moos <tanjeff@cccmz.de>
---
include/control.h | 9 +++++++--
src/control/cards.c | 5 ++++-
src/control/control.c | 2 +-
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/include/control.h b/include/control.h
index e1a0da47..40353558 100644
--- a/include/control.h
+++ b/include/control.h
@@ -155,7 +155,7 @@ typedef struct _snd_ctl_elem_list snd_ctl_elem_list_t;
/** CTL element info container */
typedef struct _snd_ctl_elem_info snd_ctl_elem_info_t;
-/** CTL element value container
+/** CTL element value container.
*
* Contains the value(s) (i.e. members) of a single element. All
* values of a given element are of the same type.
@@ -167,6 +167,11 @@ typedef struct _snd_ctl_elem_info snd_ctl_elem_info_t;
* using the latter, it must be freed again using
* snd_ctl_elem_value_free().
*
+ * A value object can be zeroed out using snd_ctl_elem_value_clear().
+ *
+ * A value object can be copied to another one using
+ * snd_ctl_elem_value_copy().
+ *
* \par Identifier
*
* Then, the ID must be filled. It is sufficient to fill only the
@@ -614,7 +619,7 @@ size_t snd_ctl_elem_value_sizeof(void);
* \brief Allocate an invalid #snd_ctl_elem_value_t on the stack.
*
* Allocate space for a value object on the stack. The allocated
- * memory need not be freed, because is on the stack.
+ * memory need not be freed, because it is on the stack.
*
* See snd_ctl_elem_value_t for details.
*
diff --git a/src/control/cards.c b/src/control/cards.c
index 8226c42d..6145ebcd 100644
--- a/src/control/cards.c
+++ b/src/control/cards.c
@@ -147,6 +147,7 @@ int snd_card_get_index(const char *string)
return -EINVAL;
if ((isdigit(*string) && *(string + 1) == 0) ||
(isdigit(*string) && isdigit(*(string + 1)) && *(string + 2) == 0)) {
+ /* We got an index */
if (sscanf(string, "%i", &card) != 1)
return -EINVAL;
if (card < 0 || card >= SND_MAX_CARDS)
@@ -156,8 +157,10 @@ int snd_card_get_index(const char *string)
return card;
return err;
}
- if (string[0] == '/') /* device name */
+ if (string[0] == '/')
+ /* We got a device name */
return snd_card_load2(string);
+ /* We got in ID */
for (card = 0; card < SND_MAX_CARDS; card++) {
#ifdef SUPPORT_ALOAD
if (! snd_card_load(card))
diff --git a/src/control/control.c b/src/control/control.c
index 7abf8ee3..66eabda5 100644
--- a/src/control/control.c
+++ b/src/control/control.c
@@ -2985,7 +2985,7 @@ size_t snd_ctl_elem_value_sizeof()
/**
* \brief Allocate an invalid #snd_ctl_elem_value_t on the heap.
*
- * Allocate space for a value object on the head. The allocated memory
+ * Allocate space for a value object on the heap. The allocated memory
* must be freed using snd_ctl_elem_value_free().
*
* See snd_ctl_elem_value_t for details.
--
2.17.1
next prev parent reply other threads:[~2020-10-25 15:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-25 15:43 [PATCH 1/2] control: Add documentation for snd_ctl_card_* and friends Tanjeff-N. Moos
2020-10-25 15:43 ` Tanjeff-N. Moos [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-06-17 8:36 Tanjeff-N. Moos
2021-06-17 8:36 ` [PATCH 2/2] control: Minor documentation fixes Tanjeff-N. Moos
2021-06-21 15:14 ` Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201025154341.15875-2-tanjeff@cccmz.de \
--to=tanjeff@cccmz.de \
--cc=alsa-devel@alsa-project.org \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox