int ses_layout_function(ScfEfunction* f, uint32_t d, uint32_t bx, uint32_t by, uint32_t bw, uint32_t bh)
{
- ScfEcomponent* c;
+ ScfEcomponent* c0;
+ ScfEcomponent* c1;
ScfEline* el0;
ScfEline* el1;
ScfEline* el2;
return -ENOMEM;
l0->x0 = bx;
- l0->x1 = bx + d;
+ l0->x1 = bx;
l0->y0 = by + i * d;
l0->y1 = l0->y0;
j = 0;
while (m + 1 < el0->n_pins && n + 1 < el1->n_pins) {
- uint64_t c0 = el0->pins[m];
- uint64_t c1 = el1->pins[n];
+ uint64_t cid0 = el0->pins[m];
+ uint64_t cid1 = el1->pins[n];
- if (c0 < c1)
+ if (el0->pins[m] < el1->pins[n])
m += 2;
- else if (c0 > c1)
+ else if (el0->pins[m] > el1->pins[n])
n += 2;
else {
- c = f->components[c0];
+ c0 = f->components[el0->pins[m]];
- p0 = c->pins[el0->pins[m + 1]];
- p1 = c->pins[el1->pins[n + 1]];
+ p0 = c0->pins[el0->pins[m + 1]];
+ p1 = c0->pins[el1->pins[n + 1]];
- if (SCF_EDA_Battery == c->type) {
+ if (SCF_EDA_Battery == c0->type) {
p0->x = el0->lines[0]->x0;
p1->x = el1->lines[0]->x0;
for (m = 0; m + 1 < el0->n_pins; m += 2) {
- c = f->components[el0->pins[m]];
- p0 = c->pins[el0->pins[m + 1]];
+ c0 = f->components[el0->pins[m]];
+ p0 = c0->pins[el0->pins[m + 1]];
if (0 == p0->x) {
- if (SCF_EDA_Battery == c->type)
+ if (SCF_EDA_Battery == c0->type)
p0->x = el0->lines[0]->x0;
else {
p0->x = el0->lines[0]->x1 + d + rand() % 10;
scf_loge("f->x: %d, y: %d, w: %d, h: %d\n", f->x, f->y, f->w, f->h);
for (i = 0; i < f->n_components; i++) {
- c = f->components[i];
+ c0 = f->components[i];
uint32_t cx = 0;
uint32_t cy = 0;
- for (j = 0; j < c->n_pins; j++) {
- p0 = c->pins[j];
+ for (j = 0; j < c0->n_pins; j++) {
+ p0 = c0->pins[j];
cx += p0->x;
cy += p0->y;
}
- c->x = cx / c->n_pins;
- c->y = cy / c->n_pins;
+ c0->x = cx / c0->n_pins;
+ c0->y = cy / c0->n_pins;
}
return 0;