X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=strutil.c;h=f6cdb73b73f81836477378ee3baea38979c4282c;hb=449cc16bb279e5d3322846ce6bd390e867e71ccb;hp=4be37ca1799717f05ba4a32a60f13d32515e3454;hpb=094e6b815972240fbc210f8c5ef2eaa8c989fbc0;p=libsigrok.git diff --git a/strutil.c b/strutil.c index 4be37ca1..f6cdb73b 100644 --- a/strutil.c +++ b/strutil.c @@ -48,8 +48,8 @@ */ /** - * Convert a numeric value value to its "natural" string representation. - * in SI units + * Convert a numeric value value to its "natural" string representation + * in SI units. * * E.g. a value of 3000000, with units set to "W", would be converted * to "3 MW", 20000 to "20 kW", 31500 would become "31.5 kW". @@ -66,8 +66,8 @@ SR_API char *sr_si_string_u64(uint64_t x, const char *unit) { uint8_t i; uint64_t quot, divisor[] = { - 1, SR_KHZ(1), SR_MHZ(1), SR_GHZ(1), - SR_GHZ(1000), SR_GHZ(1000*1000), SR_GHZ(1000*1000*1000) + SR_HZ(1), SR_KHZ(1), SR_MHZ(1), SR_GHZ(1), + SR_GHZ(1000), SR_GHZ(1000 * 1000), SR_GHZ(1000 * 1000 * 1000), }; const char *p, prefix[] = "\0kMGTPE"; char fmt[8], fract[20] = "", *f; @@ -230,7 +230,8 @@ SR_API char **sr_parse_triggerstring(const struct sr_dev_inst *sdi, return NULL; } - if (sdi->driver->config_list(SR_CONF_TRIGGER_TYPE, &gvar, sdi) != SR_OK) { + if (sdi->driver->config_list(SR_CONF_TRIGGER_TYPE, + &gvar, sdi, NULL) != SR_OK) { sr_err("%s: Device doesn't support any triggers.", __func__); return NULL; }