From: Martin Ling Date: Wed, 9 Sep 2015 22:41:27 +0000 (+0100) Subject: sr_rational_set: Accept signed numerator. X-Git-Tag: libsigrok-0.4.0~262 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=53e5d3d14d30707ea7d84e75e469314a0ae570bf;p=libsigrok.git sr_rational_set: Accept signed numerator. --- diff --git a/include/libsigrok/proto.h b/include/libsigrok/proto.h index 19c1680f..0892b99e 100644 --- a/include/libsigrok/proto.h +++ b/include/libsigrok/proto.h @@ -33,7 +33,7 @@ SR_API int sr_analog_to_float(const struct sr_datafeed_analog2 *analog, SR_API int sr_analog_float_to_string(float value, int digits, char **result); SR_API int sr_analog_unit_to_string(const struct sr_datafeed_analog2 *analog, char **result); -SR_API void sr_rational_set(struct sr_rational *r, uint64_t p, uint64_t q); +SR_API void sr_rational_set(struct sr_rational *r, int64_t p, uint64_t q); /*--- backend.c -------------------------------------------------------------*/ diff --git a/src/analog.c b/src/analog.c index d2677a57..db5ac1cf 100644 --- a/src/analog.c +++ b/src/analog.c @@ -273,7 +273,7 @@ SR_API int sr_analog_unit_to_string(const struct sr_datafeed_analog2 *analog, * @param p Numerator * @param q Denominator */ -SR_API void sr_rational_set(struct sr_rational *r, uint64_t p, uint64_t q) +SR_API void sr_rational_set(struct sr_rational *r, int64_t p, uint64_t q) { r->p = p; r->q = q;