From: Andre Noll Date: Wed, 19 Sep 2018 19:51:35 +0000 (+0200) Subject: afh: Move audio_format_name() up. X-Git-Tag: v0.6.3~41^2~5 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=04c16387cc13317ded03ce478b131d94558f585f;hp=3622134825eb94882a8e99acc0ee1889fc0169d6 afh: Move audio_format_name() up. So that all its callers are further down. Not really necessary because the function is non-static and declared in afh.h. But still.. --- diff --git a/afh_common.c b/afh_common.c index bab4d415..dcb0b856 100644 --- a/afh_common.c +++ b/afh_common.c @@ -85,6 +85,21 @@ static struct audio_format_handler afl[] = { } }; +/** + * Get the name of the given audio format. + * + * \param i The audio format number. + * + * \return This returns a pointer to statically allocated memory so it + * must not be freed by the caller. + */ +const char *audio_format_name(int i) +{ + if (i < 0 || i >= ARRAY_SIZE(afl) - 1) + return "???"; + return afl[i].name; +} + static inline int next_audio_format(int format) { for (;;) { @@ -160,21 +175,6 @@ int guess_audio_format(const char *name) return -E_AUDIO_FORMAT; } -/** - * Get the name of the given audio format. - * - * \param i The audio format number. - * - * \return This returns a pointer to statically allocated memory so it - * must not be freed by the caller. - */ -const char *audio_format_name(int i) -{ - if (i < 0 || i >= ARRAY_SIZE(afl) - 1) - return "???"; - return afl[i].name; -} - static int get_file_info(int format, const char *path, char *data, size_t size, int fd, struct afh_info *afhi) {