sr_analog_float_to_string(): Make 'digits' argument unsigned.
This commit is contained in:
parent
6b71bf1ba0
commit
8ea0c90268
|
@ -30,7 +30,8 @@
|
||||||
|
|
||||||
SR_API int sr_analog_to_float(const struct sr_datafeed_analog *analog,
|
SR_API int sr_analog_to_float(const struct sr_datafeed_analog *analog,
|
||||||
float *buf);
|
float *buf);
|
||||||
SR_API int sr_analog_float_to_string(float value, int digits, char **result);
|
SR_API int sr_analog_float_to_string(float value, unsigned int digits,
|
||||||
|
char **result);
|
||||||
SR_API int sr_analog_unit_to_string(const struct sr_datafeed_analog *analog,
|
SR_API int sr_analog_unit_to_string(const struct sr_datafeed_analog *analog,
|
||||||
char **result);
|
char **result);
|
||||||
SR_API void sr_rational_set(struct sr_rational *r, int64_t p, uint64_t q);
|
SR_API void sr_rational_set(struct sr_rational *r, int64_t p, uint64_t q);
|
||||||
|
|
|
@ -214,9 +214,9 @@ SR_API int sr_analog_to_float(const struct sr_datafeed_analog *analog,
|
||||||
*
|
*
|
||||||
* @since 0.4.0
|
* @since 0.4.0
|
||||||
*/
|
*/
|
||||||
SR_API int sr_analog_float_to_string(float value, int digits, char **result)
|
SR_API int sr_analog_float_to_string(float value, unsigned int digits, char **result)
|
||||||
{
|
{
|
||||||
int cnt, i;
|
unsigned int cnt, i;
|
||||||
|
|
||||||
/* This produces at least one too many digits */
|
/* This produces at least one too many digits */
|
||||||
*result = g_strdup_printf("%.*f", digits, value);
|
*result = g_strdup_printf("%.*f", digits, value);
|
||||||
|
|
Loading…
Reference in New Issue