From: Uwe Hermann Date: Tue, 20 Feb 2018 18:34:55 +0000 (+0100) Subject: Random whitespace/cosmetic fixes. X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=405b9c10eb15667e23c2c0bba7009c449834ccd9 Random whitespace/cosmetic fixes. --- diff --git a/src/analog.c b/src/analog.c index 9fdece5d..7dc7c3d0 100644 --- a/src/analog.c +++ b/src/analog.c @@ -308,7 +308,7 @@ SR_API int sr_analog_to_float(const struct sr_datafeed_analog *analog, SR_API const char *sr_analog_si_prefix(float *value, int *digits) { /** @cond PRIVATE */ -#define NEG_PREFIX_COUNT 5 /* number of prefixes below unity */ +#define NEG_PREFIX_COUNT 5 /* number of prefixes below unity */ #define POS_PREFIX_COUNT (int)(ARRAY_SIZE(prefixes) - NEG_PREFIX_COUNT - 1) /** @endcond */ static const char *prefixes[] = { "f", "p", "n", "µ", "m", "", "k", "M", "G", "T" }; @@ -555,8 +555,8 @@ SR_API int sr_rational_mult(struct sr_rational *res, const struct sr_rational *a return SR_ERR_ARG; } - res->p = (int64_t)(p); - res->q = (uint64_t)(q); + res->p = (int64_t)p; + res->q = (uint64_t)q; return SR_OK; diff --git a/src/dmm/ut372.c b/src/dmm/ut372.c index 271d034c..ce21273b 100644 --- a/src/dmm/ut372.c +++ b/src/dmm/ut372.c @@ -132,7 +132,7 @@ SR_PRIV int sr_ut372_parse(const uint8_t *buf, float *floatval, *floatval = (float) value * powf(10, exponent); - analog->encoding->digits = -exponent; + analog->encoding->digits = -exponent; analog->spec->spec_digits = -exponent; return SR_OK; diff --git a/src/hardware/demo/protocol.c b/src/hardware/demo/protocol.c index 46808fd6..53ae2477 100644 --- a/src/hardware/demo/protocol.c +++ b/src/hardware/demo/protocol.c @@ -483,7 +483,7 @@ SR_PRIV int demo_prepare_data(int fd, int revents, void *cb_data) */ todo_us = samples_todo * G_USEC_PER_SEC / devc->cur_samplerate; - logic_done = devc->num_logic_channels > 0 ? 0 : samples_todo; + logic_done = devc->num_logic_channels > 0 ? 0 : samples_todo; if (!devc->enabled_logic_channels) logic_done = samples_todo; analog_done = devc->num_analog_channels > 0 ? 0 : samples_todo; diff --git a/src/output/hex.c b/src/output/hex.c index 5d9e0f55..708f6054 100644 --- a/src/output/hex.c +++ b/src/output/hex.c @@ -180,7 +180,7 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p /* Flush line buffers. */ g_string_append_len(*out, ctx->lines[j]->str, ctx->lines[j]->len); g_string_append_c(*out, '\n'); - if (j == ctx->num_enabled_channels - 1 && ctx->trigger > -1) { + if (j == ctx->num_enabled_channels - 1 && ctx->trigger > -1) { offset = ctx->trigger + ctx->trigger / 8; g_string_append_printf(*out, "T:%*s^ %d\n", offset, "", ctx->trigger); ctx->trigger = -1; diff --git a/src/output/vcd.c b/src/output/vcd.c index d0b14a04..399f2b35 100644 --- a/src/output/vcd.c +++ b/src/output/vcd.c @@ -96,7 +96,7 @@ static GString *gen_header(const struct sr_output *o) /* timestamp */ t = time(NULL); timestamp = g_strdup(ctime(&t)); - timestamp[strlen(timestamp)-1] = 0; + timestamp[strlen(timestamp) - 1] = 0; g_string_printf(header, "$date %s $end\n", timestamp); g_free(timestamp);