mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-10 00:15:43 +01:00
Mark static the functions not used outside their unit.
This way the compiler can assume more information about their interface for optimisation. Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
This commit is contained in:
parent
f53441ae68
commit
ca1ea1e904
5 changed files with 14 additions and 14 deletions
|
@ -136,7 +136,7 @@ static void free_space(struct space *space)
|
||||||
free(space);
|
free(space);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct pair *value_find(struct space *space, const char *key)
|
static struct pair *value_find(struct space *space, const char *key)
|
||||||
{
|
{
|
||||||
struct pair *pair = space->pairs;
|
struct pair *pair = space->pairs;
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#define ARRAY_SIZE(a) (sizeof (a) / sizeof (a)[0])
|
#define ARRAY_SIZE(a) (sizeof (a) / sizeof (a)[0])
|
||||||
|
|
||||||
|
|
||||||
char *id_str(snd_ctl_elem_id_t *id)
|
static char *id_str(snd_ctl_elem_id_t *id)
|
||||||
{
|
{
|
||||||
static char str[128];
|
static char str[128];
|
||||||
assert(id);
|
assert(id);
|
||||||
|
@ -47,7 +47,7 @@ char *id_str(snd_ctl_elem_id_t *id)
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *num_str(long n)
|
static char *num_str(long n)
|
||||||
{
|
{
|
||||||
static char str[32];
|
static char str[32];
|
||||||
sprintf(str, "%ld", n);
|
sprintf(str, "%ld", n);
|
||||||
|
|
|
@ -445,7 +445,7 @@ static void sig_handler(int dummy)
|
||||||
stop = 1;
|
stop = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_send_hex_data(const char *str)
|
static void add_send_hex_data(const char *str)
|
||||||
{
|
{
|
||||||
int length;
|
int length;
|
||||||
char *s;
|
char *s;
|
||||||
|
|
|
@ -1665,7 +1665,7 @@ static void events_remove(snd_hctl_elem_t *helem)
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
int element_callback(snd_hctl_elem_t *elem, unsigned int mask)
|
static int element_callback(snd_hctl_elem_t *elem, unsigned int mask)
|
||||||
{
|
{
|
||||||
if (mask == SND_CTL_EVENT_MASK_REMOVE) {
|
if (mask == SND_CTL_EVENT_MASK_REMOVE) {
|
||||||
events_remove(elem);
|
events_remove(elem);
|
||||||
|
@ -1689,7 +1689,7 @@ static void events_add(snd_hctl_elem_t *helem)
|
||||||
snd_hctl_elem_set_callback(helem, element_callback);
|
snd_hctl_elem_set_callback(helem, element_callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ctl_callback(snd_hctl_t *ctl, unsigned int mask,
|
static int ctl_callback(snd_hctl_t *ctl, unsigned int mask,
|
||||||
snd_hctl_elem_t *elem)
|
snd_hctl_elem_t *elem)
|
||||||
{
|
{
|
||||||
if (mask & SND_CTL_EVENT_MASK_ADD)
|
if (mask & SND_CTL_EVENT_MASK_ADD)
|
||||||
|
@ -1743,7 +1743,7 @@ static void sevents_remove(snd_mixer_selem_id_t *sid)
|
||||||
printf("event remove: '%s',%i\n", snd_mixer_selem_id_get_name(sid), snd_mixer_selem_id_get_index(sid));
|
printf("event remove: '%s',%i\n", snd_mixer_selem_id_get_name(sid), snd_mixer_selem_id_get_index(sid));
|
||||||
}
|
}
|
||||||
|
|
||||||
int melem_event(snd_mixer_elem_t *elem, unsigned int mask)
|
static int melem_event(snd_mixer_elem_t *elem, unsigned int mask)
|
||||||
{
|
{
|
||||||
snd_mixer_selem_id_t *sid;
|
snd_mixer_selem_id_t *sid;
|
||||||
snd_mixer_selem_id_alloca(&sid);
|
snd_mixer_selem_id_alloca(&sid);
|
||||||
|
@ -1768,7 +1768,7 @@ static void sevents_add(snd_mixer_elem_t *elem)
|
||||||
snd_mixer_elem_set_callback(elem, melem_event);
|
snd_mixer_elem_set_callback(elem, melem_event);
|
||||||
}
|
}
|
||||||
|
|
||||||
int mixer_event(snd_mixer_t *mixer, unsigned int mask,
|
static int mixer_event(snd_mixer_t *mixer, unsigned int mask,
|
||||||
snd_mixer_elem_t *elem)
|
snd_mixer_elem_t *elem)
|
||||||
{
|
{
|
||||||
if (mask & SND_CTL_EVENT_MASK_ADD)
|
if (mask & SND_CTL_EVENT_MASK_ADD)
|
||||||
|
|
|
@ -127,7 +127,7 @@ static void end_wave(int fd);
|
||||||
static void begin_au(int fd, size_t count);
|
static void begin_au(int fd, size_t count);
|
||||||
static void end_au(int fd);
|
static void end_au(int fd);
|
||||||
|
|
||||||
struct fmt_capture {
|
static const struct fmt_capture {
|
||||||
void (*start) (int fd, size_t count);
|
void (*start) (int fd, size_t count);
|
||||||
void (*end) (int fd);
|
void (*end) (int fd);
|
||||||
char *what;
|
char *what;
|
||||||
|
@ -663,7 +663,7 @@ int main(int argc, char *argv[])
|
||||||
* Safe read (for pipes)
|
* Safe read (for pipes)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ssize_t safe_read(int fd, void *buf, size_t count)
|
static ssize_t safe_read(int fd, void *buf, size_t count)
|
||||||
{
|
{
|
||||||
ssize_t result = 0, res;
|
ssize_t result = 0, res;
|
||||||
|
|
||||||
|
@ -701,7 +701,7 @@ static int test_vocfile(void *buffer)
|
||||||
* helper for test_wavefile
|
* helper for test_wavefile
|
||||||
*/
|
*/
|
||||||
|
|
||||||
size_t test_wavefile_read(int fd, u_char *buffer, size_t *size, size_t reqsize, int line)
|
static size_t test_wavefile_read(int fd, u_char *buffer, size_t *size, size_t reqsize, int line)
|
||||||
{
|
{
|
||||||
if (*size >= reqsize)
|
if (*size >= reqsize)
|
||||||
return *size;
|
return *size;
|
||||||
|
@ -2129,7 +2129,7 @@ static void header(int rtype, char *name)
|
||||||
|
|
||||||
/* playing raw data */
|
/* playing raw data */
|
||||||
|
|
||||||
void playback_go(int fd, size_t loaded, off64_t count, int rtype, char *name)
|
static void playback_go(int fd, size_t loaded, off64_t count, int rtype, char *name)
|
||||||
{
|
{
|
||||||
int l, r;
|
int l, r;
|
||||||
off64_t written = 0;
|
off64_t written = 0;
|
||||||
|
@ -2369,7 +2369,7 @@ static void capture(char *orig_name)
|
||||||
} while ((file_type == FORMAT_RAW && !timelimit) || count > 0);
|
} while ((file_type == FORMAT_RAW && !timelimit) || count > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void playbackv_go(int* fds, unsigned int channels, size_t loaded, off64_t count, int rtype, char **names)
|
static void playbackv_go(int* fds, unsigned int channels, size_t loaded, off64_t count, int rtype, char **names)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
size_t vsize;
|
size_t vsize;
|
||||||
|
@ -2421,7 +2421,7 @@ void playbackv_go(int* fds, unsigned int channels, size_t loaded, off64_t count,
|
||||||
snd_pcm_nonblock(handle, nonblock);
|
snd_pcm_nonblock(handle, nonblock);
|
||||||
}
|
}
|
||||||
|
|
||||||
void capturev_go(int* fds, unsigned int channels, off64_t count, int rtype, char **names)
|
static void capturev_go(int* fds, unsigned int channels, off64_t count, int rtype, char **names)
|
||||||
{
|
{
|
||||||
size_t c;
|
size_t c;
|
||||||
ssize_t r;
|
ssize_t r;
|
||||||
|
|
Loading…
Reference in a new issue