]> sigrok.org Git - sigrok-test.git/commitdiff
runtc: fixup coding style (conditionals, braces)
authorGerhard Sittig <redacted>
Sun, 26 Feb 2017 18:12:05 +0000 (19:12 +0100)
committerGerhard Sittig <redacted>
Mon, 27 Feb 2017 21:56:38 +0000 (22:56 +0100)
When a conditional has one complex branch (multiple instructions), both
branches are supposed to have braces around them. Instead of putting
extra braces around single instructions, eliminate the "else" branch
since the "if" branch already ends in break or return respectively.

decoder/runtc.c

index c7462b4e7f06e69266a9bbebf17e17bec0a1343c..4b534a2564048ae52188c02f2f1d040f9ec1f071 100644 (file)
@@ -459,16 +459,16 @@ static int run_testcase(const char *infile, GSList *pdlist, struct output *op)
                        if (!strcmp(decoder_class[0], op->class)) {
                                op->class_idx = idx;
                                break;
-                       } else
-                               idx++;
+                       }
+                       idx++;
                        l = l->next;
                }
                if (op->class_idx == -1) {
                        ERR("Output class '%s' not found in decoder %s.",
                                        op->class, pd->name);
                        return FALSE;
-               } else
-                       DBG("Class %s index is %d", op->class, op->class_idx);
+               }
+               DBG("Class %s index is %d", op->class, op->class_idx);
        }
 
        sr_session_start(sr_sess);