sr_analog_float_to_string(): Make 'digits' argument unsigned.

This commit is contained in:
Uwe Hermann 2015-10-15 19:38:02 +02:00
parent 6b71bf1ba0
commit 8ea0c90268
2 changed files with 4 additions and 3 deletions

View File

@ -30,7 +30,8 @@
SR_API int sr_analog_to_float(const struct sr_datafeed_analog *analog,
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,
char **result);
SR_API void sr_rational_set(struct sr_rational *r, int64_t p, uint64_t q);

View File

@ -214,9 +214,9 @@ SR_API int sr_analog_to_float(const struct sr_datafeed_analog *analog,
*
* @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 */
*result = g_strdup_printf("%.*f", digits, value);