]> git.alsa-project.org Git - alsa-utils.git/commitdiff
Mark static the functions not used outside their unit.
authorDiego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
Fri, 21 Nov 2008 12:09:56 +0000 (13:09 +0100)
committerDiego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
Fri, 21 Nov 2008 12:09:56 +0000 (13:09 +0100)
This way the compiler can assume more information about their
interface for optimisation.

Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
alsactl/init_parse.c
alsactl/state.c
amidi/amidi.c
amixer/amixer.c
aplay/aplay.c

index ab6a6f96bf318cf06046206998a340858831c6a3..0c96a4aed2587b2c00aa59d65bb50bba8f000b0b 100644 (file)
@@ -136,7 +136,7 @@ static void free_space(struct space *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;
        
index 355f242cd312028edde0d1636ff9e4ebc218fd7b..467fa93bdcd5c602a5e8ca326198710fd4627919 100644 (file)
@@ -34,7 +34,7 @@
 #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];
        assert(id);
@@ -47,7 +47,7 @@ char *id_str(snd_ctl_elem_id_t *id)
        return str;
 }
 
-char *num_str(long n)
+static char *num_str(long n)
 {
        static char str[32];
        sprintf(str, "%ld", n);
index bf95a3222a901f8721e218e7ae900888a1c29a36..82eeff44ac2eb45ca0ff74ca0ab057d53bdf4a84 100644 (file)
@@ -445,7 +445,7 @@ static void sig_handler(int dummy)
        stop = 1;
 }
 
-void add_send_hex_data(const char *str)
+static void add_send_hex_data(const char *str)
 {
        int length;
        char *s;
index f93fa9eb627c46a145dc6a4741db94f183505944..d5a77ba5b424251b2d42c8128bd7558c24e8b78e 100644 (file)
@@ -1665,7 +1665,7 @@ static void events_remove(snd_hctl_elem_t *helem)
        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) {
                events_remove(elem);
@@ -1689,7 +1689,7 @@ static void events_add(snd_hctl_elem_t *helem)
        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)
 {
        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));
 }
 
-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_alloca(&sid);
@@ -1768,7 +1768,7 @@ static void sevents_add(snd_mixer_elem_t *elem)
        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)
 {
        if (mask & SND_CTL_EVENT_MASK_ADD)
index c1924e06292348de268f6a771bfcbe18f7186814..9960f8623a8dc91a7f15ae689a20ff85e2508ace 100644 (file)
@@ -127,7 +127,7 @@ static void end_wave(int fd);
 static void begin_au(int fd, size_t count);
 static void end_au(int fd);
 
-struct fmt_capture {
+static const struct fmt_capture {
        void (*start) (int fd, size_t count);
        void (*end) (int fd);
        char *what;
@@ -663,7 +663,7 @@ int main(int argc, char *argv[])
  * 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;
 
@@ -701,7 +701,7 @@ static int test_vocfile(void *buffer)
  * 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)
                return *size;
@@ -2129,7 +2129,7 @@ static void header(int rtype, char *name)
 
 /* 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;
        off64_t written = 0;
@@ -2369,7 +2369,7 @@ static void capture(char *orig_name)
        } 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;
        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);
 }
 
-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;
        ssize_t r;