]> sigrok.org Git - libsigrokdecode.git/commitdiff
nit: break a long line in different ways, unobfuscate parameter grouping
authorGerhard Sittig <redacted>
Mon, 10 Oct 2016 16:25:37 +0000 (18:25 +0200)
committerGerhard Sittig <redacted>
Thu, 24 Nov 2022 12:13:58 +0000 (13:13 +0100)
Break a rather long line for a Python method call at a different
location, to better reflect the parameter groups which organize for the
method to get called, and those which pass parameters to that called
method. This commit also splits the actual action and its check for
successful execution into separate C language statements.

type_decoder.c

index cf7ec8e7c383b40b502201e4034b4b9b98e0a8de..5a1e1a81c512625365d10ef98cb5b02e6df41e37 100644 (file)
@@ -482,9 +482,9 @@ static PyObject *Decoder_put(PyObject *self, PyObject *args)
                                 start_sample,
                                 end_sample, output_type_name(pdo->output_type),
                                 output_id, pdo->proto_id, next_di->inst_id);
-                       if (!(py_res = PyObject_CallMethod(
-                               next_di->py_inst, "decode", "KKO", start_sample,
-                               end_sample, py_data))) {
+                       py_res = PyObject_CallMethod(next_di->py_inst, "decode",
+                               "KKO", start_sample, end_sample, py_data);
+                       if (!py_res) {
                                srd_exception_catch("Calling %s decode() failed",
                                                        next_di->inst_id);
                        }