logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git
commit: c35ab591aabc9cc0c89386c95969a7b1c75ff5be
parent 490e096b6b7973ce254b5c486fd1a52ba69d000a
Author: Michael Forney <mforney@mforney.org>
Date:   Wed,  3 Jul 2019 18:17:47 -0700

alsa-lib: Fix a few more portability issues

Diffstat:

Apkg/alsa-lib/patch/0009-Remove-forward-declarations-of-vfscanf-and-vsscanf.patch34++++++++++++++++++++++++++++++++++
Apkg/alsa-lib/patch/0010-Prevent-empty-top-level-declarations.patch904+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/alsa-lib/patch/0011-Don-t-use-inline-asm-on-non-GNU-compilers.patch25+++++++++++++++++++++++++
Apkg/alsa-lib/patch/0012-Use-switch-statements-instead-of-labels-as-values.patch1708+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mpkg/alsa-lib/ver2+-
5 files changed, 2672 insertions(+), 1 deletion(-)

diff --git a/pkg/alsa-lib/patch/0009-Remove-forward-declarations-of-vfscanf-and-vsscanf.patch b/pkg/alsa-lib/patch/0009-Remove-forward-declarations-of-vfscanf-and-vsscanf.patch @@ -0,0 +1,34 @@ +From 6afffaf09b33fdec905dcb6405c32289dcae923f Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Wed, 3 Jul 2019 18:10:27 -0700 +Subject: [PATCH] Remove forward declarations of vfscanf and vsscanf + +These will be declared in stdio.h, possibly with different parameter +qualifiers, like `restrict`. +--- + src/input.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/src/input.c b/src/input.c +index 35324f1f..6ae75bb8 100644 +--- a/src/input.c ++++ b/src/input.c +@@ -135,7 +135,6 @@ static int snd_input_stdio_close(snd_input_t *input ATTRIBUTE_UNUSED) + static int snd_input_stdio_scan(snd_input_t *input, const char *format, va_list args) + { + snd_input_stdio_t *stdio = input->private_data; +- extern int vfscanf(FILE *, const char *, va_list); + return vfscanf(stdio->fp, format, args); + } + +@@ -239,7 +238,6 @@ static int snd_input_buffer_close(snd_input_t *input) + static int snd_input_buffer_scan(snd_input_t *input, const char *format, va_list args) + { + snd_input_buffer_t *buffer = input->private_data; +- extern int vsscanf(const char *, const char *, va_list); + /* FIXME: how can I obtain consumed chars count? */ + assert(0); + return vsscanf((char *)buffer->ptr, format, args); +-- +2.22.0 + diff --git a/pkg/alsa-lib/patch/0010-Prevent-empty-top-level-declarations.patch b/pkg/alsa-lib/patch/0010-Prevent-empty-top-level-declarations.patch @@ -0,0 +1,904 @@ +From 5f171536a3844f1b4c42dc5f34e104e5d23d56ed Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Wed, 3 Jul 2019 18:15:11 -0700 +Subject: [PATCH] Prevent empty top-level declarations + +These macros may be defined as a function definition or defined +away. In both cases, the ';' after the macro invocation to be treated +as an empty top-level declaration, which is not allowed in ISO C. +--- + include/alsa-symbols.h | 8 ++++---- + src/conf.c | 4 ++-- + src/confmisc.c | 32 ++++++++++++++++---------------- + src/control/control.c | 6 +++--- + src/control/control_hw.c | 2 +- + src/control/control_shm.c | 2 +- + src/dlmisc.c | 4 ++-- + src/hwdep/hwdep_hw.c | 2 +- + src/names.c | 4 ++-- + src/pcm/pcm.c | 30 +++++++++++++++--------------- + src/pcm/pcm_adpcm.c | 2 +- + src/pcm/pcm_alaw.c | 2 +- + src/pcm/pcm_asym.c | 2 +- + src/pcm/pcm_copy.c | 2 +- + src/pcm/pcm_dmix.c | 2 +- + src/pcm/pcm_dshare.c | 2 +- + src/pcm/pcm_dsnoop.c | 2 +- + src/pcm/pcm_empty.c | 2 +- + src/pcm/pcm_file.c | 2 +- + src/pcm/pcm_hooks.c | 4 ++-- + src/pcm/pcm_hw.c | 2 +- + src/pcm/pcm_iec958.c | 2 +- + src/pcm/pcm_ladspa.c | 2 +- + src/pcm/pcm_lfloat.c | 2 +- + src/pcm/pcm_linear.c | 2 +- + src/pcm/pcm_meter.c | 2 +- + src/pcm/pcm_mmap_emul.c | 2 +- + src/pcm/pcm_mulaw.c | 2 +- + src/pcm/pcm_multi.c | 2 +- + src/pcm/pcm_null.c | 2 +- + src/pcm/pcm_plug.c | 2 +- + src/pcm/pcm_rate.c | 2 +- + src/pcm/pcm_route.c | 2 +- + src/pcm/pcm_share.c | 2 +- + src/pcm/pcm_shm.c | 2 +- + src/pcm/pcm_softvol.c | 2 +- + src/rawmidi/rawmidi_hw.c | 2 +- + src/rawmidi/rawmidi_virt.c | 2 +- + src/seq/seq_hw.c | 2 +- + src/timer/timer.c | 10 +++++----- + src/timer/timer_hw.c | 2 +- + src/timer/timer_query.c | 6 +++--- + src/timer/timer_query_hw.c | 2 +- + 43 files changed, 87 insertions(+), 87 deletions(-) + +diff --git a/include/alsa-symbols.h b/include/alsa-symbols.h +index bba9a9d4..26fde696 100644 +--- a/include/alsa-symbols.h ++++ b/include/alsa-symbols.h +@@ -30,9 +30,9 @@ + #define INTERNAL(Name) INTERNAL_CONCAT2_2(__, Name) + + #define symbol_version(real, name, version) \ +- __asm__ (".symver " ASM_NAME(#real) "," ASM_NAME(#name) "@" #version) ++ __asm__ (".symver " ASM_NAME(#real) "," ASM_NAME(#name) "@" #version); + #define default_symbol_version(real, name, version) \ +- __asm__ (".symver " ASM_NAME(#real) "," ASM_NAME(#name) "@@" #version) ++ __asm__ (".symver " ASM_NAME(#real) "," ASM_NAME(#name) "@@" #version); + + #define EXPORT_SYMBOL __attribute__((visibility("default"),externally_visible)) + +@@ -46,11 +46,11 @@ + #if defined(__alpha__) || defined(__mips__) + #define use_default_symbol_version(real, name, version) \ + __asm__ (".weak " ASM_NAME(#name)); \ +- __asm__ (ASM_NAME(#name) " = " ASM_NAME(#real)) ++ __asm__ (ASM_NAME(#name) " = " ASM_NAME(#real)); + #else + #define use_default_symbol_version(real, name, version) \ + __asm__ (".weak " ASM_NAME(#name)); \ +- __asm__ (".set " ASM_NAME(#name) "," ASM_NAME(#real)) ++ __asm__ (".set " ASM_NAME(#name) "," ASM_NAME(#real)); + #endif + #endif + +diff --git a/src/conf.c b/src/conf.c +index 3892b576..3032b071 100644 +--- a/src/conf.c ++++ b/src/conf.c +@@ -3791,7 +3791,7 @@ int snd_config_hook_load(snd_config_t *root, snd_config_t *config, snd_config_t + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(snd_config_hook_load, SND_CONFIG_DLSYM_VERSION_HOOK); ++SND_DLSYM_BUILD_VERSION(snd_config_hook_load, SND_CONFIG_DLSYM_VERSION_HOOK) + #endif + + #ifndef DOC_HIDDEN +@@ -3859,7 +3859,7 @@ int snd_config_hook_load_for_all_cards(snd_config_t *root, snd_config_t *config, + return 0; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(snd_config_hook_load_for_all_cards, SND_CONFIG_DLSYM_VERSION_HOOK); ++SND_DLSYM_BUILD_VERSION(snd_config_hook_load_for_all_cards, SND_CONFIG_DLSYM_VERSION_HOOK) + #endif + + /** +diff --git a/src/confmisc.c b/src/confmisc.c +index eb8218c1..b6e0753b 100644 +--- a/src/confmisc.c ++++ b/src/confmisc.c +@@ -300,7 +300,7 @@ int snd_func_getenv(snd_config_t **dst, snd_config_t *root, snd_config_t *src, + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(snd_func_getenv, SND_CONFIG_DLSYM_VERSION_EVALUATE); ++SND_DLSYM_BUILD_VERSION(snd_func_getenv, SND_CONFIG_DLSYM_VERSION_EVALUATE) + #endif + + /** +@@ -353,7 +353,7 @@ int snd_func_igetenv(snd_config_t **dst, snd_config_t *root, snd_config_t *src, + return 0; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(snd_func_igetenv, SND_CONFIG_DLSYM_VERSION_EVALUATE); ++SND_DLSYM_BUILD_VERSION(snd_func_igetenv, SND_CONFIG_DLSYM_VERSION_EVALUATE) + #endif + + /** +@@ -445,7 +445,7 @@ int snd_func_concat(snd_config_t **dst, snd_config_t *root, snd_config_t *src, + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(snd_func_concat, SND_CONFIG_DLSYM_VERSION_EVALUATE); ++SND_DLSYM_BUILD_VERSION(snd_func_concat, SND_CONFIG_DLSYM_VERSION_EVALUATE) + #endif + + +@@ -534,7 +534,7 @@ int snd_func_iadd(snd_config_t **dst, snd_config_t *root, + return snd_func_iops(dst, root, src, private_data, 0); + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(snd_func_iadd, SND_CONFIG_DLSYM_VERSION_EVALUATE); ++SND_DLSYM_BUILD_VERSION(snd_func_iadd, SND_CONFIG_DLSYM_VERSION_EVALUATE) + #endif + + /** +@@ -560,7 +560,7 @@ int snd_func_imul(snd_config_t **dst, snd_config_t *root, + return snd_func_iops(dst, root, src, private_data, 1); + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(snd_func_imul, SND_CONFIG_DLSYM_VERSION_EVALUATE); ++SND_DLSYM_BUILD_VERSION(snd_func_imul, SND_CONFIG_DLSYM_VERSION_EVALUATE) + #endif + + /** +@@ -591,7 +591,7 @@ int snd_func_datadir(snd_config_t **dst, snd_config_t *root ATTRIBUTE_UNUSED, + return snd_config_imake_string(dst, id, snd_config_topdir()); + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(snd_func_datadir, SND_CONFIG_DLSYM_VERSION_EVALUATE); ++SND_DLSYM_BUILD_VERSION(snd_func_datadir, SND_CONFIG_DLSYM_VERSION_EVALUATE) + #endif + + static int open_ctl(long card, snd_ctl_t **ctl) +@@ -657,7 +657,7 @@ int snd_func_private_string(snd_config_t **dst, snd_config_t *root ATTRIBUTE_UNU + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(snd_func_private_string, SND_CONFIG_DLSYM_VERSION_EVALUATE); ++SND_DLSYM_BUILD_VERSION(snd_func_private_string, SND_CONFIG_DLSYM_VERSION_EVALUATE) + #endif + + #ifndef DOC_HIDDEN +@@ -737,7 +737,7 @@ int snd_func_private_card_driver(snd_config_t **dst, snd_config_t *root ATTRIBUT + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(snd_func_private_card_driver, SND_CONFIG_DLSYM_VERSION_EVALUATE); ++SND_DLSYM_BUILD_VERSION(snd_func_private_card_driver, SND_CONFIG_DLSYM_VERSION_EVALUATE) + #endif + + static int parse_card(snd_config_t *root, snd_config_t *src, +@@ -801,7 +801,7 @@ int snd_func_card_inum(snd_config_t **dst, snd_config_t *root, snd_config_t *src + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(snd_func_card_inum, SND_CONFIG_DLSYM_VERSION_EVALUATE); ++SND_DLSYM_BUILD_VERSION(snd_func_card_inum, SND_CONFIG_DLSYM_VERSION_EVALUATE) + #endif + + /** +@@ -838,7 +838,7 @@ int snd_func_card_driver(snd_config_t **dst, snd_config_t *root, snd_config_t *s + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(snd_func_card_driver, SND_CONFIG_DLSYM_VERSION_EVALUATE); ++SND_DLSYM_BUILD_VERSION(snd_func_card_driver, SND_CONFIG_DLSYM_VERSION_EVALUATE) + #endif + + /** +@@ -889,7 +889,7 @@ int snd_func_card_id(snd_config_t **dst, snd_config_t *root, snd_config_t *src, + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(snd_func_card_id, SND_CONFIG_DLSYM_VERSION_EVALUATE); ++SND_DLSYM_BUILD_VERSION(snd_func_card_id, SND_CONFIG_DLSYM_VERSION_EVALUATE) + #endif + + /** +@@ -940,7 +940,7 @@ int snd_func_card_name(snd_config_t **dst, snd_config_t *root, + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(snd_func_card_name, SND_CONFIG_DLSYM_VERSION_EVALUATE); ++SND_DLSYM_BUILD_VERSION(snd_func_card_name, SND_CONFIG_DLSYM_VERSION_EVALUATE) + #endif + + #ifdef BUILD_PCM +@@ -1026,7 +1026,7 @@ int snd_func_pcm_id(snd_config_t **dst, snd_config_t *root, snd_config_t *src, v + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(snd_func_pcm_id, SND_CONFIG_DLSYM_VERSION_EVALUATE); ++SND_DLSYM_BUILD_VERSION(snd_func_pcm_id, SND_CONFIG_DLSYM_VERSION_EVALUATE) + #endif + + /** +@@ -1139,7 +1139,7 @@ int snd_func_pcm_args_by_class(snd_config_t **dst, snd_config_t *root, snd_confi + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(snd_func_pcm_args_by_class, SND_CONFIG_DLSYM_VERSION_EVALUATE); ++SND_DLSYM_BUILD_VERSION(snd_func_pcm_args_by_class, SND_CONFIG_DLSYM_VERSION_EVALUATE) + #endif + + /** +@@ -1193,7 +1193,7 @@ int snd_func_private_pcm_subdevice(snd_config_t **dst, snd_config_t *root ATTRIB + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(snd_func_private_pcm_subdevice, SND_CONFIG_DLSYM_VERSION_EVALUATE); ++SND_DLSYM_BUILD_VERSION(snd_func_private_pcm_subdevice, SND_CONFIG_DLSYM_VERSION_EVALUATE) + #endif + + #endif /* BUILD_PCM */ +@@ -1295,7 +1295,7 @@ int snd_func_refer(snd_config_t **dst, snd_config_t *root, snd_config_t *src, + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(snd_func_refer, SND_CONFIG_DLSYM_VERSION_EVALUATE); ++SND_DLSYM_BUILD_VERSION(snd_func_refer, SND_CONFIG_DLSYM_VERSION_EVALUATE) + #endif + + #ifndef DOC_HIDDEN +diff --git a/src/control/control.c b/src/control/control.c +index 33650155..d136c2f1 100644 +--- a/src/control/control.c ++++ b/src/control/control.c +@@ -2370,7 +2370,7 @@ int snd_ctl_elem_info_is_indirect(const snd_ctl_elem_info_t *obj) + assert(obj); + return 0; + } +-link_warning(snd_ctl_elem_info_is_indirect, "Warning: snd_ctl_elem_info_is_indirect is deprecated, do not use it"); ++link_warning(snd_ctl_elem_info_is_indirect, "Warning: snd_ctl_elem_info_is_indirect is deprecated, do not use it") + + /** + * \brief Get owner of a locked element +@@ -2523,7 +2523,7 @@ int snd_ctl_elem_info_get_dimensions(const snd_ctl_elem_info_t *obj) + break; + return i + 1; + } +-use_default_symbol_version(__snd_ctl_elem_info_get_dimensions, snd_ctl_elem_info_get_dimensions, ALSA_0.9.3); ++use_default_symbol_version(__snd_ctl_elem_info_get_dimensions, snd_ctl_elem_info_get_dimensions, ALSA_0.9.3) + + /** + * \brief Get specified of dimension width for given element +@@ -2545,7 +2545,7 @@ int snd_ctl_elem_info_get_dimension(const snd_ctl_elem_info_t *obj, unsigned int + return 0; + return obj->dimen.d[idx]; + } +-use_default_symbol_version(__snd_ctl_elem_info_get_dimension, snd_ctl_elem_info_get_dimension, ALSA_0.9.3); ++use_default_symbol_version(__snd_ctl_elem_info_get_dimension, snd_ctl_elem_info_get_dimension, ALSA_0.9.3) + + /** + * \brief Set width to a specified dimension level of given element information. +diff --git a/src/control/control_hw.c b/src/control/control_hw.c +index b54d65f2..cd04fdd5 100644 +--- a/src/control/control_hw.c ++++ b/src/control/control_hw.c +@@ -468,4 +468,4 @@ int _snd_ctl_hw_open(snd_ctl_t **handlep, char *name, snd_config_t *root ATTRIBU + return -EINVAL; + return snd_ctl_hw_open(handlep, name, card, mode); + } +-SND_DLSYM_BUILD_VERSION(_snd_ctl_hw_open, SND_CONTROL_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_ctl_hw_open, SND_CONTROL_DLSYM_VERSION) +diff --git a/src/control/control_shm.c b/src/control/control_shm.c +index d7b41398..cdc5d3a6 100644 +--- a/src/control/control_shm.c ++++ b/src/control/control_shm.c +@@ -628,4 +628,4 @@ int _snd_ctl_shm_open(snd_ctl_t **handlep, char *name, snd_config_t *root, snd_c + snd_config_delete(sconfig); + return err; + } +-SND_DLSYM_BUILD_VERSION(_snd_ctl_shm_open, SND_CONTROL_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_ctl_shm_open, SND_CONTROL_DLSYM_VERSION) +diff --git a/src/dlmisc.c b/src/dlmisc.c +index 012e61bc..ce2f8352 100644 +--- a/src/dlmisc.c ++++ b/src/dlmisc.c +@@ -116,8 +116,8 @@ void *INTERNAL(snd_dlopen_old)(const char *name, int mode) + } + #endif + +-use_symbol_version(__snd_dlopen_old, snd_dlopen, ALSA_0.9); +-use_default_symbol_version(__snd_dlopen, snd_dlopen, ALSA_1.1.6); ++use_symbol_version(__snd_dlopen_old, snd_dlopen, ALSA_0.9) ++use_default_symbol_version(__snd_dlopen, snd_dlopen, ALSA_1.1.6) + + /** + * \brief Closes a dynamic library - ALSA wrapper for \c dlclose. +diff --git a/src/hwdep/hwdep_hw.c b/src/hwdep/hwdep_hw.c +index d3037194..1c8e39bf 100644 +--- a/src/hwdep/hwdep_hw.c ++++ b/src/hwdep/hwdep_hw.c +@@ -185,4 +185,4 @@ int _snd_hwdep_hw_open(snd_hwdep_t **hwdep, char *name, + return -EINVAL; + return snd_hwdep_hw_open(hwdep, name, card, device, mode); + } +-SND_DLSYM_BUILD_VERSION(_snd_hwdep_hw_open, SND_HWDEP_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_hwdep_hw_open, SND_HWDEP_DLSYM_VERSION) +diff --git a/src/names.c b/src/names.c +index d909a11d..890d2a34 100644 +--- a/src/names.c ++++ b/src/names.c +@@ -44,7 +44,7 @@ int snd_names_list(const char *iface ATTRIBUTE_UNUSED, + { + return -ENXIO; + } +-link_warning(snd_names_list, "Warning: snd_names_list is deprecated, use snd_device_name_hint"); ++link_warning(snd_names_list, "Warning: snd_names_list is deprecated, use snd_device_name_hint") + + /** + * \brief This function is unimplemented. +@@ -53,4 +53,4 @@ link_warning(snd_names_list, "Warning: snd_names_list is deprecated, use snd_dev + void snd_names_list_free(snd_devname_t *list ATTRIBUTE_UNUSED) + { + } +-link_warning(snd_names_list_free, "Warning: snd_names_list_free is deprecated, use snd_device_name_free_hint"); ++link_warning(snd_names_list_free, "Warning: snd_names_list_free is deprecated, use snd_device_name_free_hint") +diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c +index c58f5933..e3cf4a10 100644 +--- a/src/pcm/pcm.c ++++ b/src/pcm/pcm.c +@@ -1443,7 +1443,7 @@ snd_pcm_sframes_t snd_pcm_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames) + snd_pcm_unlock(pcm); + return result; + } +-use_default_symbol_version(__snd_pcm_forward, snd_pcm_forward, ALSA_0.9.0rc8); ++use_default_symbol_version(__snd_pcm_forward, snd_pcm_forward, ALSA_0.9.0rc8) + + /** + * \brief Write interleaved frames to a PCM +@@ -2104,7 +2104,7 @@ const char *snd_pcm_start_mode_name(snd_pcm_start_t mode) + } + + #ifndef DOC_HIDDEN +-link_warning(snd_pcm_start_mode_name, "Warning: start_mode is deprecated, consider to use start_threshold"); ++link_warning(snd_pcm_start_mode_name, "Warning: start_mode is deprecated, consider to use start_threshold") + #endif + + /** +@@ -2120,7 +2120,7 @@ const char *snd_pcm_xrun_mode_name(snd_pcm_xrun_t mode) + } + + #ifndef DOC_HIDDEN +-link_warning(snd_pcm_xrun_mode_name, "Warning: xrun_mode is deprecated, consider to use stop_threshold"); ++link_warning(snd_pcm_xrun_mode_name, "Warning: xrun_mode is deprecated, consider to use stop_threshold") + #endif + + /** +@@ -2174,7 +2174,7 @@ const char *snd_pcm_type_name(snd_pcm_type_t type) + return NULL; + return snd_pcm_type_names[type]; + } +-use_default_symbol_version(__snd_pcm_type_name, snd_pcm_type_name, ALSA_0.9.0); ++use_default_symbol_version(__snd_pcm_type_name, snd_pcm_type_name, ALSA_0.9.0) + + /** + * \brief Dump current hardware setup for PCM +@@ -6192,7 +6192,7 @@ int snd_pcm_sw_params_set_start_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params + } + + #ifndef DOC_HIDDEN +-link_warning(snd_pcm_sw_params_set_start_mode, "Warning: start_mode is deprecated, consider to use start_threshold"); ++link_warning(snd_pcm_sw_params_set_start_mode, "Warning: start_mode is deprecated, consider to use start_threshold") + #endif + + /** +@@ -6208,7 +6208,7 @@ snd_pcm_start_t snd_pcm_sw_params_get_start_mode(const snd_pcm_sw_params_t *para + } + + #ifndef DOC_HIDDEN +-link_warning(snd_pcm_sw_params_get_start_mode, "Warning: start_mode is deprecated, consider to use start_threshold"); ++link_warning(snd_pcm_sw_params_get_start_mode, "Warning: start_mode is deprecated, consider to use start_threshold") + #endif + + /** +@@ -6240,7 +6240,7 @@ int snd_pcm_sw_params_set_xrun_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, + } + + #ifndef DOC_HIDDEN +-link_warning(snd_pcm_sw_params_set_xrun_mode, "Warning: xrun_mode is deprecated, consider to use stop_threshold"); ++link_warning(snd_pcm_sw_params_set_xrun_mode, "Warning: xrun_mode is deprecated, consider to use stop_threshold") + #endif + + /** +@@ -6256,7 +6256,7 @@ snd_pcm_xrun_t snd_pcm_sw_params_get_xrun_mode(const snd_pcm_sw_params_t *params + } + + #ifndef DOC_HIDDEN +-link_warning(snd_pcm_sw_params_get_xrun_mode, "Warning: xrun_mode is deprecated, consider to use stop_threshold"); ++link_warning(snd_pcm_sw_params_get_xrun_mode, "Warning: xrun_mode is deprecated, consider to use stop_threshold") + #endif + + /** +@@ -6749,7 +6749,7 @@ void snd_pcm_status_get_trigger_htstamp(const snd_pcm_status_t *obj, snd_htimest + assert(obj && ptr); + *ptr = obj->trigger_tstamp; + } +-use_default_symbol_version(__snd_pcm_status_get_trigger_htstamp, snd_pcm_status_get_trigger_htstamp, ALSA_0.9.0rc8); ++use_default_symbol_version(__snd_pcm_status_get_trigger_htstamp, snd_pcm_status_get_trigger_htstamp, ALSA_0.9.0rc8) + + /** + * \brief Get "now" timestamp from a PCM status container +@@ -6777,7 +6777,7 @@ void snd_pcm_status_get_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *p + assert(obj && ptr); + *ptr = obj->tstamp; + } +-use_default_symbol_version(__snd_pcm_status_get_htstamp, snd_pcm_status_get_htstamp, ALSA_0.9.0rc8); ++use_default_symbol_version(__snd_pcm_status_get_htstamp, snd_pcm_status_get_htstamp, ALSA_0.9.0rc8) + + /** + * \brief Get "now" hi-res audio timestamp from a PCM status container +@@ -7451,8 +7451,8 @@ snd_pcm_uframes_t _snd_pcm_boundary(snd_pcm_t *pcm) + } + + #ifndef DOC_HIDDEN +-link_warning(_snd_pcm_mmap_hw_ptr, "Warning: _snd_pcm_mmap_hw_ptr() is deprecated, consider to not use this function"); +-link_warning(_snd_pcm_boundary, "Warning: _snd_pcm_boundary() is deprecated, consider to use snd_pcm_sw_params_current()"); ++link_warning(_snd_pcm_mmap_hw_ptr, "Warning: _snd_pcm_mmap_hw_ptr() is deprecated, consider to not use this function") ++link_warning(_snd_pcm_boundary, "Warning: _snd_pcm_boundary() is deprecated, consider to use snd_pcm_sw_params_current()") + #endif + + static const char *const names[SND_PCM_HW_PARAM_LAST_INTERVAL + 1] = { +@@ -7717,13 +7717,13 @@ void snd_pcm_unlink_appl_ptr(snd_pcm_t *pcm, snd_pcm_t *slave) + #ifdef USE_VERSIONED_SYMBOLS + + #define OBSOLETE1(name, what, new) \ +- default_symbol_version(__##name, name, new); \ +- symbol_version(__old_##name, name, what); ++ default_symbol_version(__##name, name, new) \ ++ symbol_version(__old_##name, name, what) + + #else + + #define OBSOLETE1(name, what, new) \ +- use_default_symbol_version(__##name, name, new); ++ use_default_symbol_version(__##name, name, new) + + #endif /* USE_VERSIONED_SYMBOLS */ + +diff --git a/src/pcm/pcm_adpcm.c b/src/pcm/pcm_adpcm.c +index ed065318..ae0bfae2 100644 +--- a/src/pcm/pcm_adpcm.c ++++ b/src/pcm/pcm_adpcm.c +@@ -678,5 +678,5 @@ int _snd_pcm_adpcm_open(snd_pcm_t **pcmp, const char *name, + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_adpcm_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_adpcm_open, SND_PCM_DLSYM_VERSION) + #endif +diff --git a/src/pcm/pcm_alaw.c b/src/pcm/pcm_alaw.c +index 540ba25f..839783cf 100644 +--- a/src/pcm/pcm_alaw.c ++++ b/src/pcm/pcm_alaw.c +@@ -552,5 +552,5 @@ int _snd_pcm_alaw_open(snd_pcm_t **pcmp, const char *name, + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_alaw_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_alaw_open, SND_PCM_DLSYM_VERSION) + #endif +diff --git a/src/pcm/pcm_asym.c b/src/pcm/pcm_asym.c +index 9c32b1b9..740a85fe 100644 +--- a/src/pcm/pcm_asym.c ++++ b/src/pcm/pcm_asym.c +@@ -115,5 +115,5 @@ int _snd_pcm_asym_open(snd_pcm_t **pcmp, const char *name ATTRIBUTE_UNUSED, + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_asym_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_asym_open, SND_PCM_DLSYM_VERSION) + #endif +diff --git a/src/pcm/pcm_copy.c b/src/pcm/pcm_copy.c +index 4c099acd..f7769f22 100644 +--- a/src/pcm/pcm_copy.c ++++ b/src/pcm/pcm_copy.c +@@ -298,5 +298,5 @@ int _snd_pcm_copy_open(snd_pcm_t **pcmp, const char *name, + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_copy_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_copy_open, SND_PCM_DLSYM_VERSION) + #endif +diff --git a/src/pcm/pcm_dmix.c b/src/pcm/pcm_dmix.c +index c5592cdb..a8a9617a 100644 +--- a/src/pcm/pcm_dmix.c ++++ b/src/pcm/pcm_dmix.c +@@ -1447,5 +1447,5 @@ int _snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name, + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_dmix_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_dmix_open, SND_PCM_DLSYM_VERSION) + #endif +diff --git a/src/pcm/pcm_dshare.c b/src/pcm/pcm_dshare.c +index f135b5df..fa9cd1ba 100644 +--- a/src/pcm/pcm_dshare.c ++++ b/src/pcm/pcm_dshare.c +@@ -1007,5 +1007,5 @@ int _snd_pcm_dshare_open(snd_pcm_t **pcmp, const char *name, + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_dshare_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_dshare_open, SND_PCM_DLSYM_VERSION) + #endif +diff --git a/src/pcm/pcm_dsnoop.c b/src/pcm/pcm_dsnoop.c +index d08b6241..19ae06e0 100644 +--- a/src/pcm/pcm_dsnoop.c ++++ b/src/pcm/pcm_dsnoop.c +@@ -866,5 +866,5 @@ int _snd_pcm_dsnoop_open(snd_pcm_t **pcmp, const char *name, + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_dsnoop_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_dsnoop_open, SND_PCM_DLSYM_VERSION) + #endif +diff --git a/src/pcm/pcm_empty.c b/src/pcm/pcm_empty.c +index 869577b6..11dcb37e 100644 +--- a/src/pcm/pcm_empty.c ++++ b/src/pcm/pcm_empty.c +@@ -106,5 +106,5 @@ int _snd_pcm_empty_open(snd_pcm_t **pcmp, const char *name ATTRIBUTE_UNUSED, + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_empty_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_empty_open, SND_PCM_DLSYM_VERSION) + #endif +diff --git a/src/pcm/pcm_file.c b/src/pcm/pcm_file.c +index 3a19cef9..0f470cdc 100644 +--- a/src/pcm/pcm_file.c ++++ b/src/pcm/pcm_file.c +@@ -996,5 +996,5 @@ int _snd_pcm_file_open(snd_pcm_t **pcmp, const char *name, + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_file_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_file_open, SND_PCM_DLSYM_VERSION) + #endif +diff --git a/src/pcm/pcm_hooks.c b/src/pcm/pcm_hooks.c +index 4416d363..ed88dd29 100644 +--- a/src/pcm/pcm_hooks.c ++++ b/src/pcm/pcm_hooks.c +@@ -549,7 +549,7 @@ int _snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name, + return 0; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_hooks_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_hooks_open, SND_PCM_DLSYM_VERSION) + #endif + + /** +@@ -724,5 +724,5 @@ int _snd_pcm_hook_ctl_elems_install(snd_pcm_t *pcm, snd_config_t *conf) + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_hook_ctl_elems_install, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_hook_ctl_elems_install, SND_PCM_DLSYM_VERSION) + #endif +diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c +index 4f104e5e..0f433617 100644 +--- a/src/pcm/pcm_hw.c ++++ b/src/pcm/pcm_hw.c +@@ -1943,7 +1943,7 @@ fail: + } + + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_hw_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_hw_open, SND_PCM_DLSYM_VERSION) + #endif + + /* +diff --git a/src/pcm/pcm_iec958.c b/src/pcm/pcm_iec958.c +index 76d3ca7b..f994876b 100644 +--- a/src/pcm/pcm_iec958.c ++++ b/src/pcm/pcm_iec958.c +@@ -713,5 +713,5 @@ int _snd_pcm_iec958_open(snd_pcm_t **pcmp, const char *name, + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_iec958_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_iec958_open, SND_PCM_DLSYM_VERSION) + #endif +diff --git a/src/pcm/pcm_ladspa.c b/src/pcm/pcm_ladspa.c +index ad73347d..4a846af9 100644 +--- a/src/pcm/pcm_ladspa.c ++++ b/src/pcm/pcm_ladspa.c +@@ -1804,5 +1804,5 @@ int _snd_pcm_ladspa_open(snd_pcm_t **pcmp, const char *name, + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_ladspa_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_ladspa_open, SND_PCM_DLSYM_VERSION) + #endif +diff --git a/src/pcm/pcm_lfloat.c b/src/pcm/pcm_lfloat.c +index f32a82a7..0447d0a2 100644 +--- a/src/pcm/pcm_lfloat.c ++++ b/src/pcm/pcm_lfloat.c +@@ -511,7 +511,7 @@ int _snd_pcm_lfloat_open(snd_pcm_t **pcmp, const char *name, + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_lfloat_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_lfloat_open, SND_PCM_DLSYM_VERSION) + #endif + + #else /* BUGGY_GCC */ +diff --git a/src/pcm/pcm_linear.c b/src/pcm/pcm_linear.c +index 33e7fc45..26b4f4e5 100644 +--- a/src/pcm/pcm_linear.c ++++ b/src/pcm/pcm_linear.c +@@ -553,5 +553,5 @@ int _snd_pcm_linear_open(snd_pcm_t **pcmp, const char *name, + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_linear_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_linear_open, SND_PCM_DLSYM_VERSION) + #endif +diff --git a/src/pcm/pcm_meter.c b/src/pcm/pcm_meter.c +index 20b41876..b08a36ff 100644 +--- a/src/pcm/pcm_meter.c ++++ b/src/pcm/pcm_meter.c +@@ -831,7 +831,7 @@ int _snd_pcm_meter_open(snd_pcm_t **pcmp, const char *name, + } + return 0; + } +-SND_DLSYM_BUILD_VERSION(_snd_pcm_meter_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_meter_open, SND_PCM_DLSYM_VERSION) + + #endif + +diff --git a/src/pcm/pcm_mmap_emul.c b/src/pcm/pcm_mmap_emul.c +index 009cebb3..0011ccf4 100644 +--- a/src/pcm/pcm_mmap_emul.c ++++ b/src/pcm/pcm_mmap_emul.c +@@ -510,5 +510,5 @@ int _snd_pcm_mmap_emul_open(snd_pcm_t **pcmp, const char *name, + } + + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_mmap_emul_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_mmap_emul_open, SND_PCM_DLSYM_VERSION) + #endif +diff --git a/src/pcm/pcm_mulaw.c b/src/pcm/pcm_mulaw.c +index 73b0c3bc..58f741b6 100644 +--- a/src/pcm/pcm_mulaw.c ++++ b/src/pcm/pcm_mulaw.c +@@ -566,5 +566,5 @@ int _snd_pcm_mulaw_open(snd_pcm_t **pcmp, const char *name, + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_mulaw_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_mulaw_open, SND_PCM_DLSYM_VERSION) + #endif +diff --git a/src/pcm/pcm_multi.c b/src/pcm/pcm_multi.c +index 53c414d5..63ca148e 100644 +--- a/src/pcm/pcm_multi.c ++++ b/src/pcm/pcm_multi.c +@@ -1447,5 +1447,5 @@ _free: + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_multi_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_multi_open, SND_PCM_DLSYM_VERSION) + #endif +diff --git a/src/pcm/pcm_null.c b/src/pcm/pcm_null.c +index 1d815485..d9d64767 100644 +--- a/src/pcm/pcm_null.c ++++ b/src/pcm/pcm_null.c +@@ -499,5 +499,5 @@ int _snd_pcm_null_open(snd_pcm_t **pcmp, const char *name, + return 0; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_null_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_null_open, SND_PCM_DLSYM_VERSION) + #endif +diff --git a/src/pcm/pcm_plug.c b/src/pcm/pcm_plug.c +index abf6f1ab..ce48cc45 100644 +--- a/src/pcm/pcm_plug.c ++++ b/src/pcm/pcm_plug.c +@@ -1332,5 +1332,5 @@ int _snd_pcm_plug_open(snd_pcm_t **pcmp, const char *name, + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_plug_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_plug_open, SND_PCM_DLSYM_VERSION) + #endif +diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c +index fdcaa8de..0e82a9ed 100644 +--- a/src/pcm/pcm_rate.c ++++ b/src/pcm/pcm_rate.c +@@ -1595,5 +1595,5 @@ int _snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name, + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_rate_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_rate_open, SND_PCM_DLSYM_VERSION) + #endif +diff --git a/src/pcm/pcm_route.c b/src/pcm/pcm_route.c +index bbcc6118..325eee62 100644 +--- a/src/pcm/pcm_route.c ++++ b/src/pcm/pcm_route.c +@@ -1393,5 +1393,5 @@ int _snd_pcm_route_open(snd_pcm_t **pcmp, const char *name, + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_route_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_route_open, SND_PCM_DLSYM_VERSION) + #endif +diff --git a/src/pcm/pcm_share.c b/src/pcm/pcm_share.c +index bff9507d..7695ba17 100644 +--- a/src/pcm/pcm_share.c ++++ b/src/pcm/pcm_share.c +@@ -1719,5 +1719,5 @@ _free: + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_share_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_share_open, SND_PCM_DLSYM_VERSION) + #endif +diff --git a/src/pcm/pcm_shm.c b/src/pcm/pcm_shm.c +index 26a27a57..31971686 100644 +--- a/src/pcm/pcm_shm.c ++++ b/src/pcm/pcm_shm.c +@@ -903,5 +903,5 @@ int _snd_pcm_shm_open(snd_pcm_t **pcmp, const char *name, + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_shm_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_shm_open, SND_PCM_DLSYM_VERSION) + #endif +diff --git a/src/pcm/pcm_softvol.c b/src/pcm/pcm_softvol.c +index f08208f8..3ea835b8 100644 +--- a/src/pcm/pcm_softvol.c ++++ b/src/pcm/pcm_softvol.c +@@ -1164,5 +1164,5 @@ int _snd_pcm_softvol_open(snd_pcm_t **pcmp, const char *name, + return err; + } + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_pcm_softvol_open, SND_PCM_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_pcm_softvol_open, SND_PCM_DLSYM_VERSION) + #endif +diff --git a/src/rawmidi/rawmidi_hw.c b/src/rawmidi/rawmidi_hw.c +index 7cc8c0d1..00236657 100644 +--- a/src/rawmidi/rawmidi_hw.c ++++ b/src/rawmidi/rawmidi_hw.c +@@ -358,4 +358,4 @@ int _snd_rawmidi_hw_open(snd_rawmidi_t **inputp, snd_rawmidi_t **outputp, + return -EINVAL; + return snd_rawmidi_hw_open(inputp, outputp, name, card, device, subdevice, mode); + } +-SND_DLSYM_BUILD_VERSION(_snd_rawmidi_hw_open, SND_RAWMIDI_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_rawmidi_hw_open, SND_RAWMIDI_DLSYM_VERSION) +diff --git a/src/rawmidi/rawmidi_virt.c b/src/rawmidi/rawmidi_virt.c +index 2c4c27f5..5d2f7112 100644 +--- a/src/rawmidi/rawmidi_virt.c ++++ b/src/rawmidi/rawmidi_virt.c +@@ -467,5 +467,5 @@ int _snd_rawmidi_virtual_open(snd_rawmidi_t **inputp, snd_rawmidi_t **outputp, + } + + #ifndef DOC_HIDDEN +-SND_DLSYM_BUILD_VERSION(_snd_rawmidi_virtual_open, SND_RAWMIDI_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_rawmidi_virtual_open, SND_RAWMIDI_DLSYM_VERSION) + #endif +diff --git a/src/seq/seq_hw.c b/src/seq/seq_hw.c +index e4b4d2a0..dddf4bf7 100644 +--- a/src/seq/seq_hw.c ++++ b/src/seq/seq_hw.c +@@ -562,4 +562,4 @@ int _snd_seq_hw_open(snd_seq_t **handlep, char *name, + } + return snd_seq_hw_open(handlep, name, streams, mode); + } +-SND_DLSYM_BUILD_VERSION(_snd_seq_hw_open, SND_SEQ_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_seq_hw_open, SND_SEQ_DLSYM_VERSION) +diff --git a/src/timer/timer.c b/src/timer/timer.c +index 670becd9..8beb90d1 100644 +--- a/src/timer/timer.c ++++ b/src/timer/timer.c +@@ -643,7 +643,7 @@ int snd_timer_params_set_exclusive(snd_timer_params_t * params, int exclusive) + params->flags &= ~SNDRV_TIMER_PSFLG_EXCLUSIVE; + return 0; + } +-use_default_symbol_version(__snd_timer_params_set_exclusive, snd_timer_params_set_exclusive, ALSA_0.9.0); ++use_default_symbol_version(__snd_timer_params_set_exclusive, snd_timer_params_set_exclusive, ALSA_0.9.0) + + /** + * \brief determine if timer has exclusive flag +@@ -659,7 +659,7 @@ int snd_timer_params_get_exclusive(snd_timer_params_t * params) + assert(params); + return params->flags & SNDRV_TIMER_PSFLG_EXCLUSIVE ? 1 : 0; + } +-use_default_symbol_version(__snd_timer_params_get_exclusive, snd_timer_params_get_exclusive, ALSA_0.9.0); ++use_default_symbol_version(__snd_timer_params_get_exclusive, snd_timer_params_get_exclusive, ALSA_0.9.0) + + /** + * \brief set timer early event +@@ -745,7 +745,7 @@ void snd_timer_params_set_filter(snd_timer_params_t * params, unsigned int filte + assert(params); + params->filter = filter; + } +-use_default_symbol_version(__snd_timer_params_set_filter, snd_timer_params_set_filter, ALSA_0.9.0); ++use_default_symbol_version(__snd_timer_params_set_filter, snd_timer_params_set_filter, ALSA_0.9.0) + + /** + * \brief get timer event filter +@@ -761,7 +761,7 @@ unsigned int snd_timer_params_get_filter(snd_timer_params_t * params) + assert(params); + return params->filter; + } +-use_default_symbol_version(__snd_timer_params_get_filter, snd_timer_params_get_filter, ALSA_0.9.0); ++use_default_symbol_version(__snd_timer_params_get_filter, snd_timer_params_get_filter, ALSA_0.9.0) + + /** + * \brief set parameters for timer handle +@@ -954,5 +954,5 @@ long snd_timer_info_get_ticks(snd_timer_info_t * info) + return 1; + } + #ifndef DOC_HIDDEN +-link_warning(snd_timer_info_get_ticks, "Warning: snd_timer_info_get_ticks is deprecated"); ++link_warning(snd_timer_info_get_ticks, "Warning: snd_timer_info_get_ticks is deprecated") + #endif +diff --git a/src/timer/timer_hw.c b/src/timer/timer_hw.c +index f08c0ac0..3ed78224 100644 +--- a/src/timer/timer_hw.c ++++ b/src/timer/timer_hw.c +@@ -340,4 +340,4 @@ int _snd_timer_hw_open(snd_timer_t **timer, char *name, + return -EINVAL; + return snd_timer_hw_open(timer, name, dev_class, dev_sclass, card, device, subdevice, mode); + } +-SND_DLSYM_BUILD_VERSION(_snd_timer_hw_open, SND_TIMER_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_timer_hw_open, SND_TIMER_DLSYM_VERSION) +diff --git a/src/timer/timer_query.c b/src/timer/timer_query.c +index 084ff61a..83543522 100644 +--- a/src/timer/timer_query.c ++++ b/src/timer/timer_query.c +@@ -393,7 +393,7 @@ int snd_timer_query_info(snd_timer_query_t *timer, snd_timer_ginfo_t *info) + assert(info); + return timer->ops->info(timer, info); + } +-use_default_symbol_version(__snd_timer_query_info, snd_timer_query_info, ALSA_0.9.0); ++use_default_symbol_version(__snd_timer_query_info, snd_timer_query_info, ALSA_0.9.0) + + /** + * \brief set the timer global parameters +@@ -411,7 +411,7 @@ int snd_timer_query_params(snd_timer_query_t *timer, snd_timer_gparams_t *params + assert(params); + return timer->ops->params(timer, params); + } +-use_default_symbol_version(__snd_timer_query_params, snd_timer_query_params, ALSA_0.9.0); ++use_default_symbol_version(__snd_timer_query_params, snd_timer_query_params, ALSA_0.9.0) + + /** + * \brief get the timer global status +@@ -429,7 +429,7 @@ int snd_timer_query_status(snd_timer_query_t *timer, snd_timer_gstatus_t *status + assert(status); + return timer->ops->status(timer, status); + } +-use_default_symbol_version(__snd_timer_query_status, snd_timer_query_status, ALSA_0.9.0); ++use_default_symbol_version(__snd_timer_query_status, snd_timer_query_status, ALSA_0.9.0) + + /** + * \brief get size of the snd_timer_id_t structure in bytes +diff --git a/src/timer/timer_query_hw.c b/src/timer/timer_query_hw.c +index dad228c8..7fc7cf4d 100644 +--- a/src/timer/timer_query_hw.c ++++ b/src/timer/timer_query_hw.c +@@ -135,4 +135,4 @@ int _snd_timer_query_hw_open(snd_timer_query_t **timer, char *name, + } + return snd_timer_query_hw_open(timer, name, mode); + } +-SND_DLSYM_BUILD_VERSION(_snd_timer_query_hw_open, SND_TIMER_QUERY_DLSYM_VERSION); ++SND_DLSYM_BUILD_VERSION(_snd_timer_query_hw_open, SND_TIMER_QUERY_DLSYM_VERSION) +-- +2.22.0 + diff --git a/pkg/alsa-lib/patch/0011-Don-t-use-inline-asm-on-non-GNU-compilers.patch b/pkg/alsa-lib/patch/0011-Don-t-use-inline-asm-on-non-GNU-compilers.patch @@ -0,0 +1,25 @@ +From f0732cf0a75f47eddc200bb6fa9c91250e257a3c Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Wed, 3 Jul 2019 18:27:09 -0700 +Subject: [PATCH] Don't use inline asm on non-GNU compilers + +--- + include/local.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/local.h b/include/local.h +index ce142d04..df3e6c31 100644 +--- a/include/local.h ++++ b/include/local.h +@@ -265,7 +265,7 @@ extern snd_lib_error_handler_t snd_err_msg; + + #define ASM_NAME(name) __SYMBOL_PREFIX name + +-#ifdef HAVE_GNU_LD ++#if defined(HAVE_GNU_LD) && defined(__GNUC__) + # ifdef HAVE_ELF + + /* We want the .gnu.warning.SYMBOL section to be unallocated. */ +-- +2.22.0 + diff --git a/pkg/alsa-lib/patch/0012-Use-switch-statements-instead-of-labels-as-values.patch b/pkg/alsa-lib/patch/0012-Use-switch-statements-instead-of-labels-as-values.patch @@ -0,0 +1,1708 @@ +From 9e429a5ce747070338395bebffe575083fa94aa9 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Fri, 31 May 2019 17:47:08 -0700 +Subject: [PATCH] Use switch statements instead of labels as values + +--- + src/pcm/pcm_adpcm.c | 20 +- + src/pcm/pcm_alaw.c | 20 +- + src/pcm/pcm_iec958.c | 20 +- + src/pcm/pcm_lfloat.c | 38 +- + src/pcm/pcm_linear.c | 22 +- + src/pcm/pcm_mulaw.c | 20 +- + src/pcm/pcm_rate.c | 28 +- + src/pcm/pcm_rate_linear.c | 40 +- + src/pcm/pcm_route.c | 161 ++----- + src/pcm/plugin_ops.h | 928 ++++++++++++++------------------------ + 10 files changed, 399 insertions(+), 898 deletions(-) + +diff --git a/src/pcm/pcm_adpcm.c b/src/pcm/pcm_adpcm.c +index ae0bfae2..457ae06e 100644 +--- a/src/pcm/pcm_adpcm.c ++++ b/src/pcm/pcm_adpcm.c +@@ -221,10 +221,6 @@ void snd_pcm_adpcm_decode(const snd_pcm_channel_area_t *dst_areas, + unsigned int putidx, + snd_pcm_adpcm_state_t *states) + { +-#define PUT16_LABELS +-#include "plugin_ops.h" +-#undef PUT16_LABELS +- void *put = put16_labels[putidx]; + unsigned int channel; + for (channel = 0; channel < channels; ++channel, ++states) { + const char *src; +@@ -250,11 +246,7 @@ void snd_pcm_adpcm_decode(const snd_pcm_channel_area_t *dst_areas, + else + v = (*src >> 4) & 0x0f; + sample = adpcm_decoder(v, states); +- goto *put; +-#define PUT16_END after +-#include "plugin_ops.h" +-#undef PUT16_END +- after: ++ put16(dst, sample, putidx); + src += src_step; + srcbit += srcbit_step; + if (srcbit == 8) { +@@ -274,10 +266,6 @@ void snd_pcm_adpcm_encode(const snd_pcm_channel_area_t *dst_areas, + unsigned int getidx, + snd_pcm_adpcm_state_t *states) + { +-#define GET16_LABELS +-#include "plugin_ops.h" +-#undef GET16_LABELS +- void *get = get16_labels[getidx]; + unsigned int channel; + int16_t sample = 0; + for (channel = 0; channel < channels; ++channel, ++states) { +@@ -298,11 +286,7 @@ void snd_pcm_adpcm_encode(const snd_pcm_channel_area_t *dst_areas, + frames1 = frames; + while (frames1-- > 0) { + int v; +- goto *get; +-#define GET16_END after +-#include "plugin_ops.h" +-#undef GET16_END +- after: ++ sample = get16(src, getidx); + v = adpcm_encoder(sample, states); + if (dstbit) + *dst = (*dst & 0xf0) | v; +diff --git a/src/pcm/pcm_alaw.c b/src/pcm/pcm_alaw.c +index 839783cf..bc1463a7 100644 +--- a/src/pcm/pcm_alaw.c ++++ b/src/pcm/pcm_alaw.c +@@ -148,10 +148,6 @@ void snd_pcm_alaw_decode(const snd_pcm_channel_area_t *dst_areas, + unsigned int channels, snd_pcm_uframes_t frames, + unsigned int putidx) + { +-#define PUT16_LABELS +-#include "plugin_ops.h" +-#undef PUT16_LABELS +- void *put = put16_labels[putidx]; + unsigned int channel; + for (channel = 0; channel < channels; ++channel) { + const unsigned char *src; +@@ -167,11 +163,7 @@ void snd_pcm_alaw_decode(const snd_pcm_channel_area_t *dst_areas, + frames1 = frames; + while (frames1-- > 0) { + int16_t sample = alaw_to_s16(*src); +- goto *put; +-#define PUT16_END after +-#include "plugin_ops.h" +-#undef PUT16_END +- after: ++ put16(dst, sample, putidx); + src += src_step; + dst += dst_step; + } +@@ -185,10 +177,6 @@ void snd_pcm_alaw_encode(const snd_pcm_channel_area_t *dst_areas, + unsigned int channels, snd_pcm_uframes_t frames, + unsigned int getidx) + { +-#define GET16_LABELS +-#include "plugin_ops.h" +-#undef GET16_LABELS +- void *get = get16_labels[getidx]; + unsigned int channel; + int16_t sample = 0; + for (channel = 0; channel < channels; ++channel) { +@@ -204,11 +192,7 @@ void snd_pcm_alaw_encode(const snd_pcm_channel_area_t *dst_areas, + dst_step = snd_pcm_channel_area_step(dst_area); + frames1 = frames; + while (frames1-- > 0) { +- goto *get; +-#define GET16_END after +-#include "plugin_ops.h" +-#undef GET16_END +- after: ++ sample = get16(src, getidx); + *dst = s16_to_alaw(sample); + src += src_step; + dst += dst_step; +diff --git a/src/pcm/pcm_iec958.c b/src/pcm/pcm_iec958.c +index f994876b..c6df5ef1 100644 +--- a/src/pcm/pcm_iec958.c ++++ b/src/pcm/pcm_iec958.c +@@ -149,10 +149,6 @@ static void snd_pcm_iec958_decode(snd_pcm_iec958_t *iec, + snd_pcm_uframes_t src_offset, + unsigned int channels, snd_pcm_uframes_t frames) + { +-#define PUT32_LABELS +-#include "plugin_ops.h" +-#undef PUT32_LABELS +- void *put = put32_labels[iec->getput_idx]; + unsigned int channel; + for (channel = 0; channel < channels; ++channel) { + const uint32_t *src; +@@ -168,11 +164,7 @@ static void snd_pcm_iec958_decode(snd_pcm_iec958_t *iec, + frames1 = frames; + while (frames1-- > 0) { + int32_t sample = iec958_to_s32(iec, *src); +- goto *put; +-#define PUT32_END after +-#include "plugin_ops.h" +-#undef PUT32_END +- after: ++ put32(dst, sample, iec->getput_idx); + src += src_step; + dst += dst_step; + } +@@ -186,10 +178,6 @@ static void snd_pcm_iec958_encode(snd_pcm_iec958_t *iec, + snd_pcm_uframes_t src_offset, + unsigned int channels, snd_pcm_uframes_t frames) + { +-#define GET32_LABELS +-#include "plugin_ops.h" +-#undef GET32_LABELS +- void *get = get32_labels[iec->getput_idx]; + unsigned int channel; + int32_t sample = 0; + int counter = iec->counter; +@@ -207,11 +195,7 @@ static void snd_pcm_iec958_encode(snd_pcm_iec958_t *iec, + frames1 = frames; + iec->counter = counter; + while (frames1-- > 0) { +- goto *get; +-#define GET32_END after +-#include "plugin_ops.h" +-#undef GET32_END +- after: ++ sample = get32(src, iec->getput_idx); + sample = iec958_subframe(iec, sample, channel); + // fprintf(stderr, "%d:%08x\n", frames1, sample); + *dst = sample; +diff --git a/src/pcm/pcm_lfloat.c b/src/pcm/pcm_lfloat.c +index 0447d0a2..f51bd1fb 100644 +--- a/src/pcm/pcm_lfloat.c ++++ b/src/pcm/pcm_lfloat.c +@@ -98,13 +98,6 @@ void snd_pcm_lfloat_convert_integer_float(const snd_pcm_channel_area_t *dst_area + unsigned int channels, snd_pcm_uframes_t frames, + unsigned int get32idx, unsigned int put32floatidx) + { +-#define GET32_LABELS +-#define PUT32F_LABELS +-#include "plugin_ops.h" +-#undef PUT32F_LABELS +-#undef GET32_LABELS +- void *get32 = get32_labels[get32idx]; +- void *put32float = put32float_labels[put32floatidx]; + unsigned int channel; + for (channel = 0; channel < channels; ++channel) { + const char *src; +@@ -122,16 +115,8 @@ void snd_pcm_lfloat_convert_integer_float(const snd_pcm_channel_area_t *dst_area + dst_step = snd_pcm_channel_area_step(dst_area); + frames1 = frames; + while (frames1-- > 0) { +- goto *get32; +-#define GET32_END sample_loaded +-#include "plugin_ops.h" +-#undef GET32_END +- sample_loaded: +- goto *put32float; +-#define PUT32F_END sample_put +-#include "plugin_ops.h" +-#undef PUT32F_END +- sample_put: ++ sample = get32(src, get32idx); ++ put32float(dst, sample, put32floatidx); + src += src_step; + dst += dst_step; + } +@@ -143,13 +128,6 @@ void snd_pcm_lfloat_convert_float_integer(const snd_pcm_channel_area_t *dst_area + unsigned int channels, snd_pcm_uframes_t frames, + unsigned int put32idx, unsigned int get32floatidx) + { +-#define PUT32_LABELS +-#define GET32F_LABELS +-#include "plugin_ops.h" +-#undef GET32F_LABELS +-#undef PUT32_LABELS +- void *put32 = put32_labels[put32idx]; +- void *get32float = get32float_labels[get32floatidx]; + unsigned int channel; + for (channel = 0; channel < channels; ++channel) { + const char *src; +@@ -167,16 +145,8 @@ void snd_pcm_lfloat_convert_float_integer(const snd_pcm_channel_area_t *dst_area + dst_step = snd_pcm_channel_area_step(dst_area); + frames1 = frames; + while (frames1-- > 0) { +- goto *get32float; +-#define GET32F_END sample_loaded +-#include "plugin_ops.h" +-#undef GET32F_END +- sample_loaded: +- goto *put32; +-#define PUT32_END sample_put +-#include "plugin_ops.h" +-#undef PUT32_END +- sample_put: ++ sample = get32float(src, get32floatidx); ++ put32(dst, sample, put32idx); + src += src_step; + dst += dst_step; + } +diff --git a/src/pcm/pcm_linear.c b/src/pcm/pcm_linear.c +index 26b4f4e5..d0ba3c46 100644 +--- a/src/pcm/pcm_linear.c ++++ b/src/pcm/pcm_linear.c +@@ -149,10 +149,6 @@ void snd_pcm_linear_convert(const snd_pcm_channel_area_t *dst_areas, snd_pcm_ufr + unsigned int channels, snd_pcm_uframes_t frames, + unsigned int convidx) + { +-#define CONV_LABELS +-#include "plugin_ops.h" +-#undef CONV_LABELS +- void *conv = conv_labels[convidx]; + unsigned int channel; + for (channel = 0; channel < channels; ++channel) { + const char *src; +@@ -167,11 +163,7 @@ void snd_pcm_linear_convert(const snd_pcm_channel_area_t *dst_areas, snd_pcm_ufr + dst_step = snd_pcm_channel_area_step(dst_area); + frames1 = frames; + while (frames1-- > 0) { +- goto *conv; +-#define CONV_END after +-#include "plugin_ops.h" +-#undef CONV_END +- after: ++ conv(dst, src, convidx); + src += src_step; + dst += dst_step; + } +@@ -183,11 +175,6 @@ void snd_pcm_linear_getput(const snd_pcm_channel_area_t *dst_areas, snd_pcm_ufra + unsigned int channels, snd_pcm_uframes_t frames, + unsigned int get_idx, unsigned int put_idx) + { +-#define CONV24_LABELS +-#include "plugin_ops.h" +-#undef CONV24_LABELS +- void *get = get32_labels[get_idx]; +- void *put = put32_labels[put_idx]; + unsigned int channel; + uint32_t sample = 0; + for (channel = 0; channel < channels; ++channel) { +@@ -203,11 +190,8 @@ void snd_pcm_linear_getput(const snd_pcm_channel_area_t *dst_areas, snd_pcm_ufra + dst_step = snd_pcm_channel_area_step(dst_area); + frames1 = frames; + while (frames1-- > 0) { +- goto *get; +-#define CONV24_END after +-#include "plugin_ops.h" +-#undef CONV24_END +- after: ++ sample = get32(src, get_idx); ++ put32(dst, sample, put_idx); + src += src_step; + dst += dst_step; + } +diff --git a/src/pcm/pcm_mulaw.c b/src/pcm/pcm_mulaw.c +index 58f741b6..1bab7edd 100644 +--- a/src/pcm/pcm_mulaw.c ++++ b/src/pcm/pcm_mulaw.c +@@ -165,10 +165,6 @@ void snd_pcm_mulaw_decode(const snd_pcm_channel_area_t *dst_areas, + unsigned int channels, snd_pcm_uframes_t frames, + unsigned int putidx) + { +-#define PUT16_LABELS +-#include "plugin_ops.h" +-#undef PUT16_LABELS +- void *put = put16_labels[putidx]; + unsigned int channel; + for (channel = 0; channel < channels; ++channel) { + const unsigned char *src; +@@ -184,11 +180,7 @@ void snd_pcm_mulaw_decode(const snd_pcm_channel_area_t *dst_areas, + frames1 = frames; + while (frames1-- > 0) { + int16_t sample = ulaw_to_s16(*src); +- goto *put; +-#define PUT16_END after +-#include "plugin_ops.h" +-#undef PUT16_END +- after: ++ put16(dst, sample, putidx); + src += src_step; + dst += dst_step; + } +@@ -202,10 +194,6 @@ void snd_pcm_mulaw_encode(const snd_pcm_channel_area_t *dst_areas, + unsigned int channels, snd_pcm_uframes_t frames, + unsigned int getidx) + { +-#define GET16_LABELS +-#include "plugin_ops.h" +-#undef GET16_LABELS +- void *get = get16_labels[getidx]; + unsigned int channel; + int16_t sample = 0; + for (channel = 0; channel < channels; ++channel) { +@@ -221,11 +209,7 @@ void snd_pcm_mulaw_encode(const snd_pcm_channel_area_t *dst_areas, + dst_step = snd_pcm_channel_area_step(dst_area); + frames1 = frames; + while (frames1-- > 0) { +- goto *get; +-#define GET16_END after +-#include "plugin_ops.h" +-#undef GET16_END +- after: ++ sample = get16(src, getidx); + *dst = s16_to_ulaw(sample); + src += src_step; + dst += dst_step; +diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c +index 0e82a9ed..f15cea81 100644 +--- a/src/pcm/pcm_rate.c ++++ b/src/pcm/pcm_rate.c +@@ -431,12 +431,6 @@ static void convert_to_s16(snd_pcm_rate_t *rate, int16_t *buf, + snd_pcm_uframes_t offset, unsigned int frames, + unsigned int channels) + { +-#ifndef DOC_HIDDEN +-#define GET16_LABELS +-#include "plugin_ops.h" +-#undef GET16_LABELS +-#endif /* DOC_HIDDEN */ +- void *get = get16_labels[rate->get_idx]; + const char *src; + int16_t sample; + const char *srcs[channels]; +@@ -451,13 +445,7 @@ static void convert_to_s16(snd_pcm_rate_t *rate, int16_t *buf, + while (frames--) { + for (c = 0; c < channels; c++) { + src = srcs[c]; +- goto *get; +-#ifndef DOC_HIDDEN +-#define GET16_END after_get +-#include "plugin_ops.h" +-#undef GET16_END +-#endif /* DOC_HIDDEN */ +- after_get: ++ sample = get16(src, rate->get_idx); + *buf++ = sample; + srcs[c] += src_step[c]; + } +@@ -469,12 +457,6 @@ static void convert_from_s16(snd_pcm_rate_t *rate, const int16_t *buf, + snd_pcm_uframes_t offset, unsigned int frames, + unsigned int channels) + { +-#ifndef DOC_HIDDEN +-#define PUT16_LABELS +-#include "plugin_ops.h" +-#undef PUT16_LABELS +-#endif /* DOC_HIDDEN */ +- void *put = put16_labels[rate->put_idx]; + char *dst; + int16_t sample; + char *dsts[channels]; +@@ -490,13 +472,7 @@ static void convert_from_s16(snd_pcm_rate_t *rate, const int16_t *buf, + for (c = 0; c < channels; c++) { + dst = dsts[c]; + sample = *buf++; +- goto *put; +-#ifndef DOC_HIDDEN +-#define PUT16_END after_put +-#include "plugin_ops.h" +-#undef PUT16_END +-#endif /* DOC_HIDDEN */ +- after_put: ++ put16(dst, sample, rate->put_idx); + dsts[c] += dst_step[c]; + } + } +diff --git a/src/pcm/pcm_rate_linear.c b/src/pcm/pcm_rate_linear.c +index 7fe943d2..2789136e 100644 +--- a/src/pcm/pcm_rate_linear.c ++++ b/src/pcm/pcm_rate_linear.c +@@ -71,13 +71,6 @@ static void linear_expand(struct rate_linear *rate, + const snd_pcm_channel_area_t *src_areas, + snd_pcm_uframes_t src_offset, unsigned int src_frames) + { +-#define GET16_LABELS +-#define PUT16_LABELS +-#include "plugin_ops.h" +-#undef GET16_LABELS +-#undef PUT16_LABELS +- void *get = get16_labels[rate->get_idx]; +- void *put = put16_labels[rate->put_idx]; + unsigned int get_threshold = rate->pitch; + unsigned int channel; + unsigned int src_frames1; +@@ -107,22 +100,14 @@ static void linear_expand(struct rate_linear *rate, + pos -= get_threshold; + old_sample = new_sample; + if (src_frames1 < src_frames) { +- goto *get; +-#define GET16_END after_get +-#include "plugin_ops.h" +-#undef GET16_END +- after_get: ++ sample = get16(src, rate->get_idx); + new_sample = sample; + } + } + new_weight = (pos << (16 - rate->pitch_shift)) / (get_threshold >> rate->pitch_shift); + old_weight = 0x10000 - new_weight; + sample = (old_sample * old_weight + new_sample * new_weight) >> 16; +- goto *put; +-#define PUT16_END after_put +-#include "plugin_ops.h" +-#undef PUT16_END +- after_put: ++ put16(dst, sample, rate->put_idx); + dst += dst_step; + dst_frames1++; + pos += LINEAR_DIV; +@@ -193,13 +178,6 @@ static void linear_shrink(struct rate_linear *rate, + const snd_pcm_channel_area_t *src_areas, + snd_pcm_uframes_t src_offset, unsigned int src_frames) + { +-#define GET16_LABELS +-#define PUT16_LABELS +-#include "plugin_ops.h" +-#undef GET16_LABELS +-#undef PUT16_LABELS +- void *get = get16_labels[rate->get_idx]; +- void *put = put16_labels[rate->put_idx]; + unsigned int get_increment = rate->pitch; + unsigned int channel; + unsigned int src_frames1; +@@ -224,13 +202,7 @@ static void linear_shrink(struct rate_linear *rate, + src_frames1 = 0; + dst_frames1 = 0; + while (src_frames1 < src_frames) { +- +- goto *get; +-#define GET16_END after_get +-#include "plugin_ops.h" +-#undef GET16_END +- after_get: +- new_sample = sample; ++ new_sample = get16(src, rate->get_idx); + src += src_step; + src_frames1++; + pos += get_increment; +@@ -239,11 +211,7 @@ static void linear_shrink(struct rate_linear *rate, + old_weight = (pos << (32 - LINEAR_DIV_SHIFT)) / (get_increment >> (LINEAR_DIV_SHIFT - 16)); + new_weight = 0x10000 - old_weight; + sample = (old_sample * old_weight + new_sample * new_weight) >> 16; +- goto *put; +-#define PUT16_END after_put +-#include "plugin_ops.h" +-#undef PUT16_END +- after_put: ++ put16(dst, sample, rate->put_idx); + dst += dst_step; + dst_frames1++; + if (CHECK_SANITY(dst_frames1 > dst_frames)) { +diff --git a/src/pcm/pcm_route.c b/src/pcm/pcm_route.c +index 325eee62..b93b8bd9 100644 +--- a/src/pcm/pcm_route.c ++++ b/src/pcm/pcm_route.c +@@ -131,10 +131,6 @@ static void snd_pcm_route_convert1_one(const snd_pcm_channel_area_t *dst_area, + const snd_pcm_route_ttable_dst_t* ttable, + const snd_pcm_route_params_t *params) + { +-#define CONV_LABELS +-#include "plugin_ops.h" +-#undef CONV_LABELS +- void *conv; + const snd_pcm_channel_area_t *src_area = 0; + unsigned int srcidx; + const char *src; +@@ -156,17 +152,12 @@ static void snd_pcm_route_convert1_one(const snd_pcm_channel_area_t *dst_area, + return; + } + +- conv = conv_labels[params->conv_idx]; + src = snd_pcm_channel_area_addr(src_area, src_offset); + dst = snd_pcm_channel_area_addr(dst_area, dst_offset); + src_step = snd_pcm_channel_area_step(src_area); + dst_step = snd_pcm_channel_area_step(dst_area); + while (frames-- > 0) { +- goto *conv; +-#define CONV_END after +-#include "plugin_ops.h" +-#undef CONV_END +- after: ++ conv(dst, src, params->conv_idx); + src += src_step; + dst += dst_step; + } +@@ -181,10 +172,6 @@ static void snd_pcm_route_convert1_one_getput(const snd_pcm_channel_area_t *dst_ + const snd_pcm_route_ttable_dst_t* ttable, + const snd_pcm_route_params_t *params) + { +-#define CONV24_LABELS +-#include "plugin_ops.h" +-#undef CONV24_LABELS +- void *get, *put; + const snd_pcm_channel_area_t *src_area = 0; + unsigned int srcidx; + const char *src; +@@ -207,18 +194,13 @@ static void snd_pcm_route_convert1_one_getput(const snd_pcm_channel_area_t *dst_ + return; + } + +- get = get32_labels[params->get_idx]; +- put = put32_labels[params->put_idx]; + src = snd_pcm_channel_area_addr(src_area, src_offset); + dst = snd_pcm_channel_area_addr(dst_area, dst_offset); + src_step = snd_pcm_channel_area_step(src_area); + dst_step = snd_pcm_channel_area_step(dst_area); + while (frames-- > 0) { +- goto *get; +-#define CONV24_END after +-#include "plugin_ops.h" +-#undef CONV24_END +- after: ++ sample = get32(src, params->get_idx); ++ put32(dst, sample, params->put_idx); + src += src_step; + dst += dst_step; + } +@@ -233,34 +215,6 @@ static void snd_pcm_route_convert1_many(const snd_pcm_channel_area_t *dst_area, + const snd_pcm_route_ttable_dst_t* ttable, + const snd_pcm_route_params_t *params) + { +-#define GET32_LABELS +-#define PUT32_LABELS +-#include "plugin_ops.h" +-#undef GET32_LABELS +-#undef PUT32_LABELS +- static void *const zero_labels[2] = { +- &&zero_int64, +-#if SND_PCM_PLUGIN_ROUTE_FLOAT +- &&zero_float +-#endif +- }; +- /* sum_type att */ +- static void *const add_labels[2 * 2] = { +- &&add_int64_noatt, &&add_int64_att, +-#if SND_PCM_PLUGIN_ROUTE_FLOAT +- &&add_float_noatt, &&add_float_att +-#endif +- }; +- /* sum_type att */ +- static void *const norm_labels[2 * 2] = { +- &&norm_int64_noatt, +- &&norm_int64_att, +-#if SND_PCM_PLUGIN_ROUTE_FLOAT +- &&norm_float, +- &&norm_float, +-#endif +- }; +- void *zero, *get32, *add, *norm, *put32; + int nsrcs = ttable->nsrcs; + char *dst; + int dst_step; +@@ -301,11 +255,6 @@ static void snd_pcm_route_convert1_many(const snd_pcm_channel_area_t *dst_area, + return; + } + +- zero = zero_labels[params->sum_idx]; +- get32 = get32_labels[params->get_idx]; +- add = add_labels[params->sum_idx * 2 + ttable->att]; +- norm = norm_labels[params->sum_idx * 2 + ttable->att]; +- put32 = put32_labels[params->put_idx]; + dst = snd_pcm_channel_area_addr(dst_area, dst_offset); + dst_step = snd_pcm_channel_area_step(dst_area); + +@@ -314,83 +263,71 @@ static void snd_pcm_route_convert1_many(const snd_pcm_channel_area_t *dst_area, + sum_t sum; + + /* Zero sum */ +- goto *zero; +- zero_int64: +- sum.as_sint64 = 0; +- goto zero_end; ++ switch (params->sum_idx) { ++ case 0: sum.as_sint64 = 0; break; + #if SND_PCM_PLUGIN_ROUTE_FLOAT +- zero_float: +- sum.as_float = 0.0; +- goto zero_end; ++ case 1: sum.as_float = 0.0; break; + #endif +- zero_end: ++ } + for (srcidx = 0; srcidx < nsrcs; ++srcidx) { + const char *src = srcs[srcidx]; + + /* Get sample */ +- goto *get32; +-#define GET32_END after_get +-#include "plugin_ops.h" +-#undef GET32_END +- after_get: ++ sample = get32(src, params->get_idx); + + /* Sum */ +- goto *add; +- add_int64_att: +- sum.as_sint64 += (int64_t) sample * ttp->as_int; +- goto after_sum; +- add_int64_noatt: +- if (ttp->as_int) +- sum.as_sint64 += sample; +- goto after_sum; ++ switch (params->sum_idx * 2 + ttable->att) { ++ case 0: ++ if (ttp->as_int) ++ sum.as_sint64 += sample; ++ break; ++ case 1: ++ sum.as_sint64 += (int64_t) sample * ttp->as_int; ++ break; + #if SND_PCM_PLUGIN_ROUTE_FLOAT +- add_float_att: +- sum.as_float += sample * ttp->as_float; +- goto after_sum; +- add_float_noatt: +- if (ttp->as_int) +- sum.as_float += sample; +- goto after_sum; ++ case 2: ++ if (ttp->as_int) ++ sum.as_float += sample; ++ break; ++ case 3: ++ sum.as_float += sample * ttp->as_float; ++ break; + #endif +- after_sum: ++ } + srcs[srcidx] += src_steps[srcidx]; + ttp++; + } + + /* Normalization */ +- goto *norm; +- norm_int64_att: +- div(sum.as_sint64); +- /* fallthru */ +- norm_int64_noatt: +- if (sum.as_sint64 > (int64_t)0x7fffffff) +- sample = 0x7fffffff; /* maximum positive value */ +- else if (sum.as_sint64 < -(int64_t)0x80000000) +- sample = 0x80000000; /* maximum negative value */ +- else +- sample = sum.as_sint64; +- goto after_norm; +- ++ switch (params->sum_idx * 2 + ttable->att) { ++ case 1: ++ div(sum.as_sint64); ++ /* fallthru */ ++ case 0: ++ if (sum.as_sint64 > (int64_t)0x7fffffff) ++ sample = 0x7fffffff; /* maximum positive value */ ++ else if (sum.as_sint64 < -(int64_t)0x80000000) ++ sample = 0x80000000; /* maximum negative value */ ++ else ++ sample = sum.as_sint64; ++ break; + #if SND_PCM_PLUGIN_ROUTE_FLOAT +- norm_float: +- sum.as_float = rint(sum.as_float); +- if (sum.as_float > (int64_t)0x7fffffff) +- sample = 0x7fffffff; /* maximum positive value */ +- else if (sum.as_float < -(int64_t)0x80000000) +- sample = 0x80000000; /* maximum negative value */ +- else +- sample = sum.as_float; +- goto after_norm; ++ case 2: ++ case 3: ++ sum.as_float = rint(sum.as_float); ++ if (sum.as_float > (int64_t)0x7fffffff) ++ sample = 0x7fffffff; /* maximum positive value */ ++ else if (sum.as_float < -(int64_t)0x80000000) ++ sample = 0x80000000; /* maximum negative value */ ++ else ++ sample = sum.as_float; ++ break; + #endif +- after_norm: ++ } + + /* Put sample */ +- goto *put32; +-#define PUT32_END after_put32 +-#include "plugin_ops.h" +-#undef PUT32_END +- after_put32: +- ++ put32(dst, sample, params->put_idx); ++ + dst += dst_step; + } + } +diff --git a/src/pcm/plugin_ops.h b/src/pcm/plugin_ops.h +index 6392073c..ab9bf42e 100644 +--- a/src/pcm/plugin_ops.h ++++ b/src/pcm/plugin_ops.h +@@ -19,6 +19,9 @@ + * + */ + ++#include <math.h> ++#include <stdint.h> ++ + #ifndef SX_INLINES + #define SX_INLINES + static inline uint32_t sx20(uint32_t x) +@@ -92,626 +95,353 @@ static inline uint32_t sx24s(uint32_t x) + #define _put_triple_s(ptr,val) _put_triple_le(ptr,val) + #endif + +-#ifdef CONV_LABELS +-/* src_wid src_endswap sign_toggle dst_wid dst_endswap */ +-static void *const conv_labels[4 * 2 * 2 * 4 * 2] = { +- &&conv_xxx1_xxx1, /* 8h -> 8h */ +- &&conv_xxx1_xxx1, /* 8h -> 8s */ +- &&conv_xxx1_xx10, /* 8h -> 16h */ +- &&conv_xxx1_xx01, /* 8h -> 16s */ +- &&conv_xxx1_x100, /* 8h -> 24h */ +- &&conv_xxx1_001x, /* 8h -> 24s */ +- &&conv_xxx1_1000, /* 8h -> 32h */ +- &&conv_xxx1_0001, /* 8h -> 32s */ +- &&conv_xxx1_xxx9, /* 8h ^> 8h */ +- &&conv_xxx1_xxx9, /* 8h ^> 8s */ +- &&conv_xxx1_xx90, /* 8h ^> 16h */ +- &&conv_xxx1_xx09, /* 8h ^> 16s */ +- &&conv_xxx1_x900, /* 8h ^> 24h */ +- &&conv_xxx1_009x, /* 8h ^> 24s */ +- &&conv_xxx1_9000, /* 8h ^> 32h */ +- &&conv_xxx1_0009, /* 8h ^> 32s */ +- &&conv_xxx1_xxx1, /* 8s -> 8h */ +- &&conv_xxx1_xxx1, /* 8s -> 8s */ +- &&conv_xxx1_xx10, /* 8s -> 16h */ +- &&conv_xxx1_xx01, /* 8s -> 16s */ +- &&conv_xxx1_x100, /* 8s -> 24h */ +- &&conv_xxx1_001x, /* 8s -> 24s */ +- &&conv_xxx1_1000, /* 8s -> 32h */ +- &&conv_xxx1_0001, /* 8s -> 32s */ +- &&conv_xxx1_xxx9, /* 8s ^> 8h */ +- &&conv_xxx1_xxx9, /* 8s ^> 8s */ +- &&conv_xxx1_xx90, /* 8s ^> 16h */ +- &&conv_xxx1_xx09, /* 8s ^> 16s */ +- &&conv_xxx1_x900, /* 8s ^> 24h */ +- &&conv_xxx1_009x, /* 8s ^> 24s */ +- &&conv_xxx1_9000, /* 8s ^> 32h */ +- &&conv_xxx1_0009, /* 8s ^> 32s */ +- &&conv_xx12_xxx1, /* 16h -> 8h */ +- &&conv_xx12_xxx1, /* 16h -> 8s */ +- &&conv_xx12_xx12, /* 16h -> 16h */ +- &&conv_xx12_xx21, /* 16h -> 16s */ +- &&conv_xx12_x120, /* 16h -> 24h */ +- &&conv_xx12_021x, /* 16h -> 24s */ +- &&conv_xx12_1200, /* 16h -> 32h */ +- &&conv_xx12_0021, /* 16h -> 32s */ +- &&conv_xx12_xxx9, /* 16h ^> 8h */ +- &&conv_xx12_xxx9, /* 16h ^> 8s */ +- &&conv_xx12_xx92, /* 16h ^> 16h */ +- &&conv_xx12_xx29, /* 16h ^> 16s */ +- &&conv_xx12_x920, /* 16h ^> 24h */ +- &&conv_xx12_029x, /* 16h ^> 24s */ +- &&conv_xx12_9200, /* 16h ^> 32h */ +- &&conv_xx12_0029, /* 16h ^> 32s */ +- &&conv_xx12_xxx2, /* 16s -> 8h */ +- &&conv_xx12_xxx2, /* 16s -> 8s */ +- &&conv_xx12_xx21, /* 16s -> 16h */ +- &&conv_xx12_xx12, /* 16s -> 16s */ +- &&conv_xx12_x210, /* 16s -> 24h */ +- &&conv_xx12_012x, /* 16s -> 24s */ +- &&conv_xx12_2100, /* 16s -> 32h */ +- &&conv_xx12_0012, /* 16s -> 32s */ +- &&conv_xx12_xxxA, /* 16s ^> 8h */ +- &&conv_xx12_xxxA, /* 16s ^> 8s */ +- &&conv_xx12_xxA1, /* 16s ^> 16h */ +- &&conv_xx12_xx1A, /* 16s ^> 16s */ +- &&conv_xx12_xA10, /* 16s ^> 24h */ +- &&conv_xx12_01Ax, /* 16s ^> 24s */ +- &&conv_xx12_A100, /* 16s ^> 32h */ +- &&conv_xx12_001A, /* 16s ^> 32s */ +- &&conv_x123_xxx1, /* 24h -> 8h */ +- &&conv_x123_xxx1, /* 24h -> 8s */ +- &&conv_x123_xx12, /* 24h -> 16h */ +- &&conv_x123_xx21, /* 24h -> 16s */ +- &&conv_x123_x123, /* 24h -> 24h */ +- &&conv_x123_321x, /* 24h -> 24s */ +- &&conv_x123_1230, /* 24h -> 32h */ +- &&conv_x123_0321, /* 24h -> 32s */ +- &&conv_x123_xxx9, /* 24h ^> 8h */ +- &&conv_x123_xxx9, /* 24h ^> 8s */ +- &&conv_x123_xx92, /* 24h ^> 16h */ +- &&conv_x123_xx29, /* 24h ^> 16s */ +- &&conv_x123_x923, /* 24h ^> 24h */ +- &&conv_x123_329x, /* 24h ^> 24s */ +- &&conv_x123_9230, /* 24h ^> 32h */ +- &&conv_x123_0329, /* 24h ^> 32s */ +- &&conv_123x_xxx3, /* 24s -> 8h */ +- &&conv_123x_xxx3, /* 24s -> 8s */ +- &&conv_123x_xx32, /* 24s -> 16h */ +- &&conv_123x_xx23, /* 24s -> 16s */ +- &&conv_123x_x321, /* 24s -> 24h */ +- &&conv_123x_123x, /* 24s -> 24s */ +- &&conv_123x_3210, /* 24s -> 32h */ +- &&conv_123x_0123, /* 24s -> 32s */ +- &&conv_123x_xxxB, /* 24s ^> 8h */ +- &&conv_123x_xxxB, /* 24s ^> 8s */ +- &&conv_123x_xxB2, /* 24s ^> 16h */ +- &&conv_123x_xx2B, /* 24s ^> 16s */ +- &&conv_123x_xB21, /* 24s ^> 24h */ +- &&conv_123x_12Bx, /* 24s ^> 24s */ +- &&conv_123x_B210, /* 24s ^> 32h */ +- &&conv_123x_012B, /* 24s ^> 32s */ +- &&conv_1234_xxx1, /* 32h -> 8h */ +- &&conv_1234_xxx1, /* 32h -> 8s */ +- &&conv_1234_xx12, /* 32h -> 16h */ +- &&conv_1234_xx21, /* 32h -> 16s */ +- &&conv_1234_x123, /* 32h -> 24h */ +- &&conv_1234_321x, /* 32h -> 24s */ +- &&conv_1234_1234, /* 32h -> 32h */ +- &&conv_1234_4321, /* 32h -> 32s */ +- &&conv_1234_xxx9, /* 32h ^> 8h */ +- &&conv_1234_xxx9, /* 32h ^> 8s */ +- &&conv_1234_xx92, /* 32h ^> 16h */ +- &&conv_1234_xx29, /* 32h ^> 16s */ +- &&conv_1234_x923, /* 32h ^> 24h */ +- &&conv_1234_329x, /* 32h ^> 24s */ +- &&conv_1234_9234, /* 32h ^> 32h */ +- &&conv_1234_4329, /* 32h ^> 32s */ +- &&conv_1234_xxx4, /* 32s -> 8h */ +- &&conv_1234_xxx4, /* 32s -> 8s */ +- &&conv_1234_xx43, /* 32s -> 16h */ +- &&conv_1234_xx34, /* 32s -> 16s */ +- &&conv_1234_x432, /* 32s -> 24h */ +- &&conv_1234_234x, /* 32s -> 24s */ +- &&conv_1234_4321, /* 32s -> 32h */ +- &&conv_1234_1234, /* 32s -> 32s */ +- &&conv_1234_xxxC, /* 32s ^> 8h */ +- &&conv_1234_xxxC, /* 32s ^> 8s */ +- &&conv_1234_xxC3, /* 32s ^> 16h */ +- &&conv_1234_xx3C, /* 32s ^> 16s */ +- &&conv_1234_xC32, /* 32s ^> 24h */ +- &&conv_1234_23Cx, /* 32s ^> 24s */ +- &&conv_1234_C321, /* 32s ^> 32h */ +- &&conv_1234_123C, /* 32s ^> 32s */ +-}; +-#endif +- +-#ifdef CONV_END +-while(0) { +-conv_xxx1_xxx1: as_u8(dst) = as_u8c(src); goto CONV_END; +-conv_xxx1_xx10: as_u16(dst) = (uint16_t)as_u8c(src) << 8; goto CONV_END; +-conv_xxx1_xx01: as_u16(dst) = (uint16_t)as_u8c(src); goto CONV_END; +-conv_xxx1_x100: as_u32(dst) = sx24((uint32_t)as_u8c(src) << 16); goto CONV_END; +-conv_xxx1_001x: as_u32(dst) = sx24s((uint32_t)as_u8c(src) << 8); goto CONV_END; +-conv_xxx1_1000: as_u32(dst) = (uint32_t)as_u8c(src) << 24; goto CONV_END; +-conv_xxx1_0001: as_u32(dst) = (uint32_t)as_u8c(src); goto CONV_END; +-conv_xxx1_xxx9: as_u8(dst) = as_u8c(src) ^ 0x80; goto CONV_END; +-conv_xxx1_xx90: as_u16(dst) = (uint16_t)(as_u8c(src) ^ 0x80) << 8; goto CONV_END; +-conv_xxx1_xx09: as_u16(dst) = (uint16_t)(as_u8c(src) ^ 0x80); goto CONV_END; +-conv_xxx1_x900: as_u32(dst) = sx24((uint32_t)(as_u8c(src) ^ 0x80) << 16); goto CONV_END; +-conv_xxx1_009x: as_u32(dst) = sx24s((uint32_t)(as_u8c(src) ^ 0x80) << 8); goto CONV_END; +-conv_xxx1_9000: as_u32(dst) = (uint32_t)(as_u8c(src) ^ 0x80) << 24; goto CONV_END; +-conv_xxx1_0009: as_u32(dst) = (uint32_t)(as_u8c(src) ^ 0x80); goto CONV_END; +-conv_xx12_xxx1: as_u8(dst) = as_u16c(src) >> 8; goto CONV_END; +-conv_xx12_xx12: as_u16(dst) = as_u16c(src); goto CONV_END; +-conv_xx12_xx21: as_u16(dst) = bswap_16(as_u16c(src)); goto CONV_END; +-conv_xx12_x120: as_u32(dst) = sx24((uint32_t)as_u16c(src) << 8); goto CONV_END; +-conv_xx12_021x: as_u32(dst) = sx24s((uint32_t)bswap_16(as_u16c(src)) << 8); goto CONV_END; +-conv_xx12_1200: as_u32(dst) = (uint32_t)as_u16c(src) << 16; goto CONV_END; +-conv_xx12_0021: as_u32(dst) = (uint32_t)bswap_16(as_u16c(src)); goto CONV_END; +-conv_xx12_xxx9: as_u8(dst) = (as_u16c(src) >> 8) ^ 0x80; goto CONV_END; +-conv_xx12_xx92: as_u16(dst) = as_u16c(src) ^ 0x8000; goto CONV_END; +-conv_xx12_xx29: as_u16(dst) = bswap_16(as_u16c(src)) ^ 0x80; goto CONV_END; +-conv_xx12_x920: as_u32(dst) = sx24((uint32_t)(as_u16c(src) ^ 0x8000) << 8); goto CONV_END; +-conv_xx12_029x: as_u32(dst) = sx24s((uint32_t)(bswap_16(as_u16c(src)) ^ 0x80) << 8); goto CONV_END; +-conv_xx12_9200: as_u32(dst) = (uint32_t)(as_u16c(src) ^ 0x8000) << 16; goto CONV_END; +-conv_xx12_0029: as_u32(dst) = (uint32_t)(bswap_16(as_u16c(src)) ^ 0x80); goto CONV_END; +-conv_xx12_xxx2: as_u8(dst) = as_u16c(src) & 0xff; goto CONV_END; +-conv_xx12_x210: as_u32(dst) = sx24((uint32_t)bswap_16(as_u16c(src)) << 8); goto CONV_END; +-conv_xx12_012x: as_u32(dst) = sx24s((uint32_t)as_u16c(src) << 8); goto CONV_END; +-conv_xx12_2100: as_u32(dst) = (uint32_t)bswap_16(as_u16c(src)) << 16; goto CONV_END; +-conv_xx12_0012: as_u32(dst) = (uint32_t)as_u16c(src); goto CONV_END; +-conv_xx12_xxxA: as_u8(dst) = (as_u16c(src) ^ 0x80) & 0xff; goto CONV_END; +-conv_xx12_xxA1: as_u16(dst) = bswap_16(as_u16c(src) ^ 0x80); goto CONV_END; +-conv_xx12_xx1A: as_u16(dst) = as_u16c(src) ^ 0x80; goto CONV_END; +-conv_xx12_xA10: as_u32(dst) = sx24((uint32_t)bswap_16(as_u16c(src) ^ 0x80) << 8); goto CONV_END; +-conv_xx12_01Ax: as_u32(dst) = sx24s((uint32_t)(as_u16c(src) ^ 0x80) << 8); goto CONV_END; +-conv_xx12_A100: as_u32(dst) = (uint32_t)bswap_16(as_u16c(src) ^ 0x80) << 16; goto CONV_END; +-conv_xx12_001A: as_u32(dst) = (uint32_t)(as_u16c(src) ^ 0x80); goto CONV_END; +-conv_x123_xxx1: as_u8(dst) = as_u32c(src) >> 16; goto CONV_END; +-conv_x123_xx12: as_u16(dst) = as_u32c(src) >> 8; goto CONV_END; +-conv_x123_xx21: as_u16(dst) = bswap_16(as_u32c(src) >> 8); goto CONV_END; +-conv_x123_x123: as_u32(dst) = sx24(as_u32c(src)); goto CONV_END; +-conv_x123_321x: as_u32(dst) = sx24s(bswap_32(as_u32c(src))); goto CONV_END; +-conv_x123_1230: as_u32(dst) = as_u32c(src) << 8; goto CONV_END; +-conv_x123_0321: as_u32(dst) = bswap_32(as_u32c(src)) >> 8; goto CONV_END; +-conv_x123_xxx9: as_u8(dst) = (as_u32c(src) >> 16) ^ 0x80; goto CONV_END; +-conv_x123_xx92: as_u16(dst) = (as_u32c(src) >> 8) ^ 0x8000; goto CONV_END; +-conv_x123_xx29: as_u16(dst) = bswap_16(as_u32c(src) >> 8) ^ 0x80; goto CONV_END; +-conv_x123_x923: as_u32(dst) = sx24(as_u32c(src) ^ 0x800000); goto CONV_END; +-conv_x123_329x: as_u32(dst) = sx24s(bswap_32(as_u32c(src)) ^ 0x8000); goto CONV_END; +-conv_x123_9230: as_u32(dst) = (as_u32c(src) ^ 0x800000) << 8; goto CONV_END; +-conv_x123_0329: as_u32(dst) = (bswap_32(as_u32c(src)) >> 8) ^ 0x80; goto CONV_END; +-conv_123x_xxx3: as_u8(dst) = (as_u32c(src) >> 8) & 0xff; goto CONV_END; +-conv_123x_xx32: as_u16(dst) = bswap_16(as_u32c(src) >> 8); goto CONV_END; +-conv_123x_xx23: as_u16(dst) = (as_u32c(src) >> 8) & 0xffff; goto CONV_END; +-conv_123x_x321: as_u32(dst) = sx24(bswap_32(as_u32c(src))); goto CONV_END; +-conv_123x_123x: as_u32(dst) = sx24s(as_u32c(src)); goto CONV_END; +-conv_123x_3210: as_u32(dst) = bswap_32(as_u32c(src)) << 8; goto CONV_END; +-conv_123x_0123: as_u32(dst) = as_u32c(src) >> 8; goto CONV_END; +-conv_123x_xxxB: as_u8(dst) = ((as_u32c(src) >> 8) & 0xff) ^ 0x80; goto CONV_END; +-conv_123x_xxB2: as_u16(dst) = bswap_16((as_u32c(src) >> 8) ^ 0x80); goto CONV_END; +-conv_123x_xx2B: as_u16(dst) = ((as_u32c(src) >> 8) & 0xffff) ^ 0x80; goto CONV_END; +-conv_123x_xB21: as_u32(dst) = sx24(bswap_32(as_u32c(src)) ^ 0x800000); goto CONV_END; +-conv_123x_12Bx: as_u32(dst) = sx24s(as_u32c(src) ^ 0x8000); goto CONV_END; +-conv_123x_B210: as_u32(dst) = bswap_32(as_u32c(src) ^ 0x8000) << 8; goto CONV_END; +-conv_123x_012B: as_u32(dst) = (as_u32c(src) >> 8) ^ 0x80; goto CONV_END; +-conv_1234_xxx1: as_u8(dst) = as_u32c(src) >> 24; goto CONV_END; +-conv_1234_xx12: as_u16(dst) = as_u32c(src) >> 16; goto CONV_END; +-conv_1234_xx21: as_u16(dst) = bswap_16(as_u32c(src) >> 16); goto CONV_END; +-conv_1234_x123: as_u32(dst) = sx24(as_u32c(src) >> 8); goto CONV_END; +-conv_1234_321x: as_u32(dst) = sx24s(bswap_32(as_u32c(src)) << 8); goto CONV_END; +-conv_1234_1234: as_u32(dst) = as_u32c(src); goto CONV_END; +-conv_1234_4321: as_u32(dst) = bswap_32(as_u32c(src)); goto CONV_END; +-conv_1234_xxx9: as_u8(dst) = (as_u32c(src) >> 24) ^ 0x80; goto CONV_END; +-conv_1234_xx92: as_u16(dst) = (as_u32c(src) >> 16) ^ 0x8000; goto CONV_END; +-conv_1234_xx29: as_u16(dst) = bswap_16(as_u32c(src) >> 16) ^ 0x80; goto CONV_END; +-conv_1234_x923: as_u32(dst) = sx24((as_u32c(src) >> 8) ^ 0x800000); goto CONV_END; +-conv_1234_329x: as_u32(dst) = sx24s((bswap_32(as_u32c(src)) ^ 0x80) << 8); goto CONV_END; +-conv_1234_9234: as_u32(dst) = as_u32c(src) ^ 0x80000000; goto CONV_END; +-conv_1234_4329: as_u32(dst) = bswap_32(as_u32c(src)) ^ 0x80; goto CONV_END; +-conv_1234_xxx4: as_u8(dst) = as_u32c(src) & 0xff; goto CONV_END; +-conv_1234_xx43: as_u16(dst) = bswap_16(as_u32c(src)); goto CONV_END; +-conv_1234_xx34: as_u16(dst) = as_u32c(src) & 0xffff; goto CONV_END; +-conv_1234_x432: as_u32(dst) = sx24(bswap_32(as_u32c(src)) >> 8); goto CONV_END; +-conv_1234_234x: as_u32(dst) = sx24s(as_u32c(src) << 8); goto CONV_END; +-conv_1234_xxxC: as_u8(dst) = (as_u32c(src) & 0xff) ^ 0x80; goto CONV_END; +-conv_1234_xxC3: as_u16(dst) = bswap_16(as_u32c(src) ^ 0x80); goto CONV_END; +-conv_1234_xx3C: as_u16(dst) = (as_u32c(src) & 0xffff) ^ 0x80; goto CONV_END; +-conv_1234_xC32: as_u32(dst) = sx24((bswap_32(as_u32c(src)) >> 8) ^ 0x800000); goto CONV_END; +-conv_1234_23Cx: as_u32(dst) = sx24s((as_u32c(src) ^ 0x80) << 8); goto CONV_END; +-conv_1234_C321: as_u32(dst) = bswap_32(as_u32c(src) ^ 0x80); goto CONV_END; +-conv_1234_123C: as_u32(dst) = as_u32c(src) ^ 0x80; goto CONV_END; ++static inline void conv(char *dst, const char *src, unsigned int idx) { ++ switch (idx) { ++ case 0: /* 8h -> 8h */ ++ case 1: /* 8h -> 8s */ ++ case 16: /* 8s -> 8h */ ++ case 17: /* 8s -> 8s */ as_u8(dst) = as_u8c(src); break; ++ case 2: /* 8h -> 16h */ ++ case 18: /* 8s -> 16h */ as_u16(dst) = (uint16_t)as_u8c(src) << 8; break; ++ case 3: /* 8h -> 16s */ ++ case 19: /* 8s -> 16s */ as_u16(dst) = (uint16_t)as_u8c(src); break; ++ case 4: /* 8h -> 24h */ ++ case 20: /* 8s -> 24h */ as_u32(dst) = sx24((uint32_t)as_u8c(src) << 16); break; ++ case 5: /* 8h -> 24s */ ++ case 21: /* 8s -> 24s */ as_u32(dst) = sx24s((uint32_t)as_u8c(src) << 8); break; ++ case 6: /* 8h -> 32h */ ++ case 22: /* 8s -> 32h */ as_u32(dst) = (uint32_t)as_u8c(src) << 24; break; ++ case 7: /* 8h -> 32s */ ++ case 23: /* 8s -> 32s */ as_u32(dst) = (uint32_t)as_u8c(src); break; ++ case 8: /* 8h ^> 8h */ ++ case 9: /* 8h ^> 8s */ ++ case 24: /* 8s ^> 8h */ ++ case 25: /* 8s ^> 8s */ as_u8(dst) = as_u8c(src) ^ 0x80; break; ++ case 10: /* 8h ^> 16h */ ++ case 26: /* 8s ^> 16h */ as_u16(dst) = (uint16_t)(as_u8c(src) ^ 0x80) << 8; break; ++ case 11: /* 8h ^> 16s */ ++ case 27: /* 8s ^> 16s */ as_u16(dst) = (uint16_t)(as_u8c(src) ^ 0x80); break; ++ case 12: /* 8h ^> 24h */ ++ case 28: /* 8s ^> 24h */ as_u32(dst) = sx24((uint32_t)(as_u8c(src) ^ 0x80) << 16); break; ++ case 13: /* 8h ^> 24s */ ++ case 29: /* 8s ^> 24s */ as_u32(dst) = sx24s((uint32_t)(as_u8c(src) ^ 0x80) << 8); break; ++ case 14: /* 8h ^> 32h */ ++ case 30: /* 8s ^> 32h */ as_u32(dst) = (uint32_t)(as_u8c(src) ^ 0x80) << 24; break; ++ case 15: /* 8h ^> 32s */ ++ case 31: /* 8s ^> 32s */ as_u32(dst) = (uint32_t)(as_u8c(src) ^ 0x80); break; ++ case 32: /* 16h -> 8h */ ++ case 33: /* 16h -> 8s */ as_u8(dst) = as_u16c(src) >> 8; break; ++ case 34: /* 16h -> 16h */ as_u16(dst) = as_u16c(src); break; ++ case 35: /* 16h -> 16s */ as_u16(dst) = bswap_16(as_u16c(src)); break; ++ case 36: /* 16h -> 24h */ as_u32(dst) = sx24((uint32_t)as_u16c(src) << 8); break; ++ case 37: /* 16h -> 24s */ as_u32(dst) = sx24s((uint32_t)bswap_16(as_u16c(src)) << 8); break; ++ case 38: /* 16h -> 32h */ as_u32(dst) = (uint32_t)as_u16c(src) << 16; break; ++ case 39: /* 16h -> 32s */ as_u32(dst) = (uint32_t)bswap_16(as_u16c(src)); break; ++ case 40: /* 16h ^> 8h */ ++ case 41: /* 16h ^> 8s */ as_u8(dst) = (as_u16c(src) >> 8) ^ 0x80; break; ++ case 42: /* 16h ^> 16h */ ++ case 51: /* 16s -> 16s */ as_u16(dst) = as_u16c(src) ^ 0x8000; break; ++ case 43: /* 16h ^> 16s */ ++ case 50: /* 16s -> 16h */ as_u16(dst) = bswap_16(as_u16c(src)) ^ 0x80; break; ++ case 44: /* 16h ^> 24h */ as_u32(dst) = sx24((uint32_t)(as_u16c(src) ^ 0x8000) << 8); break; ++ case 45: /* 16h ^> 24s */ as_u32(dst) = sx24s((uint32_t)(bswap_16(as_u16c(src)) ^ 0x80) << 8); break; ++ case 46: /* 16h ^> 32h */ as_u32(dst) = (uint32_t)(as_u16c(src) ^ 0x8000) << 16; break; ++ case 47: /* 16h ^> 32s */ as_u32(dst) = (uint32_t)(bswap_16(as_u16c(src)) ^ 0x80); break; ++ case 48: /* 16s -> 8h */ ++ case 49: /* 16s -> 8s */ as_u8(dst) = as_u16c(src) & 0xff; break; ++ case 52: /* 16s -> 24h */ as_u32(dst) = sx24((uint32_t)bswap_16(as_u16c(src)) << 8); break; ++ case 53: /* 16s -> 24s */ as_u32(dst) = sx24s((uint32_t)as_u16c(src) << 8); break; ++ case 54: /* 16s -> 32h */ as_u32(dst) = (uint32_t)bswap_16(as_u16c(src)) << 16; break; ++ case 55: /* 16s -> 32s */ as_u32(dst) = (uint32_t)as_u16c(src); break; ++ case 56: /* 16s ^> 8h */ ++ case 57: /* 16s ^> 8s */ as_u8(dst) = (as_u16c(src) ^ 0x80) & 0xff; break; ++ case 58: /* 16s ^> 16h */ as_u16(dst) = bswap_16(as_u16c(src) ^ 0x80); break; ++ case 59: /* 16s ^> 16s */ as_u16(dst) = as_u16c(src) ^ 0x80; break; ++ case 60: /* 16s ^> 24h */ as_u32(dst) = sx24((uint32_t)bswap_16(as_u16c(src) ^ 0x80) << 8); break; ++ case 61: /* 16s ^> 24s */ as_u32(dst) = sx24s((uint32_t)(as_u16c(src) ^ 0x80) << 8); break; ++ case 62: /* 16s ^> 32h */ as_u32(dst) = (uint32_t)bswap_16(as_u16c(src) ^ 0x80) << 16; break; ++ case 63: /* 16s ^> 32s */ as_u32(dst) = (uint32_t)(as_u16c(src) ^ 0x80); break; ++ case 64: /* 24h -> 8h */ ++ case 65: /* 24h -> 8s */ as_u8(dst) = as_u32c(src) >> 16; break; ++ case 66: /* 24h -> 16h */ as_u16(dst) = as_u32c(src) >> 8; break; ++ case 67: /* 24h -> 16s */ as_u16(dst) = bswap_16(as_u32c(src) >> 8); break; ++ case 68: /* 24h -> 24h */ as_u32(dst) = sx24(as_u32c(src)); break; ++ case 69: /* 24h -> 24s */ as_u32(dst) = sx24s(bswap_32(as_u32c(src))); break; ++ case 70: /* 24h -> 32h */ as_u32(dst) = as_u32c(src) << 8; break; ++ case 71: /* 24h -> 32s */ as_u32(dst) = bswap_32(as_u32c(src)) >> 8; break; ++ case 72: /* 24h ^> 8h */ ++ case 73: /* 24h ^> 8s */ as_u8(dst) = (as_u32c(src) >> 16) ^ 0x80; break; ++ case 74: /* 24h ^> 16h */ as_u16(dst) = (as_u32c(src) >> 8) ^ 0x8000; break; ++ case 75: /* 24h ^> 16s */ as_u16(dst) = bswap_16(as_u32c(src) >> 8) ^ 0x80; break; ++ case 76: /* 24h ^> 24h */ as_u32(dst) = sx24(as_u32c(src) ^ 0x800000); break; ++ case 77: /* 24h ^> 24s */ as_u32(dst) = sx24s(bswap_32(as_u32c(src)) ^ 0x8000); break; ++ case 78: /* 24h ^> 32h */ as_u32(dst) = (as_u32c(src) ^ 0x800000) << 8; break; ++ case 79: /* 24h ^> 32s */ as_u32(dst) = (bswap_32(as_u32c(src)) >> 8) ^ 0x80; break; ++ case 80: /* 24s -> 8h */ ++ case 81: /* 24s -> 8s */ as_u8(dst) = (as_u32c(src) >> 8) & 0xff; break; ++ case 82: /* 24s -> 16h */ as_u16(dst) = bswap_16(as_u32c(src) >> 8); break; ++ case 83: /* 24s -> 16s */ as_u16(dst) = (as_u32c(src) >> 8) & 0xffff; break; ++ case 84: /* 24s -> 24h */ as_u32(dst) = sx24(bswap_32(as_u32c(src))); break; ++ case 85: /* 24s -> 24s */ as_u32(dst) = sx24s(as_u32c(src)); break; ++ case 86: /* 24s -> 32h */ as_u32(dst) = bswap_32(as_u32c(src)) << 8; break; ++ case 87: /* 24s -> 32s */ as_u32(dst) = as_u32c(src) >> 8; break; ++ case 88: /* 24s ^> 8h */ ++ case 89: /* 24s ^> 8s */ as_u8(dst) = ((as_u32c(src) >> 8) & 0xff) ^ 0x80; break; ++ case 90: /* 24s ^> 16h */ as_u16(dst) = bswap_16((as_u32c(src) >> 8) ^ 0x80); break; ++ case 91: /* 24s ^> 16s */ as_u16(dst) = ((as_u32c(src) >> 8) & 0xffff) ^ 0x80; break; ++ case 92: /* 24s ^> 24h */ as_u32(dst) = sx24(bswap_32(as_u32c(src)) ^ 0x800000); break; ++ case 93: /* 24s ^> 24s */ as_u32(dst) = sx24s(as_u32c(src) ^ 0x8000); break; ++ case 94: /* 24s ^> 32h */ as_u32(dst) = bswap_32(as_u32c(src) ^ 0x8000) << 8; break; ++ case 95: /* 24s ^> 32s */ as_u32(dst) = (as_u32c(src) >> 8) ^ 0x80; break; ++ case 96: /* 32h -> 8h */ ++ case 97: /* 32h -> 8s */ as_u8(dst) = as_u32c(src) >> 24; break; ++ case 98: /* 32h -> 16h */ as_u16(dst) = as_u32c(src) >> 16; break; ++ case 99: /* 32h -> 16s */ as_u16(dst) = bswap_16(as_u32c(src) >> 16); break; ++ case 100: /* 32h -> 24h */ as_u32(dst) = sx24(as_u32c(src) >> 8); break; ++ case 101: /* 32h -> 24s */ as_u32(dst) = sx24s(bswap_32(as_u32c(src)) << 8); break; ++ case 102: /* 32h -> 32h */ ++ case 119: /* 32s -> 32s */ as_u32(dst) = as_u32c(src); break; ++ case 103: /* 32h -> 32s */ ++ case 118: /* 32s -> 32h */ as_u32(dst) = bswap_32(as_u32c(src)); break; ++ case 104: /* 32h ^> 8h */ ++ case 105: /* 32h ^> 8s */ as_u8(dst) = (as_u32c(src) >> 24) ^ 0x80; break; ++ case 106: /* 32h ^> 16h */ as_u16(dst) = (as_u32c(src) >> 16) ^ 0x8000; break; ++ case 107: /* 32h ^> 16s */ as_u16(dst) = bswap_16(as_u32c(src) >> 16) ^ 0x80; break; ++ case 108: /* 32h ^> 24h */ as_u32(dst) = sx24((as_u32c(src) >> 8) ^ 0x800000); break; ++ case 109: /* 32h ^> 24s */ as_u32(dst) = sx24s((bswap_32(as_u32c(src)) ^ 0x80) << 8); break; ++ case 110: /* 32h ^> 32h */ as_u32(dst) = as_u32c(src) ^ 0x80000000; break; ++ case 111: /* 32h ^> 32s */ as_u32(dst) = bswap_32(as_u32c(src)) ^ 0x80; break; ++ case 112: /* 32s -> 8h */ ++ case 113: /* 32s -> 8s */ as_u8(dst) = as_u32c(src) & 0xff; break; ++ case 114: /* 32s -> 16h */ as_u16(dst) = bswap_16(as_u32c(src)); break; ++ case 115: /* 32s -> 16s */ as_u16(dst) = as_u32c(src) & 0xffff; break; ++ case 116: /* 32s -> 24h */ as_u32(dst) = sx24(bswap_32(as_u32c(src)) >> 8); break; ++ case 117: /* 32s -> 24s */ as_u32(dst) = sx24s(as_u32c(src) << 8); break; ++ case 120: /* 32s ^> 8h */ ++ case 121: /* 32s ^> 8s */ as_u8(dst) = (as_u32c(src) & 0xff) ^ 0x80; break; ++ case 122: /* 32s ^> 16h */ as_u16(dst) = bswap_16(as_u32c(src) ^ 0x80); break; ++ case 123: /* 32s ^> 16s */ as_u16(dst) = (as_u32c(src) & 0xffff) ^ 0x80; break; ++ case 124: /* 32s ^> 24h */ as_u32(dst) = sx24((bswap_32(as_u32c(src)) >> 8) ^ 0x800000); break; ++ case 125: /* 32s ^> 24s */ as_u32(dst) = sx24s((as_u32c(src) ^ 0x80) << 8); break; ++ case 126: /* 32s ^> 32h */ as_u32(dst) = bswap_32(as_u32c(src) ^ 0x80); break; ++ case 127: /* 32s ^> 32s */ as_u32(dst) = as_u32c(src) ^ 0x80; break; ++ } + } +-#endif + +-#ifdef GET16_LABELS +-/* src_wid src_endswap sign_toggle */ +-static void *const get16_labels[5 * 2 * 2 + 4 * 3] = { +- &&get16_1_10, /* 8h -> 16h */ +- &&get16_1_90, /* 8h ^> 16h */ +- &&get16_1_10, /* 8s -> 16h */ +- &&get16_1_90, /* 8s ^> 16h */ +- &&get16_12_12, /* 16h -> 16h */ +- &&get16_12_92, /* 16h ^> 16h */ +- &&get16_12_21, /* 16s -> 16h */ +- &&get16_12_A1, /* 16s ^> 16h */ ++static inline uint16_t get16(const char *src, unsigned int idx) { ++ switch(idx) { ++ case 0: /* 8h -> 16h */ ++ case 2: /* 8s -> 16h */ return (uint16_t)as_u8c(src) << 8; ++ case 1: /* 8h ^> 16h */ ++ case 3: /* 8s ^> 16h */ return (uint16_t)(as_u8c(src) ^ 0x80) << 8; ++ case 4: /* 16h -> 16h */ return as_u16c(src); ++ case 5: /* 16h ^> 16h */ return as_u16c(src) ^ 0x8000; ++ case 6: /* 16s -> 16h */ return bswap_16(as_u16c(src)); ++ case 7: /* 16s ^> 16h */ return bswap_16(as_u16c(src) ^ 0x80); + /* 4 byte formats */ +- &&get16_0123_12, /* 24h -> 16h */ +- &&get16_0123_92, /* 24h ^> 16h */ +- &&get16_1230_32, /* 24s -> 16h */ +- &&get16_1230_B2, /* 24s ^> 16h */ +- &&get16_1234_12, /* 32h -> 16h */ +- &&get16_1234_92, /* 32h ^> 16h */ +- &&get16_1234_43, /* 32s -> 16h */ +- &&get16_1234_C3, /* 32s ^> 16h */ +- &&get16_0123_12_20, /* 20h -> 16h */ +- &&get16_0123_92_20, /* 20h ^> 16h */ +- &&get16_1230_32_20, /* 20s -> 16h */ +- &&get16_1230_B2_20, /* 20s ^> 16h */ ++ case 8: /* 24h -> 16h */ return as_u32c(src) >> 8; ++ case 9: /* 24h ^> 16h */ return (as_u32c(src) >> 8) ^ 0x8000; ++ case 10: /* 24s -> 16h */ return bswap_16(as_u32c(src) >> 8); ++ case 11: /* 24s ^> 16h */ return bswap_16((as_u32c(src) >> 8) ^ 0x80); ++ case 12: /* 32h -> 16h */ return as_u32c(src) >> 16; ++ case 13: /* 32h ^> 16h */ return (as_u32c(src) >> 16) ^ 0x8000; ++ case 14: /* 32s -> 16h */ return bswap_16(as_u32c(src)); ++ case 15: /* 32s ^> 16h */ return bswap_16(as_u32c(src) ^ 0x80); ++ case 16: /* 20h -> 16h */ return as_u32c(src) >> 4; ++ case 17: /* 20h ^> 16h */ return (as_u32c(src) >> 4) ^ 0x8000; ++ case 18: /* 20s -> 16h */ return bswap_32(as_u32c(src)) >> 4; ++ case 19: /* 20s ^> 16h */ return (bswap_32(as_u32c(src)) >> 4) ^ 0x8000; + /* 3bytes format */ +- &&get16_123_12, /* 24h -> 16h */ +- &&get16_123_92, /* 24h ^> 16h */ +- &&get16_123_32, /* 24s -> 16h */ +- &&get16_123_B2, /* 24s ^> 16h */ +- &&get16_123_12_20, /* 20h -> 16h */ +- &&get16_123_92_20, /* 20h ^> 16h */ +- &&get16_123_32_20, /* 20s -> 16h */ +- &&get16_123_B2_20, /* 20s ^> 16h */ +- &&get16_123_12_18, /* 18h -> 16h */ +- &&get16_123_92_18, /* 18h ^> 16h */ +- &&get16_123_32_18, /* 18s -> 16h */ +- &&get16_123_B2_18, /* 18s ^> 16h */ +-}; +-#endif +- +-#ifdef GET16_END +-while(0) { +-get16_1_10: sample = (uint16_t)as_u8c(src) << 8; goto GET16_END; +-get16_1_90: sample = (uint16_t)(as_u8c(src) ^ 0x80) << 8; goto GET16_END; +-get16_12_12: sample = as_u16c(src); goto GET16_END; +-get16_12_92: sample = as_u16c(src) ^ 0x8000; goto GET16_END; +-get16_12_21: sample = bswap_16(as_u16c(src)); goto GET16_END; +-get16_12_A1: sample = bswap_16(as_u16c(src) ^ 0x80); goto GET16_END; +-get16_0123_12: sample = as_u32c(src) >> 8; goto GET16_END; +-get16_0123_92: sample = (as_u32c(src) >> 8) ^ 0x8000; goto GET16_END; +-get16_1230_32: sample = bswap_16(as_u32c(src) >> 8); goto GET16_END; +-get16_1230_B2: sample = bswap_16((as_u32c(src) >> 8) ^ 0x80); goto GET16_END; +-get16_1234_12: sample = as_u32c(src) >> 16; goto GET16_END; +-get16_1234_92: sample = (as_u32c(src) >> 16) ^ 0x8000; goto GET16_END; +-get16_1234_43: sample = bswap_16(as_u32c(src)); goto GET16_END; +-get16_1234_C3: sample = bswap_16(as_u32c(src) ^ 0x80); goto GET16_END; +-get16_0123_12_20: sample = as_u32c(src) >> 4; goto GET16_END; +-get16_0123_92_20: sample = (as_u32c(src) >> 4) ^ 0x8000; goto GET16_END; +-get16_1230_32_20: sample = bswap_32(as_u32c(src)) >> 4; goto GET16_END; +-get16_1230_B2_20: sample = (bswap_32(as_u32c(src)) >> 4) ^ 0x8000; goto GET16_END; +-get16_123_12: sample = _get_triple(src) >> 8; goto GET16_END; +-get16_123_92: sample = (_get_triple(src) >> 8) ^ 0x8000; goto GET16_END; +-get16_123_32: sample = _get_triple_s(src) >> 8; goto GET16_END; +-get16_123_B2: sample = (_get_triple_s(src) >> 8) ^ 0x8000; goto GET16_END; +-get16_123_12_20: sample = _get_triple(src) >> 4; goto GET16_END; +-get16_123_92_20: sample = (_get_triple(src) >> 4) ^ 0x8000; goto GET16_END; +-get16_123_32_20: sample = _get_triple_s(src) >> 4; goto GET16_END; +-get16_123_B2_20: sample = (_get_triple_s(src) >> 4) ^ 0x8000; goto GET16_END; +-get16_123_12_18: sample = _get_triple(src) >> 2; goto GET16_END; +-get16_123_92_18: sample = (_get_triple(src) >> 2) ^ 0x8000; goto GET16_END; +-get16_123_32_18: sample = _get_triple_s(src) >> 2; goto GET16_END; +-get16_123_B2_18: sample = (_get_triple_s(src) >> 2) ^ 0x8000; goto GET16_END; ++ case 20: /* 24h -> 16h */ return _get_triple(src) >> 8; ++ case 21: /* 24h ^> 16h */ return (_get_triple(src) >> 8) ^ 0x8000; ++ case 22: /* 24s -> 16h */ return _get_triple_s(src) >> 8; ++ case 23: /* 24s ^> 16h */ return (_get_triple_s(src) >> 8) ^ 0x8000; ++ case 24: /* 20h -> 16h */ return _get_triple(src) >> 4; ++ case 25: /* 20h ^> 16h */ return (_get_triple(src) >> 4) ^ 0x8000; ++ case 26: /* 20s -> 16h */ return _get_triple_s(src) >> 4; ++ case 27: /* 20s ^> 16h */ return (_get_triple_s(src) >> 4) ^ 0x8000; ++ case 28: /* 18h -> 16h */ return _get_triple(src) >> 2; ++ case 29: /* 18h ^> 16h */ return (_get_triple(src) >> 2) ^ 0x8000; ++ case 30: /* 18s -> 16h */ return _get_triple_s(src) >> 2; ++ case 31: /* 18s ^> 16h */ return (_get_triple_s(src) >> 2) ^ 0x8000; ++ } + } +-#endif + +-#ifdef PUT16_LABELS +-/* dst_wid dst_endswap sign_toggle */ +-static void *const put16_labels[5 * 2 * 2 + 4 * 3] = { +- &&put16_12_1, /* 16h -> 8h */ +- &&put16_12_9, /* 16h ^> 8h */ +- &&put16_12_1, /* 16h -> 8s */ +- &&put16_12_9, /* 16h ^> 8s */ +- &&put16_12_12, /* 16h -> 16h */ +- &&put16_12_92, /* 16h ^> 16h */ +- &&put16_12_21, /* 16h -> 16s */ +- &&put16_12_29, /* 16h ^> 16s */ ++static inline void put16(char *dst, int16_t sample, unsigned int idx) ++{ ++ switch (idx) { ++ case 0: /* 16h -> 8h */ ++ case 2: /* 16h -> 8s */ as_u8(dst) = sample >> 8; break; ++ case 1: /* 16h ^> 8h */ ++ case 3: /* 16h ^> 8s */ as_u8(dst) = (sample >> 8) ^ 0x80; break; ++ case 4: /* 16h -> 16h */ as_u16(dst) = sample; break; ++ case 5: /* 16h ^> 16h */ as_u16(dst) = sample ^ 0x8000; break; ++ case 6: /* 16h -> 16s */ as_u16(dst) = bswap_16(sample); break; ++ case 7: /* 16h ^> 16s */ as_u16(dst) = bswap_16(sample) ^ 0x80; break; + /* 4 byte formats */ +- &&put16_12_0120, /* 16h -> 24h */ +- &&put16_12_0920, /* 16h ^> 24h */ +- &&put16_12_0210, /* 16h -> 24s */ +- &&put16_12_0290, /* 16h ^> 24s */ +- &&put16_12_1200, /* 16h -> 32h */ +- &&put16_12_9200, /* 16h ^> 32h */ +- &&put16_12_0021, /* 16h -> 32s */ +- &&put16_12_0029, /* 16h ^> 32s */ +- &&put16_12_0120_20, /* 16h -> 20h */ +- &&put16_12_0920_20, /* 16h ^> 20h */ +- &&put16_12_0210_20, /* 16h -> 20s */ +- &&put16_12_0290_20, /* 16h ^> 20s */ ++ case 8: /* 16h -> 24h */ as_u32(dst) = sx24((uint32_t)sample << 8); break; ++ case 9: /* 16h ^> 24h */ as_u32(dst) = sx24((uint32_t)(sample ^ 0x8000) << 8); break; ++ case 10: /* 16h -> 24s */ as_u32(dst) = sx24s((uint32_t)bswap_16(sample) << 8); break; ++ case 11: /* 16h ^> 24s */ as_u32(dst) = sx24s((uint32_t)(bswap_16(sample) ^ 0x80) << 8); break; ++ case 12: /* 16h -> 32h */ as_u32(dst) = (uint32_t)sample << 16; break; ++ case 13: /* 16h ^> 32h */ as_u32(dst) = (uint32_t)(sample ^ 0x8000) << 16; break; ++ case 14: /* 16h -> 32s */ as_u32(dst) = (uint32_t)bswap_16(sample); break; ++ case 15: /* 16h ^> 32s */ as_u32(dst) = (uint32_t)bswap_16(sample) ^ 0x80; break; ++ case 16: /* 16h -> 20h */ as_u32(dst) = sx20((uint32_t)sample << 4); break; ++ case 17: /* 16h ^> 20h */ as_u32(dst) = sx20((uint32_t)(sample ^ 0x8000) << 4); break; ++ case 18: /* 16h -> 20s */ as_u32(dst) = bswap_32(sx20((uint32_t)sample << 4)); break; ++ case 19: /* 16h ^> 20s */ as_u32(dst) = bswap_32(sx20((uint32_t)(sample ^ 0x8000) << 4)); break; + /* 3bytes format */ +- &&put16_12_120, /* 16h -> 24h */ +- &&put16_12_920, /* 16h ^> 24h */ +- &&put16_12_021, /* 16h -> 24s */ +- &&put16_12_029, /* 16h ^> 24s */ +- &&put16_12_120_20, /* 16h -> 20h */ +- &&put16_12_920_20, /* 16h ^> 20h */ +- &&put16_12_021_20, /* 16h -> 20s */ +- &&put16_12_029_20, /* 16h ^> 20s */ +- &&put16_12_120_18, /* 16h -> 18h */ +- &&put16_12_920_18, /* 16h ^> 18h */ +- &&put16_12_021_18, /* 16h -> 18s */ +- &&put16_12_029_18, /* 16h ^> 18s */ +-}; +-#endif +- +-#ifdef PUT16_END +-while (0) { +-put16_12_1: as_u8(dst) = sample >> 8; goto PUT16_END; +-put16_12_9: as_u8(dst) = (sample >> 8) ^ 0x80; goto PUT16_END; +-put16_12_12: as_u16(dst) = sample; goto PUT16_END; +-put16_12_92: as_u16(dst) = sample ^ 0x8000; goto PUT16_END; +-put16_12_21: as_u16(dst) = bswap_16(sample); goto PUT16_END; +-put16_12_29: as_u16(dst) = bswap_16(sample) ^ 0x80; goto PUT16_END; +-put16_12_0120: as_u32(dst) = sx24((uint32_t)sample << 8); goto PUT16_END; +-put16_12_0920: as_u32(dst) = sx24((uint32_t)(sample ^ 0x8000) << 8); goto PUT16_END; +-put16_12_0210: as_u32(dst) = sx24s((uint32_t)bswap_16(sample) << 8); goto PUT16_END; +-put16_12_0290: as_u32(dst) = sx24s((uint32_t)(bswap_16(sample) ^ 0x80) << 8); goto PUT16_END; +-put16_12_1200: as_u32(dst) = (uint32_t)sample << 16; goto PUT16_END; +-put16_12_9200: as_u32(dst) = (uint32_t)(sample ^ 0x8000) << 16; goto PUT16_END; +-put16_12_0021: as_u32(dst) = (uint32_t)bswap_16(sample); goto PUT16_END; +-put16_12_0029: as_u32(dst) = (uint32_t)bswap_16(sample) ^ 0x80; goto PUT16_END; +-put16_12_0120_20: as_u32(dst) = sx20((uint32_t)sample << 4); goto PUT16_END; +-put16_12_0920_20: as_u32(dst) = sx20((uint32_t)(sample ^ 0x8000) << 4); goto PUT16_END; +-put16_12_0210_20: as_u32(dst) = bswap_32(sx20((uint32_t)sample << 4)); goto PUT16_END; +-put16_12_0290_20: as_u32(dst) = bswap_32(sx20((uint32_t)(sample ^ 0x8000) << 4)); goto PUT16_END; +-put16_12_120: _put_triple(dst, (uint32_t)sample << 8); goto PUT16_END; +-put16_12_920: _put_triple(dst, (uint32_t)(sample ^ 0x8000) << 8); goto PUT16_END; +-put16_12_021: _put_triple_s(dst, (uint32_t)sample << 8); goto PUT16_END; +-put16_12_029: _put_triple_s(dst, (uint32_t)(sample ^ 0x8000) << 8); goto PUT16_END; +-put16_12_120_20: _put_triple(dst, (uint32_t)sample << 4); goto PUT16_END; +-put16_12_920_20: _put_triple(dst, (uint32_t)(sample ^ 0x8000) << 4); goto PUT16_END; +-put16_12_021_20: _put_triple_s(dst, (uint32_t)sample << 4); goto PUT16_END; +-put16_12_029_20: _put_triple_s(dst, (uint32_t)(sample ^ 0x8000) << 4); goto PUT16_END; +-put16_12_120_18: _put_triple(dst, (uint32_t)sample << 2); goto PUT16_END; +-put16_12_920_18: _put_triple(dst, (uint32_t)(sample ^ 0x8000) << 2); goto PUT16_END; +-put16_12_021_18: _put_triple_s(dst, (uint32_t)sample << 2); goto PUT16_END; +-put16_12_029_18: _put_triple_s(dst, (uint32_t)(sample ^ 0x8000) << 2); goto PUT16_END; ++ case 20: /* 16h -> 24h */ _put_triple(dst, (uint32_t)sample << 8); break; ++ case 21: /* 16h ^> 24h */ _put_triple(dst, (uint32_t)(sample ^ 0x8000) << 8); break; ++ case 22: /* 16h -> 24s */ _put_triple_s(dst, (uint32_t)sample << 8); break; ++ case 23: /* 16h ^> 24s */ _put_triple_s(dst, (uint32_t)(sample ^ 0x8000) << 8); break; ++ case 24: /* 16h -> 20h */ _put_triple(dst, (uint32_t)sample << 4); break; ++ case 25: /* 16h ^> 20h */ _put_triple(dst, (uint32_t)(sample ^ 0x8000) << 4); break; ++ case 26: /* 16h -> 20s */ _put_triple_s(dst, (uint32_t)sample << 4); break; ++ case 27: /* 16h ^> 20s */ _put_triple_s(dst, (uint32_t)(sample ^ 0x8000) << 4); break; ++ case 28: /* 16h -> 18h */ _put_triple(dst, (uint32_t)sample << 2); break; ++ case 29: /* 16h ^> 18h */ _put_triple(dst, (uint32_t)(sample ^ 0x8000) << 2); break; ++ case 30: /* 16h -> 18s */ _put_triple_s(dst, (uint32_t)sample << 2); break; ++ case 31: /* 16h ^> 18s */ _put_triple_s(dst, (uint32_t)(sample ^ 0x8000) << 2); break; ++ } + } +-#endif +- +-#ifdef CONV24_LABELS +-#define GET32_LABELS +-#define PUT32_LABELS +-#endif + +-#ifdef GET32_LABELS +-/* src_wid src_endswap sign_toggle */ +-static void *const get32_labels[5 * 2 * 2 + 4 * 3] = { +- &&get32_1_1000, /* 8h -> 32h */ +- &&get32_1_9000, /* 8h ^> 32h */ +- &&get32_1_1000, /* 8s -> 32h */ +- &&get32_1_9000, /* 8s ^> 32h */ +- &&get32_12_1200, /* 16h -> 32h */ +- &&get32_12_9200, /* 16h ^> 32h */ +- &&get32_12_2100, /* 16s -> 32h */ +- &&get32_12_A100, /* 16s ^> 32h */ ++static inline int32_t get32(const char *src, unsigned int idx) ++{ ++ switch (idx) { ++ case 0: /* 8h -> 32h */ ++ case 2: /* 8s -> 32h */ return (uint32_t)as_u8c(src) << 24; ++ case 1: /* 8h ^> 32h */ ++ case 3: /* 8s ^> 32h */ return (uint32_t)(as_u8c(src) ^ 0x80) << 24; ++ case 4: /* 16h -> 32h */ return (uint32_t)as_u16c(src) << 16; ++ case 5: /* 16h ^> 32h */ return (uint32_t)(as_u16c(src) ^ 0x8000) << 16; ++ case 6: /* 16s -> 32h */ return (uint32_t)bswap_16(as_u16c(src)) << 16; ++ case 7: /* 16s ^> 32h */ return (uint32_t)bswap_16(as_u16c(src) ^ 0x80) << 16; + /* 4 byte formats */ +- &&get32_0123_1230, /* 24h -> 32h */ +- &&get32_0123_9230, /* 24h ^> 32h */ +- &&get32_1230_3210, /* 24s -> 32h */ +- &&get32_1230_B210, /* 24s ^> 32h */ +- &&get32_1234_1234, /* 32h -> 32h */ +- &&get32_1234_9234, /* 32h ^> 32h */ +- &&get32_1234_4321, /* 32s -> 32h */ +- &&get32_1234_C321, /* 32s ^> 32h */ +- &&get32_0123_1230_20, /* 20h -> 32h */ +- &&get32_0123_9230_20, /* 20h ^> 32h */ +- &&get32_1230_3210_20, /* 20s -> 32h */ +- &&get32_1230_B210_20, /* 20s ^> 32h */ ++ case 8: /* 24h -> 32h */ return as_u32c(src) << 8; ++ case 9: /* 24h ^> 32h */ return (as_u32c(src) << 8) ^ 0x80000000; ++ case 10: /* 24s -> 32h */ return bswap_32(as_u32c(src) >> 8); ++ case 11: /* 24s ^> 32h */ return bswap_32((as_u32c(src) >> 8) ^ 0x80); ++ case 12: /* 32h -> 32h */ return as_u32c(src); ++ case 13: /* 32h ^> 32h */ return as_u32c(src) ^ 0x80000000; ++ case 14: /* 32s -> 32h */ return bswap_32(as_u32c(src)); ++ case 15: /* 32s ^> 32h */ return bswap_32(as_u32c(src) ^ 0x80); ++ case 16: /* 20h -> 32h */ return as_u32c(src) << 12; ++ case 17: /* 20h ^> 32h */ return (as_u32c(src) << 12) ^ 0x80000000; ++ case 18: /* 20s -> 32h */ return bswap_32(as_u32c(src)) << 12; ++ case 19: /* 20s ^> 32h */ return (bswap_32(as_u32c(src)) << 12) ^ 0x80000000; + /* 3bytes format */ +- &&get32_123_1230, /* 24h -> 32h */ +- &&get32_123_9230, /* 24h ^> 32h */ +- &&get32_123_3210, /* 24s -> 32h */ +- &&get32_123_B210, /* 24s ^> 32h */ +- &&get32_123_1230_20, /* 20h -> 32h */ +- &&get32_123_9230_20, /* 20h ^> 32h */ +- &&get32_123_3210_20, /* 20s -> 32h */ +- &&get32_123_B210_20, /* 20s ^> 32h */ +- &&get32_123_1230_18, /* 18h -> 32h */ +- &&get32_123_9230_18, /* 18h ^> 32h */ +- &&get32_123_3210_18, /* 18s -> 32h */ +- &&get32_123_B210_18, /* 18s ^> 32h */ +-}; +-#endif +- +-#ifdef CONV24_END +-#define GET32_END __conv24_get +-#endif +- +-#ifdef GET32_END +-while (0) { +-get32_1_1000: sample = (uint32_t)as_u8c(src) << 24; goto GET32_END; +-get32_1_9000: sample = (uint32_t)(as_u8c(src) ^ 0x80) << 24; goto GET32_END; +-get32_12_1200: sample = (uint32_t)as_u16c(src) << 16; goto GET32_END; +-get32_12_9200: sample = (uint32_t)(as_u16c(src) ^ 0x8000) << 16; goto GET32_END; +-get32_12_2100: sample = (uint32_t)bswap_16(as_u16c(src)) << 16; goto GET32_END; +-get32_12_A100: sample = (uint32_t)bswap_16(as_u16c(src) ^ 0x80) << 16; goto GET32_END; +-get32_0123_1230: sample = as_u32c(src) << 8; goto GET32_END; +-get32_0123_9230: sample = (as_u32c(src) << 8) ^ 0x80000000; goto GET32_END; +-get32_1230_3210: sample = bswap_32(as_u32c(src) >> 8); goto GET32_END; +-get32_1230_B210: sample = bswap_32((as_u32c(src) >> 8) ^ 0x80); goto GET32_END; +-get32_1234_1234: sample = as_u32c(src); goto GET32_END; +-get32_1234_9234: sample = as_u32c(src) ^ 0x80000000; goto GET32_END; +-get32_1234_4321: sample = bswap_32(as_u32c(src)); goto GET32_END; +-get32_1234_C321: sample = bswap_32(as_u32c(src) ^ 0x80); goto GET32_END; +-get32_0123_1230_20: sample = as_u32c(src) << 12; goto GET32_END; +-get32_0123_9230_20: sample = (as_u32c(src) << 12) ^ 0x80000000; goto GET32_END; +-get32_1230_3210_20: sample = bswap_32(as_u32c(src)) << 12; goto GET32_END; +-get32_1230_B210_20: sample = (bswap_32(as_u32c(src)) << 12) ^ 0x80000000; goto GET32_END; +-get32_123_1230: sample = _get_triple(src) << 8; goto GET32_END; +-get32_123_9230: sample = (_get_triple(src) << 8) ^ 0x80000000; goto GET32_END; +-get32_123_3210: sample = _get_triple_s(src) << 8; goto GET32_END; +-get32_123_B210: sample = (_get_triple_s(src) << 8) ^ 0x80000000; goto GET32_END; +-get32_123_1230_20: sample = _get_triple(src) << 12; goto GET32_END; +-get32_123_9230_20: sample = (_get_triple(src) << 12) ^ 0x80000000; goto GET32_END; +-get32_123_3210_20: sample = _get_triple_s(src) << 12; goto GET32_END; +-get32_123_B210_20: sample = (_get_triple_s(src) << 12) ^ 0x80000000; goto GET32_END; +-get32_123_1230_18: sample = _get_triple(src) << 14; goto GET32_END; +-get32_123_9230_18: sample = (_get_triple(src) << 14) ^ 0x80000000; goto GET32_END; +-get32_123_3210_18: sample = _get_triple_s(src) << 14; goto GET32_END; +-get32_123_B210_18: sample = (_get_triple_s(src) << 14) ^ 0x80000000; goto GET32_END; ++ case 20: /* 24h -> 32h */ return _get_triple(src) << 8; ++ case 21: /* 24h ^> 32h */ return (_get_triple(src) << 8) ^ 0x80000000; ++ case 22: /* 24s -> 32h */ return _get_triple_s(src) << 8; ++ case 23: /* 24s ^> 32h */ return (_get_triple_s(src) << 8) ^ 0x80000000; ++ case 24: /* 20h -> 32h */ return _get_triple(src) << 12; ++ case 25: /* 20h ^> 32h */ return (_get_triple(src) << 12) ^ 0x80000000; ++ case 26: /* 20s -> 32h */ return _get_triple_s(src) << 12; ++ case 27: /* 20s ^> 32h */ return (_get_triple_s(src) << 12) ^ 0x80000000; ++ case 28: /* 18h -> 32h */ return _get_triple(src) << 14; ++ case 29: /* 18h ^> 32h */ return (_get_triple(src) << 14) ^ 0x80000000; ++ case 30: /* 18s -> 32h */ return _get_triple_s(src) << 14; ++ case 31: /* 18s ^> 32h */ return (_get_triple_s(src) << 14) ^ 0x80000000; ++ } + } +-#endif + +-#ifdef CONV24_END +-__conv24_get: goto *put; +-#define PUT32_END CONV24_END +-#endif +- +-#ifdef PUT32_LABELS +-/* dst_wid dst_endswap sign_toggle */ +-static void *const put32_labels[5 * 2 * 2 + 4 * 3] = { +- &&put32_1234_1, /* 32h -> 8h */ +- &&put32_1234_9, /* 32h ^> 8h */ +- &&put32_1234_1, /* 32h -> 8s */ +- &&put32_1234_9, /* 32h ^> 8s */ +- &&put32_1234_12, /* 32h -> 16h */ +- &&put32_1234_92, /* 32h ^> 16h */ +- &&put32_1234_21, /* 32h -> 16s */ +- &&put32_1234_29, /* 32h ^> 16s */ ++static inline void put32(char *dst, int32_t sample, unsigned int idx) ++{ ++ switch (idx) { ++ case 0: /* 32h -> 8h */ ++ case 2: /* 32h -> 8s */ as_u8(dst) = sample >> 24; break; ++ case 1: /* 32h ^> 8h */ ++ case 3: /* 32h ^> 8s */ as_u8(dst) = (sample >> 24) ^ 0x80; break; ++ case 4: /* 32h -> 16h */ as_u16(dst) = sample >> 16; break; ++ case 5: /* 32h ^> 16h */ as_u16(dst) = (sample >> 16) ^ 0x8000; break; ++ case 6: /* 32h -> 16s */ as_u16(dst) = bswap_16(sample >> 16); break; ++ case 7: /* 32h ^> 16s */ as_u16(dst) = bswap_16(sample >> 16) ^ 0x80; break; + /* 4 byte formats */ +- &&put32_1234_0123, /* 32h -> 24h */ +- &&put32_1234_0923, /* 32h ^> 24h */ +- &&put32_1234_3210, /* 32h -> 24s */ +- &&put32_1234_3290, /* 32h ^> 24s */ +- &&put32_1234_1234, /* 32h -> 32h */ +- &&put32_1234_9234, /* 32h ^> 32h */ +- &&put32_1234_4321, /* 32h -> 32s */ +- &&put32_1234_4329, /* 32h ^> 32s */ +- &&put32_1234_0123_20, /* 32h -> 20h */ +- &&put32_1234_0923_20, /* 32h ^> 20h */ +- &&put32_1234_3210_20, /* 32h -> 20s */ +- &&put32_1234_3290_20, /* 32h ^> 20s */ ++ case 8: /* 32h -> 24h */ as_u32(dst) = sx24(sample >> 8); break; ++ case 9: /* 32h ^> 24h */ as_u32(dst) = sx24((sample >> 8) ^ 0x800000); break; ++ case 10: /* 32h -> 24s */ as_u32(dst) = sx24s(bswap_32(sample) << 8); break; ++ case 11: /* 32h ^> 24s */ as_u32(dst) = sx24s((bswap_32(sample) ^ 0x80) << 8); break; ++ case 12: /* 32h -> 32h */ as_u32(dst) = sample; break; ++ case 13: /* 32h ^> 32h */ as_u32(dst) = sample ^ 0x80000000; break; ++ case 14: /* 32h -> 32s */ as_u32(dst) = bswap_32(sample); break; ++ case 15: /* 32h ^> 32s */ as_u32(dst) = bswap_32(sample) ^ 0x80; break; ++ case 16: /* 32h -> 20h */ as_u32(dst) = sx20(sample >> 12); break; ++ case 17: /* 32h ^> 20h */ as_u32(dst) = sx20((sample ^ 0x80000000) >> 12); break; ++ case 18: /* 32h -> 20s */ as_u32(dst) = bswap_32(sx20(sample >> 12)); break; ++ case 19: /* 32h ^> 20s */ as_u32(dst) = bswap_32(sx20((sample ^ 0x80000000) >> 12)); break; + /* 3bytes format */ +- &&put32_1234_123, /* 32h -> 24h */ +- &&put32_1234_923, /* 32h ^> 24h */ +- &&put32_1234_321, /* 32h -> 24s */ +- &&put32_1234_329, /* 32h ^> 24s */ +- &&put32_1234_123_20, /* 32h -> 20h */ +- &&put32_1234_923_20, /* 32h ^> 20h */ +- &&put32_1234_321_20, /* 32h -> 20s */ +- &&put32_1234_329_20, /* 32h ^> 20s */ +- &&put32_1234_123_18, /* 32h -> 18h */ +- &&put32_1234_923_18, /* 32h ^> 18h */ +- &&put32_1234_321_18, /* 32h -> 18s */ +- &&put32_1234_329_18, /* 32h ^> 18s */ +-}; +-#endif +- +-#ifdef CONV24_LABELS +-#undef GET32_LABELS +-#undef PUT32_LABELS +-#endif +- +-#ifdef PUT32_END +-while (0) { +-put32_1234_1: as_u8(dst) = sample >> 24; goto PUT32_END; +-put32_1234_9: as_u8(dst) = (sample >> 24) ^ 0x80; goto PUT32_END; +-put32_1234_12: as_u16(dst) = sample >> 16; goto PUT32_END; +-put32_1234_92: as_u16(dst) = (sample >> 16) ^ 0x8000; goto PUT32_END; +-put32_1234_21: as_u16(dst) = bswap_16(sample >> 16); goto PUT32_END; +-put32_1234_29: as_u16(dst) = bswap_16(sample >> 16) ^ 0x80; goto PUT32_END; +-put32_1234_0123: as_u32(dst) = sx24(sample >> 8); goto PUT32_END; +-put32_1234_0923: as_u32(dst) = sx24((sample >> 8) ^ 0x800000); goto PUT32_END; +-put32_1234_3210: as_u32(dst) = sx24s(bswap_32(sample) << 8); goto PUT32_END; +-put32_1234_3290: as_u32(dst) = sx24s((bswap_32(sample) ^ 0x80) << 8); goto PUT32_END; +-put32_1234_1234: as_u32(dst) = sample; goto PUT32_END; +-put32_1234_9234: as_u32(dst) = sample ^ 0x80000000; goto PUT32_END; +-put32_1234_4321: as_u32(dst) = bswap_32(sample); goto PUT32_END; +-put32_1234_4329: as_u32(dst) = bswap_32(sample) ^ 0x80; goto PUT32_END; +-put32_1234_0123_20: as_u32(dst) = sx20(sample >> 12); goto PUT32_END; +-put32_1234_0923_20: as_u32(dst) = sx20((sample ^ 0x80000000) >> 12); goto PUT32_END; +-put32_1234_3210_20: as_u32(dst) = bswap_32(sx20(sample >> 12)); goto PUT32_END; +-put32_1234_3290_20: as_u32(dst) = bswap_32(sx20((sample ^ 0x80000000) >> 12)); goto PUT32_END; +-put32_1234_123: _put_triple(dst, sample >> 8); goto PUT32_END; +-put32_1234_923: _put_triple(dst, (sample ^ 0x80000000) >> 8); goto PUT32_END; +-put32_1234_321: _put_triple_s(dst, sample >> 8); goto PUT32_END; +-put32_1234_329: _put_triple_s(dst, (sample ^ 0x80000000) >> 8); goto PUT32_END; +-put32_1234_123_20: _put_triple(dst, sample >> 12); goto PUT32_END; +-put32_1234_923_20: _put_triple(dst, (sample ^ 0x80000000) >> 12); goto PUT32_END; +-put32_1234_321_20: _put_triple_s(dst, sample >> 12); goto PUT32_END; +-put32_1234_329_20: _put_triple_s(dst, (sample ^ 0x80000000) >> 12); goto PUT32_END; +-put32_1234_123_18: _put_triple(dst, sample >> 14); goto PUT32_END; +-put32_1234_923_18: _put_triple(dst, (sample ^ 0x80000000) >> 14); goto PUT32_END; +-put32_1234_321_18: _put_triple_s(dst, sample >> 14); goto PUT32_END; +-put32_1234_329_18: _put_triple_s(dst, (sample ^ 0x80000000) >> 14); goto PUT32_END; ++ case 20: /* 32h -> 24h */ _put_triple(dst, sample >> 8); break; ++ case 21: /* 32h ^> 24h */ _put_triple(dst, (sample ^ 0x80000000) >> 8); break; ++ case 22: /* 32h -> 24s */ _put_triple_s(dst, sample >> 8); break; ++ case 23: /* 32h ^> 24s */ _put_triple_s(dst, (sample ^ 0x80000000) >> 8); break; ++ case 24: /* 32h -> 20h */ _put_triple(dst, sample >> 12); break; ++ case 25: /* 32h ^> 20h */ _put_triple(dst, (sample ^ 0x80000000) >> 12); break; ++ case 26: /* 32h -> 20s */ _put_triple_s(dst, sample >> 12); break; ++ case 27: /* 32h ^> 20s */ _put_triple_s(dst, (sample ^ 0x80000000) >> 12); break; ++ case 28: /* 32h -> 18h */ _put_triple(dst, sample >> 14); break; ++ case 29: /* 32h ^> 18h */ _put_triple(dst, (sample ^ 0x80000000) >> 14); break; ++ case 30: /* 32h -> 18s */ _put_triple_s(dst, sample >> 14); break; ++ case 31: /* 32h ^> 18s */ _put_triple_s(dst, (sample ^ 0x80000000) >> 14); break; ++ } + } +-#endif +- +-#ifdef CONV24_END +-#undef GET32_END +-#undef PUT32_END +-#endif + +-#ifdef PUT32F_LABELS +-/* type (0 = float, 1 = float64), endswap */ +-static void *const put32float_labels[2 * 2] = { +- &&put32f_1234_1234F, /* 32h -> (float)h */ +- &&put32f_1234_4321F, /* 32h -> (float)s */ +- &&put32f_1234_1234D, /* 32h -> (float64)h */ +- &&put32f_1234_4321D, /* 32h -> (float64)s */ +-}; +-#endif ++static inline void put32float(char *dst, int32_t sample, unsigned int idx) ++{ ++ snd_tmp_float_t tmp_float; ++ snd_tmp_double_t tmp_double; + +-#ifdef PUT32F_END +-put32f_1234_1234F: as_float(dst) = (float_t)((int32_t)sample) / (float_t)0x80000000UL; goto PUT32F_END; +-put32f_1234_4321F: tmp_float.f = (float_t)((int32_t)sample) / (float_t)0x80000000UL; +- as_u32(dst) = bswap_32(tmp_float.i); goto PUT32F_END; +-put32f_1234_1234D: as_double(dst) = (double_t)((int32_t)sample) / (double_t)0x80000000UL; goto PUT32F_END; +-put32f_1234_4321D: tmp_double.d = (double_t)((int32_t)sample) / (double_t)0x80000000UL; +- as_u64(dst) = bswap_64(tmp_double.l); goto PUT32F_END; +-#endif ++ switch (idx) { ++ case 0: /* 32h -> (float)h */ ++ as_float(dst) = (float_t)((int32_t)sample) / (float_t)0x80000000UL; break; ++ case 1: /* 32h -> (float)s */ ++ tmp_float.f = (float_t)((int32_t)sample) / (float_t)0x80000000UL; ++ as_u32(dst) = bswap_32(tmp_float.i); break; ++ case 2: /* 32h -> (float64)h */ ++ as_double(dst) = (double_t)((int32_t)sample) / (double_t)0x80000000UL; break; ++ case 3: /* 32h -> (float64)s */ ++ tmp_double.d = (double_t)((int32_t)sample) / (double_t)0x80000000UL; ++ as_u64(dst) = bswap_64(tmp_double.l); break; ++ } ++} + +-#ifdef GET32F_LABELS +-/* type (0 = float, 1 = float64), endswap */ +-static void *const get32float_labels[2 * 2] = { +- &&get32f_1234F_1234, /* (float)h -> 32h */ +- &&get32f_4321F_1234, /* (float)s -> 32h */ +- &&get32f_1234D_1234, /* (float64)h -> 32h */ +- &&get32f_4321D_1234, /* (float64)s -> 32h */ +-}; +-#endif ++static inline int32_t get32float(const char *src, unsigned int idx) ++{ ++ snd_tmp_float_t tmp_float; ++ snd_tmp_double_t tmp_double; + +-#ifdef GET32F_END +-get32f_1234F_1234: tmp_float.f = as_floatc(src); +- if (tmp_float.f >= 1.0) +- sample = 0x7fffffff; +- else if (tmp_float.f <= -1.0) +- sample = 0x80000000; +- else +- sample = (int32_t)(tmp_float.f * (float_t)0x80000000UL); +- goto GET32F_END; +-get32f_4321F_1234: tmp_float.i = bswap_32(as_u32c(src)); +- if (tmp_float.f >= 1.0) +- sample = 0x7fffffff; +- else if (tmp_float.f <= -1.0) +- sample = 0x80000000; +- else +- sample = (int32_t)(tmp_float.f * (float_t)0x80000000UL); +- goto GET32F_END; +-get32f_1234D_1234: tmp_double.d = as_doublec(src); +- if (tmp_double.d >= 1.0) +- sample = 0x7fffffff; +- else if (tmp_double.d <= -1.0) +- sample = 0x80000000; +- else +- sample = (int32_t)(tmp_double.d * (double_t)0x80000000UL); +- goto GET32F_END; +-get32f_4321D_1234: tmp_double.l = bswap_64(as_u64c(src)); +- if (tmp_double.d >= 1.0) +- sample = 0x7fffffff; +- else if (tmp_double.d <= -1.0) +- sample = 0x80000000; +- else +- sample = (int32_t)(tmp_double.d * (double_t)0x80000000UL); +- goto GET32F_END; +-#endif ++ switch (idx) { ++ case 0: /* (float)h -> 32h */ ++ tmp_float.f = as_floatc(src); ++ if (tmp_float.f >= 1.0) ++ return 0x7fffffff; ++ if (tmp_float.f <= -1.0) ++ return 0x80000000; ++ return (int32_t)(tmp_float.f * (float_t)0x80000000UL); ++ case 1: /* (float)s -> 32h */ ++ tmp_float.i = bswap_32(as_u32c(src)); ++ if (tmp_float.f >= 1.0) ++ return 0x7fffffff; ++ if (tmp_float.f <= -1.0) ++ return 0x80000000; ++ return (int32_t)(tmp_float.f * (float_t)0x80000000UL); ++ case 2: /* (float64)h -> 32h */ ++ tmp_double.d = as_doublec(src); ++ if (tmp_double.d >= 1.0) ++ return 0x7fffffff; ++ if (tmp_double.d <= -1.0) ++ return 0x80000000; ++ return (int32_t)(tmp_double.d * (double_t)0x80000000UL); ++ case 3: /* (float64)s -> 32h */ ++ tmp_double.l = bswap_64(as_u64c(src)); ++ if (tmp_double.d >= 1.0) ++ return 0x7fffffff; ++ if (tmp_double.d <= -1.0) ++ return 0x80000000; ++ return (int32_t)(tmp_double.d * (double_t)0x80000000UL); ++ } ++} + + #undef as_u8 + #undef as_u16 +-- +2.22.0 + diff --git a/pkg/alsa-lib/ver b/pkg/alsa-lib/ver @@ -1 +1 @@ -1.1.9 r2 +1.1.9 r3