Random whitespace/cosmetic fixes.

This commit is contained in:
Uwe Hermann 2018-02-20 19:34:55 +01:00
parent 1135f8d9c7
commit 405b9c10eb
5 changed files with 7 additions and 7 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);