[PATCH] core-util: Add pa_bool_to_string()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2015-04-20 at 18:21 +0300, Tanu Kaskinen wrote:
> We already have pa_yes_no(), but that returns a translated string.
> pa_boolean_to_string() is useful in non-translated strings, like debug
> log messages.
> ---
>  src/pulsecore/core-util.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/pulsecore/core-util.h b/src/pulsecore/core-util.h
> index dcdc40e..f23f959 100644
> --- a/src/pulsecore/core-util.h
> +++ b/src/pulsecore/core-util.h
> @@ -89,6 +89,10 @@ int pa_parse_boolean(const char *s) PA_GCC_PURE;
>  
>  int pa_parse_volume(const char *s, pa_volume_t *volume);
>  
> +static inline const char *pa_bool_to_string(bool b) {
> +    return b ? "true" : "false";
> +}
> +
>  static inline const char *pa_yes_no(bool b) {
>      return b ? _("yes") : _("no");
>  }

Please ignore this patch, it's now redundant after David made his
version.

-- 
Tanu



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux