Commit 5935bba9 authored by Daan Vreeken's avatar Daan Vreeken
Browse files

De-indent code a bit by reversing the order of the outer if (..).

(No functional changes.)
There's an error in the error reporting of this routine, but we'll fix that in
a separate commit.

	modified:   controller/controller_block.c
parent 8cd6afe9
......@@ -473,37 +473,37 @@ static int controller_block_resolve_link(struct controller_block_link *link)
outtype = out->output[i].type;
}
}
if (outptr) {
for (i = 0; i < in->inputs; i++) {
if (strcmp(in->input[i].name, link->interm) ||
in->input[i].type != outtype)
continue;
link->type = controller_block_term_str(in->input[i].type);
log_send(LOG_T_DEBUG,
"Linking %s.%s to %s.%s%s",
link->outblock, link->outterm,
link->inblock, link->interm,
link->chain ? " (chained)" : "");
*in->input[i].value.v = outptr;
if (link->chain)
in->input[i].otherside = outsource;
else
in->input[i].otherside = NULL;
set_ghost_otherside(&in->input[i],
link->chain ? outsource : NULL, outptr);
return 0;
}
log_send(LOG_T_ERROR,
"Input terminal %s.%s not found",
link->inblock, link->interm);
} else {
if (outptr == NULL) {
log_send(LOG_T_ERROR,
"Output terminal %s.%s not found",
link->outblock, link->outterm);
return -1;
}
for (i = 0; i < in->inputs; i++) {
if (strcmp(in->input[i].name, link->interm) ||
in->input[i].type != outtype)
continue;
link->type = controller_block_term_str(in->input[i].type);
log_send(LOG_T_DEBUG,
"Linking %s.%s to %s.%s%s",
link->outblock, link->outterm,
link->inblock, link->interm,
link->chain ? " (chained)" : "");
*in->input[i].value.v = outptr;
if (link->chain)
in->input[i].otherside = outsource;
else
in->input[i].otherside = NULL;
set_ghost_otherside(&in->input[i],
link->chain ? outsource : NULL, outptr);
return 0;
}
log_send(LOG_T_ERROR,
"Input terminal %s.%s not found",
link->inblock, link->interm);
} else {
if (!in) {
log_send(LOG_T_DEBUG,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment