]> sigrok.org Git - libsigrok.git/commitdiff
Random whitespace/cosmetic fixes.
authorUwe Hermann <redacted>
Tue, 20 Feb 2018 18:34:55 +0000 (19:34 +0100)
committerUwe Hermann <redacted>
Tue, 20 Feb 2018 19:03:11 +0000 (20:03 +0100)
src/analog.c
src/dmm/ut372.c
src/hardware/demo/protocol.c
src/output/hex.c
src/output/vcd.c

index 9fdece5df4a82a31333eb0577155b898e4bbea5d..7dc7c3d00383b10be8815c63f13663e41fd0d749 100644 (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;
 
index 271d034c3bbc3c3de899d23dace1b0fa5131f707..ce21273b688a9f63a9f11a942bb5a545dd3e68da 100644 (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;
index 46808fd6cf5622b4cd2ad333906ab9159059ac3d..53ae247726ab9af2382a084af10977b029f17c7a 100644 (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;
index 5d9e0f556eebe8e3a52401d3a47af148b466dd93..708f6054c22204a8f7cdd91d74bd71becd982872 100644 (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;
index d0b14a04d26f1ba661d57949a52fcbb0a9aba3b3..399f2b35d689e6f9940ca824cb6f10b01b058a3c 100644 (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);