]> git.alsa-project.org Git - alsa-lib.git/commitdiff
control: Minor documentation fixes.
authorTanjeff-N. Moos <tanjeff@cccmz.de>
Thu, 17 Jun 2021 08:36:39 +0000 (10:36 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 21 Jun 2021 15:13:26 +0000 (17:13 +0200)
Signed-off-by: Tanjeff-N. Moos <tanjeff@cccmz.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/control.h
src/control/cards.c
src/control/control.c

index 9ebb49058de8eade458ae11b35f2cbe9a9d85278..e386ecec92f1b458a9bd72717ebf29920f882a12 100644 (file)
@@ -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
@@ -621,7 +626,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.
  *
index 8226c42d2f3d1d49c4ed50ad76ce8e92e058c878..6145ebcd95295a21ad049a783cf973c1d53f9b80 100644 (file)
@@ -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))
index 7cf4decbee6930fed466d87c24dc054f36f51cc2..91415b512007f5f2e141f22aa8066602635c58db 100644 (file)
@@ -3127,7 +3127,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.