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" };
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;
*floatval = (float) value * powf(10, exponent);
- analog->encoding->digits = -exponent;
+ analog->encoding->digits = -exponent;
analog->spec->spec_digits = -exponent;
return SR_OK;
*/
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;
/* 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;
/* 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);