diff --git a/log/src/log.c b/log/src/log.c index 0a1344cd4b9dd91dce7dba9c1ee315530f3a0062..d992960fb00abcf03525ddbfa323aef364dd9d69 100644 --- a/log/src/log.c +++ b/log/src/log.c @@ -433,8 +433,8 @@ static int rabbits, rabflag; /* Rabbit mode */ static int avoidrabbits; static short txacross, txdown, across, down, baseline, line1, line2, - kindgroupbase, kindgroupleft, kindgroupright, kindgroupstart, - kindgroupsize, histdown; + kindgroupbase, kindgroupleft, kindgroupright, kindgroupstart, + kindgroupsize, histdown; static int entrycapslock; /* Capslock status on entry */ static int oldcapslock; /* Previous capslock status */ @@ -873,7 +873,7 @@ static void line(x1, y1, x2, y2) short x1, y1, x2, y2; { m_drawline(x1 * gg.scale - gg.xoff, y1 * gg.scale - gg.yoff, - x2 * gg.scale - gg.xoff, y2 * gg.scale - gg.yoff); + x2 * gg.scale - gg.xoff, y2 * gg.scale - gg.yoff); } @@ -892,7 +892,7 @@ short x1, x2, y; yy = y * gg.scale - gg.yoff; m_drawline(x1 * gg.scale - gg.xoff, (long)yy, x2 * gg.scale - gg.xoff, - (long)yy); + (long)yy); } @@ -911,7 +911,7 @@ short x, y1, y2; xx = x * gg.scale - gg.xoff; m_drawline((long)xx, y1 * gg.scale - gg.yoff, (long)xx, - y2 * gg.scale - gg.yoff); + y2 * gg.scale - gg.yoff); } @@ -940,7 +940,7 @@ static void rect(x1, y1, x2, y2) short x1, y1, x2, y2; { m_drawrect(x1 * gg.scale - gg.xoff, y1 * gg.scale - gg.yoff, - x2 * gg.scale - gg.xoff, y2 * gg.scale - gg.yoff); + x2 * gg.scale - gg.xoff, y2 * gg.scale - gg.yoff); } @@ -955,7 +955,7 @@ static void box(x1, y1, x2, y2) short x1, y1, x2, y2; { m_fillrect(x1 * gg.scale - gg.xoff, y1 * gg.scale - gg.yoff, - x2 * gg.scale - gg.xoff, y2 * gg.scale - gg.yoff); + x2 * gg.scale - gg.xoff, y2 * gg.scale - gg.yoff); } @@ -1227,7 +1227,7 @@ static void addrabbit() WITH = &rabtable[i]; if (WITH->next == 1) { if (WITH->x + 24 >= rx && WITH->x <= rx + 24 && WITH->y + 26 >= ry && - WITH->y <= ry + 26) + WITH->y <= ry + 26) nogood = true; } } @@ -1887,7 +1887,7 @@ short x, y; if (WITH->flag.U3.named && g->sig > 0) { char STR1[256]; short xwid = m_strwidth(NULL, strrtrim(strcpy(STR1, - gg.signaltab[g->sig - 1].name))) - NAMEGAP; + gg.signaltab[g->sig - 1].name))) - NAMEGAP; if (WITH->flag.U3.nright) { if (xwid > loc_x2) loc_x2 = xwid; @@ -1976,18 +1976,18 @@ short xx, yy; while (g != NULL && gg.probegate == NULL) { k = g->kind; if (g->x >= x - k->bbmax && g->x <= x + k->bbmax && - g->y >= y - k->bbmax && g->y <= y + k->bbmax) { + g->y >= y - k->bbmax && g->y <= y + k->bbmax) { if (insidegate(g, x, y)) - gg.probegate = g; + gg.probegate = g; else if (g->kind->simtype->simtype >= 8) { - FORLIM = g->kind->numpins; - for (i = 1; i <= FORLIM; i++) { - if (x == g->pinpos[i - 1].x && y == g->pinpos[i - 1].y) { + FORLIM = g->kind->numpins; + for (i = 1; i <= FORLIM; i++) { + if (x == g->pinpos[i - 1].x && y == g->pinpos[i - 1].y) { gg.probegate = g; gg.probenode = g->pin[i - 1]; gg.probepin = i; - } - } + } + } } } g = g->next; @@ -2048,7 +2048,7 @@ short xx, yy; unprobe(); else if (gg.probevwire != NULL && (gg.probevwire->y1 > y || y > gg.probevwire->y2 || - gg.probevwire->x != x)) + gg.probevwire->x != x)) unprobe(); } @@ -2059,252 +2059,307 @@ short xx, yy; static void parselabel(lbl, numattrs, attr) -na_strlist_t **lbl; -short *numattrs; -log_kattrrec **attr; -{ - short j, j1, j2, j3, yy, maxx; - na_strlist_t *l1, *l2, *l3, *attrnames; - char buf[256]; - int haveprec; - log_kattrrec *WITH; - char STR1[256]; - char STR2[256]; - short FORLIM; - - j = 1; - *numattrs = 0; - attrnames = NULL; - l1 = *lbl; - while (l1 != NULL) { - j = strposc(l1->s, ':', 1L); - if (j != 0 && j != strpos2(l1->s, "::", 1)) - (*numattrs)++; - l1->value = (na_long)strlen(l1->s); - l1 = l1->next; - } -/* p2c: log.text, line 2056: Note: Can't interpret size in NA_NEW [174] */ - *attr = (log_kattrrec *)Malloc(*numattrs * kattrrecsize); - maxx = 0; - l1 = *lbl; - j = 1; - yy = 0; - while (l1 != NULL) { - j1 = strposc(l1->s, ':', 1L); - if (j1 != 0 && j1 != strpos2(l1->s, "::", 1)) { - WITH = &(*attr)[j - 1]; - WITH->vr = 0; - WITH->vra = 0; - strcpy(STR1, strltrim(l1->s)); - strcpy(l1->s, STR1); - while (*l1->s == '[') { - j2 = strposc(l1->s, ']', 1L); - if (j2 < 3) - continue; - l2 = strlist_append(&attrnames, strpart(STR1, l1->s, 2, j2 - 1)); - l2->value = (na_long)((long)j); - strcpy_overlap(l1->s, l1->s + j2); - strcpy(STR1, strltrim(l1->s)); - strcpy(l1->s, STR1); - } - j2 = strposc(l1->s, ';', 1L); - if (j2 != 0 && j2 < j1) { - sprintf(buf, "%.*s", j2 - 1, l1->s); - strrtrim(buf); - j3 = 1; - while (j3 < j && WITH->vra == 0) { - if ((*attr)[j3 - 1].dtype == 'V') { - l2 = (*attr)[j3 - 1].UU.U86.v; - while (l2 != NULL && strcicmp(l2->s, buf) != 0) - l2 = l2->next; - if (l2 != NULL) { - WITH->vr = (long)l2->value; - WITH->vra = j3; - } - } - j3++; - } - strcpy_overlap(l1->s, l1->s + j2); - } - if (l1->s[0] == ' ') { - strcpy(STR1, strltrim(l1->s)); - strcpy(l1->s, STR1); - } - WITH->prec = 0; - haveprec = false; - while (isdigit(l1->s[0])) { - WITH->prec = WITH->prec * 10 + l1->s[0] - 48; - haveprec = true; - strcpy_overlap(l1->s, l1->s + 1); - } - if (l1->s[0] == ' ') { - strcpy(STR1, strltrim(l1->s)); - strcpy(l1->s, STR1); - } - WITH->opt = false; - do { - WITH->dtype = toupper(l1->s[0]); - if (l1->s[0] != ':') { - do { - strcpy_overlap(l1->s, l1->s + 1); - } while (l1->s[0] == ' '); +na_strlist_t **lbl; // list des chaine de caractères à parser +short *numattrs; // nombre d'attribut trouvé +log_kattrrec **attr; //Vecteur retour des attributs parsé +{ + short j, j1, j2, j3, yy, maxx; + na_strlist_t *l1, *l2, *l3, *attrnames; + char buf[256]; + int haveprec; + log_kattrrec *WITH; + char STR1[256]; + char STR2[256]; + short FORLIM; + + j = 1; + *numattrs = 0; + attrnames = NULL; + l1 = *lbl; + // boucle qui compte le nombre d'attribut + while (l1 != NULL) { + j = strposc(l1->s, ':', 1L); + if (j != 0 && j != strpos2(l1->s, "::", 1)) + (*numattrs)++; + + l1->value = (na_long)strlen(l1->s); + l1 = l1->next; } - if (WITH->dtype == 'O') - WITH->opt = true; - } while (WITH->dtype == 'O'); - if (WITH->dtype == 'F' || WITH->dtype == 'U' || WITH->dtype == 'R') { - *WITH->UU.U82.u = '\0'; - if (WITH->dtype == 'F' || WITH->dtype == 'U') { - while (l1->s[0] != ',' && l1->s[0] != ':') { - if (l1->s[0] != ' ' && strlen(WITH->UU.U82.u) < 3) - sprintf(WITH->UU.U82.u + strlen(WITH->UU.U82.u), "%c", l1->s[0]); - strcpy_overlap(l1->s, l1->s + 1); - } - if (l1->s[0] == ',') - strcpy_overlap(l1->s, l1->s + 1); - strcpy(STR1, strltrim(l1->s)); - strcpy(l1->s, STR1); - } - *buf = '\0'; - while (l1->s[0] != ':') { - sprintf(buf + strlen(buf), "%c", l1->s[0]); - strcpy_overlap(l1->s, l1->s + 1); - } - WITH->UU.U82.r = 0.0; - WITH->blnk = true; - if (*buf != '\0') { - readreal(buf, &WITH->UU.U82.r); - WITH->blnk = false; - } - if (!haveprec) - WITH->prec = 0; - } else if (WITH->dtype == 'I') { - WITH->UU.U73.i1 = 0; - WITH->blnk = true; - while (isdigit(l1->s[0])) { - WITH->UU.U73.i1 = WITH->UU.U73.i1 * 10 + l1->s[0] - 48; - strcpy_overlap(l1->s, l1->s + 1); - WITH->blnk = false; - } - if (!haveprec) - WITH->prec = 1; - } else if (WITH->dtype == 'H') { - WITH->UU.U73.i1 = 0; - j1 = 0; - WITH->blnk = true; - while ((l1->s[0] >= 'a' && l1->s[0] <= 'f') || - (l1->s[0] >= 'A' && l1->s[0] <= 'F') || isdigit(l1->s[0])) { - WITH->UU.U73.i1 = WITH->UU.U73.i1 * 10 + l1->s[0] - 48; - if (l1->s[0] >= 'A') - WITH->UU.U73.i1 -= 7; - if (l1->s[0] >= 'a') - WITH->UU.U73.i1 -= 32; - strcpy_overlap(l1->s, l1->s + 1); - j1++; - WITH->blnk = false; - } - if (!haveprec) { - if (j1 != 0) - WITH->prec = j1; - else - WITH->prec = 1; + *attr = (log_kattrrec *)Malloc(*numattrs * kattrrecsize); + maxx = 0; + l1 = *lbl; + j = 1; + yy = 0; + // On parcours de nouveau la liste de string + while (l1 != NULL) + { + j1 = strposc(l1->s, ':', 1L); + // Si c'est bien un attribut + if (j1 != 0 && j1 != strpos2(l1->s, "::", 1)) + { + WITH = &(*attr)[j - 1]; + WITH->vr = 0; + WITH->vra = 0; + strcpy(STR1, strltrim(l1->s)); + strcpy(l1->s, STR1); // TODO optimiser + // elimine les [ ] si autour de l'attribut + while (l1->s[0] == '[') + { + j2 = strposc(l1->s, ']', 1L); + if (j2 < 3) + continue; + l2 = strlist_append(&attrnames, strpart(STR1, l1->s, 2, j2 - 1)); + l2->value = (na_long)((long)j); + strcpy_overlap(l1->s, l1->s + j2); + strcpy(STR1, strltrim(l1->s)); + strcpy(l1->s, STR1); // TODO optimiser + } + j2 = strposc(l1->s, ';', 1L); + if (j2 != 0 && j2 < j1) + { + sprintf(buf, "%.*s", j2 - 1, l1->s); + strrtrim(buf); + j3 = 1; + // Recherche si l'attribut à déjà été défini + while (j3 < j && WITH->vra == 0) + { + if ((*attr)[j3 - 1].dtype == 'V') + { + l2 = (*attr)[j3 - 1].UU.U86.v; + while (l2 != NULL && strcicmp(l2->s, buf) != 0) + l2 = l2->next; + + if (l2 != NULL) { + WITH->vr = (long)l2->value; + WITH->vra = j3; + } + } + j3++; + } + strcpy_overlap(l1->s, l1->s + j2); + } + if (l1->s[0] == ' ') + { + strcpy(STR1, strltrim(l1->s)); + strcpy(l1->s, STR1); // TODO optimiser + } + WITH->prec = 0; + haveprec = false; + while (isdigit(l1->s[0])) + { + WITH->prec = WITH->prec * 10 + l1->s[0] - 48; + haveprec = true; + strcpy_overlap(l1->s, l1->s + 1); + } + if (l1->s[0] == ' ') + { + strcpy(STR1, strltrim(l1->s)); + strcpy(l1->s, STR1); + } + WITH->opt = false; + do + { + WITH->dtype = toupper(l1->s[0]); + if (l1->s[0] != ':') + { + do + { + strcpy_overlap(l1->s, l1->s + 1); + } + while (l1->s[0] == ' '); + } + if (WITH->dtype == 'O') + WITH->opt = true; + + } + while (WITH->dtype == 'O'); + + if (WITH->dtype == 'F' || WITH->dtype == 'U' || WITH->dtype == 'R') + { + *WITH->UU.U82.u = '\0'; + if (WITH->dtype == 'F' || WITH->dtype == 'U') + { + while (l1->s[0] != ',' && l1->s[0] != ':') + { + if (l1->s[0] != ' ' && strlen(WITH->UU.U82.u) < 3) + sprintf(WITH->UU.U82.u + strlen(WITH->UU.U82.u), "%c", l1->s[0]); + + strcpy_overlap(l1->s, l1->s + 1); + } + if (l1->s[0] == ',') + strcpy_overlap(l1->s, l1->s + 1); + + strcpy(STR1, strltrim(l1->s)); + strcpy(l1->s, STR1); + } + *buf = '\0'; + while (l1->s[0] != ':') + { + sprintf(buf + strlen(buf), "%c", l1->s[0]); + strcpy_overlap(l1->s, l1->s + 1); + } + WITH->UU.U82.r = 0.0; + WITH->blnk = true; + if (*buf != '\0') + { + readreal(buf, &WITH->UU.U82.r); + WITH->blnk = false; + } + if (!haveprec) + WITH->prec = 0; + + } + else if (WITH->dtype == 'I') + { + WITH->UU.U73.i1 = 0; + WITH->blnk = true; + while (isdigit(l1->s[0])) + { + WITH->UU.U73.i1 = WITH->UU.U73.i1 * 10 + l1->s[0] - 48; + strcpy_overlap(l1->s, l1->s + 1); + WITH->blnk = false; + } + if (!haveprec) + WITH->prec = 1; + + } + else if (WITH->dtype == 'H') + { + WITH->UU.U73.i1 = 0; + j1 = 0; + WITH->blnk = true; + while ((l1->s[0] >= 'a' && l1->s[0] <= 'f') || + (l1->s[0] >= 'A' && l1->s[0] <= 'F') || isdigit(l1->s[0])) + { + WITH->UU.U73.i1 = WITH->UU.U73.i1 * 10 + l1->s[0] - 48; + if (l1->s[0] >= 'A') + WITH->UU.U73.i1 -= 7; + + if (l1->s[0] >= 'a') + WITH->UU.U73.i1 -= 32; + + strcpy_overlap(l1->s, l1->s + 1); + j1++; + WITH->blnk = false; + } + if (!haveprec) + { + if (j1 != 0) + WITH->prec = j1; + else + WITH->prec = 1; + } + } + else if (WITH->dtype == 'C') + { + j1 = strposc(l1->s, ':', 1L); + sprintf(buf, "%.*s", j1 - 1, l1->s); + strrtrim(buf); + strcpy_overlap(l1->s, l1->s + j1 - 1); + if (!haveprec) + WITH->prec = 255; + + if (strlen(buf) > WITH->prec) + buf[WITH->prec] = '\0'; + + WITH->UU.c = (char *)Malloc(WITH->prec + 1L); + strcpy(WITH->UU.c, buf); + WITH->blnk = (*buf == '\0'); + } + else if (WITH->dtype == 'A') + { + j1 = strposc(l1->s, ':', 1L); + sprintf(buf, "%.*s", j1 - 1, l1->s); + strrtrim(buf); + strcpy_overlap(l1->s, l1->s + j1 - 1); + WITH->prec = 255; + WITH->UU.sp = strdup(buf); + WITH->blnk = (*buf == '\0'); + } + else if (WITH->dtype == 'B') + { + WITH->blnk = false; + if (l1->s[0] == 'y' || l1->s[0] == 'Y' || l1->s[0] == 't' || l1->s[0] == 'T') + WITH->UU.b = true; + else if (l1->s[0] == 'n' || l1->s[0] == 'N' || l1->s[0] == 'f' || l1->s[0] == 'F') + WITH->UU.b = false; + else + WITH->blnk = true; + + if (l1->s[0] == 'x' || l1->s[0] == 'X' || l1->s[0] == 'f' || + l1->s[0] == 'F' || l1->s[0] == 't' || l1->s[0] == 'T') + WITH->prec = 2; + else + WITH->prec = 1; + } + else if (WITH->dtype == 'V') + { + strlist_init(&l2); + WITH->UU.U86.nv = 0; + do + { + *buf = '\0'; + while (l1->s[0] != ',' && l1->s[0] != ':') + { + sprintf(buf + strlen(buf), "%c", l1->s[0]); + strcpy_overlap(l1->s, l1->s + 1); + } + if (l1->s[0] == ',') + strcpy_overlap(l1->s, l1->s + 1); + + l3= strlist_append(&l2,strcpy(STR1, strltrim(strrtrim(strcpy(STR2, buf))))); + l3->value = (na_long)((long)WITH->UU.U86.nv); + WITH->UU.U86.nv++; + strcpy(STR1, strltrim(l1->s)); + strcpy(l1->s, STR1); + } + while (l1->s[0] != ':'); + WITH->UU.U86.v = l2; + WITH->blnk = false; + if (haveprec) + WITH->UU.U86.dv = WITH->prec; + else + WITH->UU.U86.dv = 0; + + WITH->prec = 1; + } + else + { + WITH->dtype = 'R'; + WITH->UU.U82.r = 0.0; + WITH->blnk = true; + if (!haveprec) + WITH->prec = 0; + } + if (WITH->blnk) + WITH->opt = true; + + j1 = strposc(l1->s, ':', 1L); + strcpy_overlap(l1->s, l1->s + j1); + j++; + WITH->y = yy; + if (strlen(l1->s) > maxx) + maxx = strlen(l1->s); + + } + j1 = 1; + while (j1 < strlen(l1->s)) + { + if (l1->s[j1 - 1] == ':' && l1->s[j1] == ':') + strcpy_overlap(l1->s + j1 - 1, l1->s + j1); + j1++; + } + yy++; + l1 = l1->next; } - } else if (WITH->dtype == 'C') { - j1 = strposc(l1->s, ':', 1L); - sprintf(buf, "%.*s", j1 - 1, l1->s); - strrtrim(buf); - strcpy_overlap(l1->s, l1->s + j1 - 1); - if (!haveprec) - WITH->prec = 255; - if (strlen(buf) > WITH->prec) { - buf[WITH->prec] = '\0'; -/* p2c: log.text, line 2200: - * Note: Modification of string length may translate incorrectly [146] */ + if (attrnames != NULL) { + l1 = strlist_insert(lbl, ""); + l1->kind = '\001'; + l1->value = (void *)attrnames; } - WITH->UU.c = (char *)Malloc(WITH->prec + 1L); - strcpy(WITH->UU.c, buf); - WITH->blnk = (*buf == '\0'); - } else if (WITH->dtype == 'A') { - j1 = strposc(l1->s, ':', 1L); - sprintf(buf, "%.*s", j1 - 1, l1->s); - strrtrim(buf); - strcpy_overlap(l1->s, l1->s + j1 - 1); - WITH->prec = 255; - WITH->UU.sp = strdup(buf); - WITH->blnk = (*buf == '\0'); - } else if (WITH->dtype == 'B') { - WITH->blnk = false; - if (l1->s[0] == 'y' || l1->s[0] == 'Y' || l1->s[0] == 't' || - l1->s[0] == 'T') - WITH->UU.b = true; - else if (l1->s[0] == 'n' || l1->s[0] == 'N' || l1->s[0] == 'f' || - l1->s[0] == 'F') - WITH->UU.b = false; - else - WITH->blnk = true; - if (l1->s[0] == 'x' || l1->s[0] == 'X' || l1->s[0] == 'f' || - l1->s[0] == 'F' || l1->s[0] == 't' || l1->s[0] == 'T') - WITH->prec = 2; - else - WITH->prec = 1; - } else if (WITH->dtype == 'V') { - strlist_init(&l2); - WITH->UU.U86.nv = 0; - do { - *buf = '\0'; - while (l1->s[0] != ',' && l1->s[0] != ':') { - sprintf(buf + strlen(buf), "%c", l1->s[0]); - strcpy_overlap(l1->s, l1->s + 1); - } - if (l1->s[0] == ',') - strcpy_overlap(l1->s, l1->s + 1); - l3 = strlist_append(&l2, - strcpy(STR1, strltrim(strrtrim(strcpy(STR2, buf))))); - l3->value = (na_long)((long)WITH->UU.U86.nv); - WITH->UU.U86.nv++; - strcpy(STR1, strltrim(l1->s)); - strcpy(l1->s, STR1); - } while (l1->s[0] != ':'); - WITH->UU.U86.v = l2; - WITH->blnk = false; - if (haveprec) - WITH->UU.U86.dv = WITH->prec; - else - WITH->UU.U86.dv = 0; - WITH->prec = 1; - } else { - WITH->dtype = 'R'; - WITH->UU.U82.r = 0.0; - WITH->blnk = true; - if (!haveprec) - WITH->prec = 0; - } - if (WITH->blnk) - WITH->opt = true; - j1 = strposc(l1->s, ':', 1L); - strcpy_overlap(l1->s, l1->s + j1); - j++; - WITH->y = yy; - if (strlen(l1->s) > maxx) - maxx = strlen(l1->s); - } - j1 = 1; - while (j1 < strlen(l1->s)) { - if (l1->s[j1 - 1] == ':' && l1->s[j1] == ':') - strcpy_overlap(l1->s + j1 - 1, l1->s + j1); - j1++; - } - yy++; - l1 = l1->next; - } - if (attrnames != NULL) { - l1 = strlist_insert(lbl, ""); - l1->kind = '\001'; - l1->value = (void *)attrnames; - } - FORLIM = *numattrs; - for (j = 0; j < FORLIM; j++) - (*attr)[j].x = maxx + 1; + FORLIM = *numattrs; + for (j = 0; j < FORLIM; j++) + (*attr)[j].x = maxx + 1; } @@ -2406,12 +2461,12 @@ char *name_; cnfp = cnfbase; while (cnfp != NULL) { if (!strcmp(cnfp->tool, name)) { - doingcnffunction = true; - gg.action = act_cnf; - strcpy(gg.funcarg, cnfp->s); - getword(gg.funcarg, gg.func); - (*proc)(&gg); - doingcnffunction = false; + doingcnffunction = true; + gg.action = act_cnf; + strcpy(gg.funcarg, cnfp->s); + getword(gg.funcarg, gg.func); + (*proc)(&gg); + doingcnffunction = false; } cnfp = cnfp->next; } @@ -2715,7 +2770,7 @@ static void clearscreen() remcursor(); m_noclip(); m_vsetcolors((long)gg.color.backgr, 1L, &rcolormap[gg.color.backgr], - &gcolormap[gg.color.backgr], &bcolormap[gg.color.backgr]); + &gcolormap[gg.color.backgr], &bcolormap[gg.color.backgr]); m_color((long)gg.color.backgr); m_fillrect(0L, 0L, (long)across, (long)down); fixcolormap(); @@ -2806,7 +2861,7 @@ static void pen() /* static int pollkbd2(void); */ static int oldx, oldy; static long awake; - long now; + long now; char rval, gval, bval; @@ -2858,23 +2913,23 @@ static void pen() do { i++; } while ((rablist[i].x != rx || rablist[i].y != ry) && - rablist[i].next < 0); + rablist[i].next < 0); if (rablist[i].x == rx && rablist[i].y == ry) { if (i == rablistsize) { remcursor(); rabbits = !rabbits; if (rabbits && !gg.quiet) { - i = 1; - x = timers_sysclock(); - do { - y = discomadness[i - 1].time; - BEEPER(discomadness[i - 1].note, (int)y); - do { - } while (timers_sysclock() <= x + y); - /* nothing */ - i++; - x = timers_sysclock(); - } while (y != 0); + i = 1; + x = timers_sysclock(); + do { + y = discomadness[i - 1].time; + BEEPER(discomadness[i - 1].note, (int)y); + do { + } while (timers_sysclock() <= x + y); + /* nothing */ + i++; + x = timers_sysclock(); + } while (y != 0); } rabstate = 0; } else @@ -2921,14 +2976,14 @@ static void pen() rval = (char)(x * rcolormap[cred] / 255); gval = (char)(x * gcolormap[cred] / 255); bval = (char)(x * bcolormap[cred] / 255); - m_vsetcolors((long)cred, 1L, (unsigned char *) &rval, + m_vsetcolors((long)cred, 1L, (unsigned char *) &rval, (unsigned char *) &gval, (unsigned char *) &bval); } if (gg.t.moving) { gg.fastspeed = gg.fastmin; fastsavetime = timers_sysclock(); } else if (gg.fastspeed < gg.fastmax && - timers_sysclock() > fastsavetime + gg.fastrate) { + timers_sysclock() > fastsavetime + gg.fastrate) { gg.fastspeed++; fastsavetime = timers_sysclock(); } @@ -3166,13 +3221,13 @@ long x1, y1, x2, y2; savecol = m_curcolor(); m_color(m_trans); m_ellipse((x1 + x2) / 2, (y1 + y2) / 2, (x1 - x2) / 2, (y1 - y2) / 2, - savecol); + savecol); m_color(savecol); break; case 'E': m_ellipse((x1 + x2) / 2, (y1 + y2) / 2, (x1 - x2) / 2, (y1 - y2) / 2, - m_curcolor()); + m_curcolor()); break; case 'r': /*should do a true roundrect*/ @@ -3237,21 +3292,21 @@ long scale, rot, xx, yy; switch (toupper(buf[i])) { case '$': - strcpy_overlap(buf + i - 1, buf + i); - i++; - break; + strcpy_overlap(buf + i - 1, buf + i); + i++; + break; case 'P': case 'B': case 'O': case 'X': - mode = toupper(buf[i]); /*close enough*/ - strcpy_overlap(buf + i - 1, buf + i + 1); - break; + mode = toupper(buf[i]); /*close enough*/ + strcpy_overlap(buf + i - 1, buf + i + 1); + break; default: - i++; - break; + i++; + break; } continue; } @@ -3260,23 +3315,23 @@ long scale, rot, xx, yy; case 'P': j = strposc("0.,+123-456*789/E()^", buf[i - 1], 1L); if (j > 0) - buf[i - 1] = (char)(j + 147); + buf[i - 1] = (char)(j + 147); break; case 'B': j = strposc("0.,+123-456*789/\0()^ABCDEFGHIJKLMNOPQRSTUVWXYZ", - toupper(buf[i - 1]), 1L); + toupper(buf[i - 1]), 1L); if (j > 20) - buf[i - 1] = (char)(j + 147); + buf[i - 1] = (char)(j + 147); else if (j > 0) - buf[i - 1] = (char)(j + 127); + buf[i - 1] = (char)(j + 127); break; case 'O': j = strposc("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", - toupper(buf[i - 1]), 1L); + toupper(buf[i - 1]), 1L); if (j > 0) - buf[i - 1] = (char)(j + 213); + buf[i - 1] = (char)(j + 213); break; } i++; @@ -3454,8 +3509,8 @@ short x, y, g, c; case 'E': case 'r': drawvector2(&k->vector[i], (long)(x + WITH1->x1), - (long)(y + WITH1->y1), (long)(x + WITH1->UU.U99.x2), - (long)(y + WITH1->UU.U99.y2)); + (long)(y + WITH1->y1), (long)(x + WITH1->UU.U99.x2), + (long)(y + WITH1->UU.U99.y2)); break; case 'c': @@ -3695,7 +3750,7 @@ short x, y, g, c; FORLIM = WITH->numpins; for (i = 0; i < FORLIM; i++) point(x + WITH->pin[i].x * rxx + WITH->pin[i].y * ryx, - y + WITH->pin[i].x * rxy + WITH->pin[i].y * ryy); + y + WITH->pin[i].x * rxy + WITH->pin[i].y * ryy); return; } WITH = kind[(g & (log_kindoffset - 1)) - 1]; @@ -3777,7 +3832,7 @@ short x, y, g, c; (long)(xx + (WITH1->x1 * rxx + WITH1->y1 * ryx) / log_scale0), (long)(yy + (WITH1->x1 * rxy + WITH1->y1 * ryy) / log_scale0), (long) - (xx + (WITH1->UU.U99.x2 * rxx + WITH1->UU.U99.y2 * ryx) / log_scale0), + (xx + (WITH1->UU.U99.x2 * rxx + WITH1->UU.U99.y2 * ryx) / log_scale0), (long) (yy + (WITH1->UU.U99.x2 * rxy + WITH1->UU.U99.y2 * ryy) / log_scale0)); @@ -3787,14 +3842,14 @@ short x, y, g, c; case 'C': m_circle(xx + ((WITH1->x1 + WITH1->UU.U99.x2) * rxx + (WITH1->y1 + - WITH1->UU.U99.y2) * ryx) / (log_scale0 * 2L), + WITH1->UU.U99.y2) * ryx) / (log_scale0 * 2L), yy + ((WITH1->x1 + WITH1->UU.U99.x2) * rxy + (WITH1->y1 + WITH1-> - UU.U99.y2) * ryy) / (log_scale0 * 2L), + UU.U99.y2) * ryy) / (log_scale0 * 2L), P_imax2((long)abs((WITH1->x1 - WITH1->UU.U99.x2) * rxx + - (WITH1->y1 - WITH1->UU.U99.y2) * ryx), - (long)abs((WITH1->x1 - WITH1->UU.U99.x2) * ryx + - (WITH1->y1 - WITH1->UU.U99.y2) * ryy)) / - (log_scale0 * 2)); + (WITH1->y1 - WITH1->UU.U99.y2) * ryx), + (long)abs((WITH1->x1 - WITH1->UU.U99.x2) * ryx + + (WITH1->y1 - WITH1->UU.U99.y2) * ryy)) / + (log_scale0 * 2)); /* p2c: log.text, line 3556: Note: * Line breaker spent 0.0+5.00 seconds, 5000 tries on line 3820 [251] */ break; @@ -3808,9 +3863,9 @@ short x, y, g, c; yy + ((WITH1->x1 + WITH1->UU.U99.x2) * rxy + (WITH1->y1 + WITH1->UU.U99.y2) * ryy) / (log_scale0 * 2L), ((WITH1->x1 - WITH1->UU.U99.x2) * rxx + - (WITH1->y1 - WITH1->UU.U99.y2) * ryx) / (log_scale0 * 2L), + (WITH1->y1 - WITH1->UU.U99.y2) * ryx) / (log_scale0 * 2L), ((WITH1->x1 - WITH1->UU.U99.x2) * ryx + - (WITH1->y1 - WITH1->UU.U99.y2) * ryy) / (log_scale0 * 2L), + (WITH1->y1 - WITH1->UU.U99.y2) * ryy) / (log_scale0 * 2L), savecol); /* p2c: log.text, line 3556: Note: * Line breaker spent 1.0+3.00 seconds, 5000 tries on line 3837 [251] */ @@ -3824,9 +3879,9 @@ short x, y, g, c; yy + ((WITH1->x1 + WITH1->UU.U99.x2) * rxy + (WITH1->y1 + WITH1->UU.U99.y2) * ryy) / (log_scale0 * 2L), ((WITH1->x1 - WITH1->UU.U99.x2) * rxx + - (WITH1->y1 - WITH1->UU.U99.y2) * ryx) / (log_scale0 * 2L), + (WITH1->y1 - WITH1->UU.U99.y2) * ryx) / (log_scale0 * 2L), ((WITH1->x1 - WITH1->UU.U99.x2) * ryx + - (WITH1->y1 - WITH1->UU.U99.y2) * ryy) / (log_scale0 * 2L), + (WITH1->y1 - WITH1->UU.U99.y2) * ryy) / (log_scale0 * 2L), m_curcolor()); /* p2c: log.text, line 3556: Note: * Line breaker spent 1.0+2.00 seconds, 5000 tries on line 3853 [251] */ @@ -3836,16 +3891,16 @@ short x, y, g, c; case 'F': drawvector4(&WITH->vector[i], (long)(xx + (WITH1->x1 * rxx + WITH1->y1 * ryx) / log_scale0), (long)(yy + - (WITH1->x1 * rxy + WITH1->y1 * ryy) / log_scale0), (long)(xx + - (WITH1->UU.U99.x2 * rxx + WITH1->UU.U99.y2 * ryx) / log_scale0), + (WITH1->x1 * rxy + WITH1->y1 * ryy) / log_scale0), (long)(xx + + (WITH1->UU.U99.x2 * rxx + WITH1->UU.U99.y2 * ryx) / log_scale0), (long)(yy + - (WITH1->UU.U99.x2 * rxy + WITH1->UU.U99.y2 * ryy) / log_scale0), + (WITH1->UU.U99.x2 * rxy + WITH1->UU.U99.y2 * ryy) / log_scale0), (long)(xx + - (WITH1->UU.U99.x3 * rxx + WITH1->UU.U99.y3 * ryx) / log_scale0), + (WITH1->UU.U99.x3 * rxx + WITH1->UU.U99.y3 * ryx) / log_scale0), (long)(yy + - (WITH1->UU.U99.x3 * rxy + WITH1->UU.U99.y3 * ryy) / log_scale0), + (WITH1->UU.U99.x3 * rxy + WITH1->UU.U99.y3 * ryy) / log_scale0), (long)(xx + - (WITH1->UU.U99.x4 * rxx + WITH1->UU.U99.y4 * ryx) / log_scale0), + (WITH1->UU.U99.x4 * rxx + WITH1->UU.U99.y4 * ryx) / log_scale0), (long)(yy + (WITH1->UU.U99.x4 * rxy + WITH1->UU.U99.y4 * ryy) / log_scale0)); /* p2c: log.text, line 3556: Note: @@ -3883,8 +3938,8 @@ short x, y, gtype, sig, c; m_color((long)c); if (k->flag.U3.nright != (gtype / log_kindoffset == 0)) drawstr2((int)(x - m_strwidth(NULL, - strrtrim(strcpy(STR1, gg.signaltab[sig - 1].name))) + NAMEGAP), - y - 3, gg.signaltab[sig - 1].name); + strrtrim(strcpy(STR1, gg.signaltab[sig - 1].name))) + NAMEGAP), + y - 3, gg.signaltab[sig - 1].name); else drawstr2(x - NAMEGAP, y - 3, gg.signaltab[sig - 1].name); } @@ -3897,7 +3952,7 @@ log_grec *g; short c; { signallabel((int)(x * gg.scale - gg.xoff), (int)(y * gg.scale - gg.yoff), - g->g, g->sig, c); + g->g, g->sig, c); } @@ -3955,15 +4010,15 @@ short c; break; case east: tx += 5; - break; + break; case north: tx -= hw; ty -= 9; - break; + break; case south: tx -= hw; ty += 5; - break; + break; default: break; @@ -4179,7 +4234,7 @@ log_lrec *l; /* p2c: log.text, line 3810: * Warning: Symbol 'LOGFONT_LFONT' is not defined [221] */ m_drawstr(l->x * gg.scale - gg.xoff, l->y * gg.scale - gg.yoff + 2, - logfont_lfont, l->name); + logfont_lfont, l->name); } @@ -4199,7 +4254,7 @@ log_lrec *l; /* p2c: log.text, line 3825: * Warning: Symbol 'LOGFONT_LFONT' is not defined [221] */ m_drawstr(x * gg.scale - gg.xoff, y * gg.scale - gg.yoff + 2, logfont_lfont, - l->name); + l->name); m_colormode((long)m_normal); } @@ -4379,7 +4434,7 @@ static void refreditmode() hidecursor(); m_color((long)gg.color.backgr); m_fillrect(across + menux4 - 1L, line2 - 2L, across + menux4 + 30L, - line2 + 9L); + line2 + 9L); switch (cureditmode) { case 1: @@ -4430,7 +4485,7 @@ int always; m_color((long)c); m_fillrect(0L, (long)baseline, (long)kindgroupleft, baseline + 1L); m_fillrect((long)kindgroupright, (long)baseline, (long)across, - baseline + 1L); + baseline + 1L); hidecursor(); } @@ -4506,9 +4561,9 @@ static void refresh() s = gg.sbase[gg.curpage - 1]; while (s != NULL) { if (s->hwire != NULL) - n = s->hwire->node; + n = s->hwire->node; else - n = s->vwire->node; + n = s->vwire->node; drawsolderc(s->x, s->y, (int)glowcol(n, (long)gg.color.solder)); s = s->next; } @@ -4519,7 +4574,7 @@ static void refresh() while (hw != NULL) { if (hw->y > y1 && hw->y < y2 && hw != gg.movinghw) { if (vlsi) - m_color((long)gg.color.wire[hw->wcolr - log_wcol_normal]); + m_color((long)gg.color.wire[hw->wcolr - log_wcol_normal]); hline(hw->x1, hw->x2, hw->y); } hw = hw->next; @@ -4529,7 +4584,7 @@ static void refresh() while (vw != NULL) { if (vw->x > x1 && vw->x < x2 && vw != gg.movingvw) { if (vlsi) - m_color((long)gg.color.wire[vw->wcolr - log_wcol_normal]); + m_color((long)gg.color.wire[vw->wcolr - log_wcol_normal]); vline(vw->x, vw->y1, vw->y2); } vw = vw->next; @@ -4539,9 +4594,9 @@ static void refresh() s = gg.sbase[gg.curpage - 1]; while (s != NULL) { if (s->hwire != NULL) - n = s->hwire->node; + n = s->hwire->node; else - n = s->vwire->node; + n = s->vwire->node; drawsolderc(s->x, s->y, gg.color.solder); s = s->next; } @@ -4697,7 +4752,7 @@ char *msg; do { sprintf(tracefname, "/tmp/%.10s%03ld", /* P_citinfo->username, P_rand(&gg.rndseed, 1000L)); */ - cuserid(NULL), P_rand(&gg.rndseed, 1000L)); + cuserid(NULL), P_rand(&gg.rndseed, 1000L)); } while (access(tracefname, F_OK) == 0); } @@ -4822,7 +4877,7 @@ static void refrmenu() refrbaseline(true); m_color((long)gg.color.backgr); m_fillrect(kindgroupleft + 1L, (long)baseline, kindgroupright - 1L, - baseline + 1L); + baseline + 1L); m_color((long)gg.color.menuword); drawstr2(menux1, line1, "Frills"); drawstr2(menux2, line1, "Editing"); @@ -5110,7 +5165,7 @@ log_htrec *ht; short *x; { gg.actval = (ht->time - histgattr[histfirsttime - 1].UU.r) / - histgattr[histsecdiv - 1].UU.r; + histgattr[histsecdiv - 1].UU.r; if (gg.actval > histdivsacross) { *x = across * 2; return; @@ -5334,54 +5389,54 @@ static void pass() gg.prevtimestep = mintime; if (histsweep == histsweep_onreset) { if (!histgattr[histstarttime - 1].blnk && !flag && - gg.time >= histgattr[histstarttime - 1].UU.r) - gg.histactive = true; + gg.time >= histgattr[histstarttime - 1].UU.r) + gg.histactive = true; if (!histgattr[histstoptime - 1].blnk && !flag2 && - gg.time >= histgattr[histstoptime - 1].UU.r) - gg.histactive = false; + gg.time >= histgattr[histstoptime - 1].UU.r) + gg.histactive = false; } st = gg.toolbase; while (st != NULL) { if (st->simulator) { - if (st->nexttstep > 0.0) { - gg.actflag = (st->nexttstep - st->deltatime == mintime); - if (gg.actflag) + if (st->nexttstep > 0.0) { + gg.actflag = (st->nexttstep - st->deltatime == mintime); + if (gg.actflag) st->deltatime = 0.0; - else + else st->deltatime += mintime; - calltool(st, act_tstep); - } + calltool(st, act_tstep); + } } st = st->next; } if (gg.histactive && hncount > 0 && - (histgattr[histminstep - 1].blnk || - gg.time - histtime >= histgattr[histminstep - 1].UU.r)) { + (histgattr[histminstep - 1].blnk || + gg.time - histtime >= histgattr[histminstep - 1].UU.r)) { if (htcount >= histgattr[histmaxcount - 1].UU.U73.i1) { - if (gg.showpage == log_page_history) - historypointx(gg.htbase, &hx1); - while (htcount >= histgattr[histmaxcount - 1].UU.U73.i1) { - ht = gg.htbase->next; - Free(gg.htbase); - gg.htbase = ht; - htcount--; - } - if (gg.showpage == log_page_history) { - if (gg.htbase != NULL) + if (gg.showpage == log_page_history) + historypointx(gg.htbase, &hx1); + while (htcount >= histgattr[histmaxcount - 1].UU.U73.i1) { + ht = gg.htbase->next; + Free(gg.htbase); + gg.htbase = ht; + htcount--; + } + if (gg.showpage == log_page_history) { + if (gg.htbase != NULL) historypointx(gg.htbase, &hx2); - else + else hx2 = across; - if (hx2 >= hx1) { + if (hx2 >= hx1) { m_color((long)gg.color.backgr); m_fillrect((long)hx1, 0L, (long)hx2, (long)histdown); drawhistdivisions(hx1, hx2); - } - } + } + } } if (gg.htbase == NULL) { - histgattr[histfirsttime - 1].UU.r = gg.time; - histgattr[histfirsttime - 1].changed = true; - histonscreen = false; + histgattr[histfirsttime - 1].UU.r = gg.time; + histgattr[histfirsttime - 1].changed = true; + histonscreen = false; } /* p2c: log.text, line 5010: * Note: Suspicious mixture of sizes in NA_NEW [173] */ @@ -5395,47 +5450,47 @@ static void pass() hn = gg.hnbase; i1 = 0; while (hn != NULL) { - gg.actval = 0.0; - gg.actx = hn->sig; - gg.actgattr = hn->attr; - calltoolnode(gg.signaltab[gg.actx - 1].np, act_history); - i1++; - ht->val[i1 - 1] = na_rtosr(gg.actval); - hn = hn->next; + gg.actval = 0.0; + gg.actx = hn->sig; + gg.actgattr = hn->attr; + calltoolnode(gg.signaltab[gg.actx - 1].np, act_history); + i1++; + ht->val[i1 - 1] = na_rtosr(gg.actval); + hn = hn->next; } if (gg.showpage == log_page_history && gg.htlast != NULL) { - historypointx(gg.htlast, &hx1); - historypointx(ht, &hx2); - hn = gg.hnbase; - while (hn != NULL) { - historypointy(hn, gg.htlast, &hy1); - historypointy(hn, ht, &hy2); - if ((unsigned long)gg.acty <= 15) { + historypointx(gg.htlast, &hx1); + historypointx(ht, &hx2); + hn = gg.hnbase; + while (hn != NULL) { + historypointy(hn, gg.htlast, &hy1); + historypointy(hn, ht, &hy2); + if ((unsigned long)gg.acty <= 15) { m_color(gg.acty); m_drawline((long)hx1, (long)hy1, (long)hx2, (long)hy2); - } - hn = hn->next; - } + } + hn = hn->next; + } } if (gg.htlast == NULL) - gg.htbase = ht; + gg.htbase = ht; else - gg.htlast->next = ht; + gg.htlast->next = ht; gg.htlast = ht; htcount++; histtime = gg.time; if (histsweep != histsweep_contin) { - i1 = histgattr[histmaxcount - 1].UU.U73.i1; - if (htcount >= i1 * 9 / 10) { - if (htcount == i1 * 9 / 10) { + i1 = histgattr[histmaxcount - 1].UU.U73.i1; + if (htcount >= i1 * 9 / 10) { + if (htcount == i1 * 9 / 10) { m_noclip(); vmessage("Warning: scope memory is 90% full"); - } - if (htcount == i1 * 19 / 20) { + } + if (htcount == i1 * 19 / 20) { m_noclip(); vmessage("Warning: scope memory is 95% full"); - } - } + } + } } } } else @@ -5448,7 +5503,7 @@ static void pass() while (hw != NULL) { WITH1 = hw; if ((!WITH1->node->conflict1 || !WITH1->node->conflict2) && - WITH1->node->changed && hw != gg.movinghw) { + WITH1->node->changed && hw != gg.movinghw) { hidecursor_hook(); m_color(glowcol(hw->node, (long)gg.color.wire[hw->wcolr - log_wcol_normal])); @@ -5461,7 +5516,7 @@ static void pass() while (vw != NULL) { WITH2 = vw; if ((!WITH2->node->conflict1 || !WITH2->node->conflict2) && - WITH2->node->changed && vw != gg.movingvw) { + WITH2->node->changed && vw != gg.movingvw) { hidecursor_hook(); m_color(glowcol(vw->node, (long)gg.color.wire[vw->wcolr - log_wcol_normal])); @@ -5476,11 +5531,11 @@ static void pass() WITH3 = s; n = WITH3->hwire->node; if ((!n->conflict1 || !n->conflict2) && n->changed && - WITH3->hwire != gg.movinghw && WITH3->vwire != gg.movingvw) { - hidecursor_hook(); - drawsolderc(WITH3->x, WITH3->y, + WITH3->hwire != gg.movinghw && WITH3->vwire != gg.movingvw) { + hidecursor_hook(); + drawsolderc(WITH3->x, WITH3->y, (int)glowcol(n, (long)gg.color.solder)); - flag = true; + flag = true; } s = WITH3->next; } @@ -5791,8 +5846,8 @@ log_grec **g; (*g)->next = gg.gbase[gg.curpage - 1]; gg.gbase[gg.curpage - 1] = *g; chpageplace((int)gg.curpage, (*g)->x - (*g)->kind->bbmax, - (*g)->y - (*g)->kind->bbmax, (*g)->x + (*g)->kind->bbmax, - (*g)->y + (*g)->kind->bbmax); + (*g)->y - (*g)->kind->bbmax, (*g)->x + (*g)->kind->bbmax, + (*g)->y + (*g)->kind->bbmax); } @@ -6028,8 +6083,8 @@ log_grec **g; else g1->next = (*g)->next; chpageplace((int)gg.curpage, (*g)->x - (*g)->kind->bbmax, - (*g)->y - (*g)->kind->bbmax, (*g)->x + (*g)->kind->bbmax, - (*g)->y + (*g)->kind->bbmax); + (*g)->y - (*g)->kind->bbmax, (*g)->x + (*g)->kind->bbmax, + (*g)->y + (*g)->kind->bbmax); } @@ -6320,14 +6375,14 @@ static void dumpconflicts() printf("Conflicts:\n"); while (n != NULL) { printf(" Conflict node %ld c=%c delay=%d oc=%c\n", - (long)n, n->conflict ? 'T' : 'F', - 3 - n->conflict - n->conflict2 * 2, n->oconflict ? 'T' : 'F'); + (long)n, n->conflict ? 'T' : 'F', + 3 - n->conflict - n->conflict2 * 2, n->oconflict ? 'T' : 'F'); n = n->confnext; } while (g != NULL) { printf(" Conflict gate %ld c=%c delay=%d oc=%c\n", - (long)g, g->conflict ? 'T' : 'F', - 3 - g->conflict - g->conflict2 * 2, g->oconflict ? 'T' : 'F'); + (long)g, g->conflict ? 'T' : 'F', + 3 - g->conflict - g->conflict2 * 2, g->oconflict ? 'T' : 'F'); g = g->confnext; } } else @@ -6351,7 +6406,7 @@ log_nrec *old, **n; **n = *old; (*n)->ref = 0; copyattrs(&(*n)->attr, old->attr, (*n)->simtype->nnumattrs, - (*n)->simtype->nattr); + (*n)->simtype->nattr); gg.actnode2 = old; calltoolnode(*n, act_copynode); (*n)->next = gg.nbase; @@ -6532,7 +6587,7 @@ static void purgesignaltab() gg.signaltab[g->sig - 1].f = true; g = g->next; } - } + } if (histtrig != 0) gg.signaltab[histtrig - 1].f = true; @@ -6665,7 +6720,7 @@ char *n_; i = 1; while (i <= gg.lastsignal && (gg.signaltab[i - 1].name == NULL || - strcmp(gg.signaltab[i - 1].name, n))) + strcmp(gg.signaltab[i - 1].name, n))) i++; if (i > gg.lastsignal) { stamp(&gg.sigstamp); @@ -6884,7 +6939,7 @@ static void dumpnodes() while (j == i && n != NULL) { i++; fprintf(tracefile, "%12ld T:%s Ref:%d", - (long)n, n->simtype->name, n->ref); + (long)n, n->simtype->name, n->ref); FORLIM = gg.lastsignal; for (j = 0; j < FORLIM; j++) { if (gg.signaltab[j].np == n) @@ -6922,8 +6977,8 @@ static void dumpnodes() TRY(try8); while (hw != NULL) { fprintf(tracefile, "%12ld X1:%4d X2:%4d Y:%4d N:%ld C:%s\n", - (long)hw, hw->x1, hw->x2, hw->y, (long)hw->node, - colorname(STR3, hw->wcolr)); + (long)hw, hw->x1, hw->x2, hw->y, (long)hw->node, + colorname(STR3, hw->wcolr)); hw = hw->next; } RECOVER(try8); @@ -6937,8 +6992,8 @@ static void dumpnodes() TRY(try9); while (vw != NULL) { fprintf(tracefile, "%12ld X:%4d Y1:%4d Y2:%4d N:%ld C:%s\n", - (long)vw, vw->x, vw->y1, vw->y2, (long)vw->node, - colorname(STR3, vw->wcolr)); + (long)vw, vw->x, vw->y1, vw->y2, (long)vw->node, + colorname(STR3, vw->wcolr)); vw = vw->next; } RECOVER(try9); @@ -6952,7 +7007,7 @@ static void dumpnodes() TRY(try10); while (s != NULL) { fprintf(tracefile, "%12ld X:%4d Y:%4d HW: %ld,%ld", - (long)s, s->x, s->y, (long)s->hwire, (long)s->hwire2); + (long)s, s->x, s->y, (long)s->hwire, (long)s->hwire2); if (s->hwire == NULL) fprintf(tracefile, " "); fprintf(tracefile, " VW: %ld,%ld\n", (long)s->vwire, (long)s->vwire2); @@ -6969,8 +7024,8 @@ static void dumpnodes() TRY(try11); while (g != NULL) { fprintf(tracefile, "%12ld G:%3d X:%4d Y:%4d T:%s %s\n", - (long)g, g->g, g->x, g->y, g->kind->simtype->name, - g->kind->name); + (long)g, g->g, g->x, g->y, g->kind->simtype->name, + g->kind->name); WITH = g->kind; FORLIM = WITH->numpins; for (i = 0; i < FORLIM; i++) { @@ -6980,7 +7035,7 @@ static void dumpnodes() fprintf(tracefile, " [%d]", g->pin[i]->ref); RECOVER(try12); if (P_escapecode == -20) - goto _Ltry11; + goto _Ltry11; ENDTRY(try12); putc('\n', tracefile); } @@ -7018,10 +7073,10 @@ static void dumpnodes() static void gethelp(s) char *s; -{ +{ char cmdline[256]; char *pager; - + vmessage("Starting an xterm for help"); pager = getenv("PAGER"); @@ -7332,7 +7387,7 @@ static void doimmedcnffunction() if (gg.fastrate < 1) gg.fastrate = 1; sprintf(STR1, "Response: min=%ld, max=%ld, rate=%ld", - gg.fastmin, gg.fastmax, gg.fastrate); + gg.fastmin, gg.fastmax, gg.fastrate); vmessage(STR1); clearfunc(); return; @@ -7481,7 +7536,7 @@ static void doimmedfunction() if (gg.curpage > 1) newpage((int)(gg.curpage - 1)); } else if (strlen(gg.funcarg) == 1 && gg.funcarg[0] >= '1' && - gg.funcarg[0] <= '9') + gg.funcarg[0] <= '9') newpage(gg.funcarg[0] - 48); refrfunc(); return; @@ -7677,9 +7732,9 @@ short x, y; gg.nearlabel = gg.lbase[gg.curpage - 1]; while (gg.nearlabel != NULL && (x < gg.nearlabel->x || - x > gg.nearlabel->x + m_strwidth(logfont_lfont, - gg.nearlabel->name) / gg.scale || - y < gg.nearlabel->y || y > gg.nearlabel->y + 2)) { + x > gg.nearlabel->x + m_strwidth(logfont_lfont, + gg.nearlabel->name) / gg.scale || + y < gg.nearlabel->y || y > gg.nearlabel->y + 2)) { /* p2c: log.text, line 7262: * Warning: Symbol 'LOGFONT_LFONT' is not defined [221] */ gg.nearlabel = gg.nearlabel->next; @@ -7694,9 +7749,9 @@ short x, y; gg.nearbox = gg.bbase[gg.curpage - 1]; while (gg.nearbox != NULL && ((x != gg.nearbox->x1 && x != gg.nearbox->x2 && - y != gg.nearbox->y1 && - y != gg.nearbox->y2) || x < gg.nearbox->x1 || - x > gg.nearbox->x2 || y < gg.nearbox->y1 || y > gg.nearbox->y2)) + y != gg.nearbox->y1 && + y != gg.nearbox->y2) || x < gg.nearbox->x1 || + x > gg.nearbox->x2 || y < gg.nearbox->y1 || y > gg.nearbox->y2)) gg.nearbox = gg.nearbox->next; } else gg.nearbox = NULL; @@ -7900,12 +7955,12 @@ log_nrec *oldnode, *n; while (g != NULL) { if (abs(g->y - hw->y) <= g->kind->bbmax && P_ibetweenm((long)hw->x1, (long)g->x, (long)hw->x2, - (long)g->kind->bbmax)) { + (long)g->kind->bbmax)) { FORLIM = g->kind->numpins; for (i = 1; i <= FORLIM; i++) { px = g->pinpos[i - 1].x; if (hw->x1 <= px && px <= hw->x2 && g->pinpos[i - 1].y == hw->y && - g->pin[i - 1] == oldnode) + g->pin[i - 1] == oldnode) chggate(g, i, oldnode, n); } } @@ -7963,12 +8018,12 @@ log_nrec *oldnode, *n; while (g != NULL) { if (abs(g->x - vw->x) <= g->kind->bbmax && P_ibetweenm((long)vw->y1, (long)g->y, (long)vw->y2, - (long)g->kind->bbmax)) { + (long)g->kind->bbmax)) { FORLIM = g->kind->numpins; for (i = 1; i <= FORLIM; i++) { py = g->pinpos[i - 1].y; if (vw->y1 <= py && py <= vw->y2 && g->pinpos[i - 1].x == vw->x && - g->pin[i - 1] == oldnode) + g->pin[i - 1] == oldnode) chggate(g, i, oldnode, n); } } @@ -8019,7 +8074,7 @@ log_nrec *oldnode, *n; if (gg.traceflag) fprintf(tracefile, "Change gate %ld pin %d to node %ld\n", - (long)g, i, (long)n); + (long)g, i, (long)n); j = i; do { if (g->pin[j - 1] == oldnode) { @@ -8043,12 +8098,12 @@ log_nrec *oldnode, *n; g1 = gg.gbase[gg.curpage - 1]; while (g1 != NULL) { if (g1 != g && P_imax2((long)abs(g1->x - x), (long)abs(g1->y - y)) <= - g1->kind->bbmax) { + g1->kind->bbmax) { FORLIM = g1->kind->numpins; for (k = 1; k <= FORLIM; k++) { - if (x == g1->pinpos[k - 1].x && y == g1->pinpos[k - 1].y && + if (x == g1->pinpos[k - 1].x && y == g1->pinpos[k - 1].y && g1->pin[k - 1] == oldnode) - chggate(g1, k, oldnode, n); + chggate(g1, k, oldnode, n); } } g1 = g1->next; @@ -8213,16 +8268,16 @@ log_hwrec *hw; while (g != NULL) { if (abs(g->y - hw->y) <= g->kind->bbmax && P_ibetweenm((long)hw->x1, (long)g->x, (long)hw->x2, - (long)g->kind->bbmax)) { + (long)g->kind->bbmax)) { FORLIM = g->kind->numpins; for (i = 1; i <= FORLIM; i++) { if (g->pin[i - 1] == oldnode) { x = g->pinpos[i - 1].x; y = g->pinpos[i - 1].y; if (hw->x1 <= x && x <= hw->x2 && y == hw->y) { - delgetnode(&savenode, &oldnode, &n); - if (n != oldnode) - chggate(g, i, oldnode, n); + delgetnode(&savenode, &oldnode, &n); + if (n != oldnode) + chggate(g, i, oldnode, n); } } } @@ -8296,16 +8351,16 @@ log_vwrec *vw; while (g != NULL) { if (abs(g->x - vw->x) <= g->kind->bbmax && P_ibetweenm((long)vw->y1, (long)g->y, (long)vw->y2, - (long)g->kind->bbmax)) { + (long)g->kind->bbmax)) { FORLIM = g->kind->numpins; for (i = 1; i <= FORLIM; i++) { if (g->pin[i - 1] == oldnode) { x = g->pinpos[i - 1].x; y = g->pinpos[i - 1].y; if (vw->y1 <= y && y <= vw->y2 && x == vw->x) { - delgetnode(&savenode, &oldnode, &n); - if (n != oldnode) - chggate(g, i, oldnode, n); + delgetnode(&savenode, &oldnode, &n); + if (n != oldnode) + chggate(g, i, oldnode, n); } } } @@ -8332,7 +8387,7 @@ log_nrec **oldnode, **savenode; if (gg.traceflag) fprintf(tracefile, "Change gate %ld pin %d from node %ld\n", - (long)g, i, (long)(*oldnode)); + (long)g, i, (long)(*oldnode)); x = g->pinpos[i - 1].x; y = g->pinpos[i - 1].y; hw = gg.hwbase[gg.curpage - 1]; @@ -8360,10 +8415,10 @@ log_nrec **oldnode, **savenode; FORLIM = g1->kind->numpins; for (j = 1; j <= FORLIM; j++) { if (x == g1->pinpos[j - 1].x && y == g1->pinpos[j - 1].y && - g1->pin[j - 1] == *oldnode) { + g1->pin[j - 1] == *oldnode) { delgetnode(savenode, oldnode, &n); if (n != *oldnode) - chggate(g1, j, *oldnode, n); + chggate(g1, j, *oldnode, n); } } } @@ -8457,7 +8512,7 @@ log_nrec *n; for (i = 0; i < FORLIM1; i++) { if (g->pin[i] == n) { if (g->kind->pin[i].s >= 8) - found = true; + found = true; } } g = g->next; @@ -8508,7 +8563,7 @@ cnrec *cnbase; if (gg.traceflag) fprintf(tracefile, "Combine node %ld into %ld\n", - (long)(*n1), (long)(*n2)); + (long)(*n1), (long)(*n2)); working(); if (*n2 == NULL) switchnode(n2, *n1); @@ -8521,12 +8576,12 @@ cnrec *cnbase; if (nn1->simtype != nn2->simtype) { if (nn1->simtype->simtype >= 8) { if (nn2->simtype->simtype >= 8) { - /* shouldn't happen */ - report(10, rtn); + /* shouldn't happen */ + report(10, rtn); } else { - n3 = nn1; - nn1 = nn2; - nn2 = n3; + n3 = nn1; + nn1 = nn2; + nn2 = n3; } } gg.actx = nn1->simtype->simtype; @@ -8545,21 +8600,21 @@ cnrec *cnbase; hw = gg.hwbase[pg]; while (hw != NULL) { if (hw->node == nn1) - switchnode(&hw->node, nn2); + switchnode(&hw->node, nn2); hw = hw->next; } vw = gg.vwbase[pg]; while (vw != NULL) { if (vw->node == nn1) - switchnode(&vw->node, nn2); + switchnode(&vw->node, nn2); vw = vw->next; } g = gg.gbase[pg]; while (g != NULL) { FORLIM1 = g->kind->numpins; for (i = 0; i < FORLIM1; i++) { - if (g->pin[i] == nn1) - switchnode(&g->pin[i], nn2); + if (g->pin[i] == nn1) + switchnode(&g->pin[i], nn2); } g = g->next; } @@ -8569,12 +8624,12 @@ cnrec *cnbase; if (gg.signaltab[i - 1].np == nn1) { switchnode(&gg.signaltab[i - 1].np, nn2); if (oldsimtype->simtype < 8 && newsimtype->simtype >= 8) { - hn = gg.hnbase; - while (hn != NULL) { - if (hn->sig == i) + hn = gg.hnbase; + while (hn != NULL) { + if (hn->sig == i) newattrs(&hn->attr, newsimtype->hnumattrs, newsimtype->hattr); - hn = hn->next; - } + hn = hn->next; + } } } } @@ -8611,7 +8666,7 @@ log_nrec **n, **n2; if (gg.traceflag) fprintf(tracefile, "Queue-combine, n = %ld, np -> %ld\n", - (long)(*n), (long)(*n2)); + (long)(*n), (long)(*n2)); if (*n == NULL) return; cn = (cnrec *)Malloc(sizeof(cnrec)); @@ -8650,7 +8705,7 @@ struct LOC_checkcombine *LINK; return; if (LINK->passcount == 2) { sprintf(STR1, "Tried to connect %s signal to %s", - newsimtype->shortname, LINK->cursimtype->shortname); + newsimtype->shortname, LINK->cursimtype->shortname); message(STR1); } LINK->good = false; @@ -8728,7 +8783,7 @@ cnrec **cnbase_; } if (gg.traceflag && *V.cnbase != NULL) fprintf(tracefile, "Check-combine (pass %d) finds %s\n", - V.passcount, V.good ? " TRUE" : "FALSE"); + V.passcount, V.good ? " TRUE" : "FALSE"); V.passcount++; } while (!(V.good || V.passcount > 2)); if (V.good) { @@ -9280,11 +9335,11 @@ log_grec *g; g1 = gg.gbase[gg.curpage - 1]; while (g1 != NULL && n1 == NULL) { if (g1 != g && P_imax2((long)abs(g1->x - xp), (long)abs(g1->y - yp)) <= - g1->kind->bbmax) { + g1->kind->bbmax) { FORLIM1 = g1->kind->numpins; for (j = 0; j < FORLIM1; j++) { if (g1->pinpos[j].x == xp && g1->pinpos[j].y == yp) - n1 = &g1->pin[j]; + n1 = &g1->pin[j]; } } g1 = g1->next; @@ -9510,7 +9565,7 @@ int cut, tap; while (s != NULL) { if (tap) found = ((s->hwire == gg.nearhw && s->hwire != NULL) || - (s->vwire == gg.nearvw && s->vwire != NULL)); + (s->vwire == gg.nearvw && s->vwire != NULL)); else found = (x1 <= s->x && s->x <= x2 && y1 <= s->y && s->y <= y2); if (found && @@ -9548,14 +9603,14 @@ int cut, tap; if (cut) { blbase = NULL; if (xx1 < x1) - addblobs(&blbase, xx1, yy1, x1, yy1); + addblobs(&blbase, xx1, yy1, x1, yy1); if (xx2 > x2) - addblobs(&blbase, x2, yy1, xx2, yy1); + addblobs(&blbase, x2, yy1, xx2, yy1); delhwire(hw); if (xx1 < x1) - addhwire(xx1, x1, yy1, hw2->wcolr); + addhwire(xx1, x1, yy1, hw2->wcolr); if (xx2 > x2) - addhwire(x2, xx2, yy1, hw2->wcolr); + addhwire(x2, xx2, yy1, hw2->wcolr); doblobs(blbase); dispblobs(&blbase); } @@ -9587,14 +9642,14 @@ int cut, tap; if (cut) { blbase = NULL; if (yy1 < y1) - addblobs(&blbase, xx1, y1, xx1, yy1); + addblobs(&blbase, xx1, y1, xx1, yy1); if (yy2 > y2) - addblobs(&blbase, xx1, yy2, xx1, y2); + addblobs(&blbase, xx1, yy2, xx1, y2); delvwire(vw); if (yy1 < y1) - addvwire(xx1, yy1, y1, vw2->wcolr); + addvwire(xx1, yy1, y1, vw2->wcolr); if (yy2 > y2) - addvwire(xx1, y2, yy2, vw2->wcolr); + addvwire(xx1, y2, yy2, vw2->wcolr); doblobs(blbase); dispblobs(&blbase); } @@ -9609,7 +9664,7 @@ int cut, tap; found = (l == gg.nearlabel); else { found = (x1 <= l->x + m_strwidth(logfont_lfont, l->name) / gg.scale && - l->x <= x2 && y1 <= l->y + 2 && l->y <= y2); + l->x <= x2 && y1 <= l->y + 2 && l->y <= y2); /* p2c: log.text, line 9208: * Warning: Symbol 'LOGFONT_LFONT' is not defined [221] */ } @@ -9726,7 +9781,7 @@ int first; trykbd(); pen(); } while (gg.gridx == *x2 && gg.gridy == *y2 && gg.t.depressed && - *gg.func == '\0'); + *gg.func == '\0'); m_colormode((long)m_xor); m_color((long)gg.color.select); if (flag) @@ -9950,7 +10005,7 @@ static void yardstick() trykbd(); pen(); } while (gg.gridx == x2 && gg.gridy == y2 && gg.t.depressed && - *gg.func == '\0'); + *gg.func == '\0'); showstick(x1, y1, x2, y2, (long)m_xor); scroll(); } while (gg.t.depressed && *gg.func == '\0'); @@ -9968,7 +10023,7 @@ static void yardstick() trykbd(); pen(); } while (gg.gridx == x2 && gg.gridy == y2 && gg.t.near_ && !gg.t.dn && - *gg.func == '\0'); + *gg.func == '\0'); showstick(x2 + x1, y2 + y1, x2, y2, (long)m_xor); scroll(); } while (!gg.t.dn && gg.t.near_ && *gg.func == '\0'); @@ -10102,7 +10157,7 @@ short x, y, g, sig, yy; g, sig, gg.color.signal); } else { udrawgatec((int)(x * gg.scale - gg.xoff), (int)(y * gg.scale - gg.yoff), - g, gg.color.gate); + g, gg.color.gate); if (zoom == 0 && kind[(g & (log_kindoffset - 1)) - 1]->bbmax <= maxsafescale) drawgatedotsc(x, y, g, gg.color.gatepin); @@ -10264,7 +10319,7 @@ long *count_; /* p2c: log.text, line 9887: * Warning: Symbol 'LOGFONT_LFONT' is not defined [221] */ m_drawstr((l->x + x) * gg.scale - gg.xoff, - (l->y + y) * gg.scale - gg.yoff + 2, logfont_lfont, l->name); + (l->y + y) * gg.scale - gg.yoff + 2, logfont_lfont, l->name); (*V.count)++; l = l->next; } @@ -10435,9 +10490,9 @@ long movemode; xorcopybuf(©buf, gg.posx, gg.posy, &max); while (gg.posx == gg.gridx && gg.posy == gg.gridy && !gg.t.dn && gg.stillnear && *gg.func == '\0') { - pass(); - trykbd(); - pen(); + pass(); + trykbd(); + pen(); } xorcopybuf(©buf, gg.posx, gg.posy, &max); xororiginal(); @@ -10452,7 +10507,7 @@ long movemode; trykbd(); pen(); if (gg.posx != gg.gridx || gg.posy != gg.gridy) - time = timers_sysclock(); + time = timers_sysclock(); } while (!(timers_sysclock() - time > 25 || smallbuf || gg.t.dn) && gg.stillnear && *gg.func == '\0'); xororiginal(); @@ -10464,9 +10519,9 @@ long movemode; xorcopybuf(©buf, gg.posx, gg.posy, &max); while (gg.posx == gg.gridx && gg.posy == gg.gridy && !gg.t.dn && gg.stillnear && *gg.func == '\0') { - pass(); - trykbd(); - pen(); + pass(); + trykbd(); + pen(); } xorcopybuf(©buf, gg.posx, gg.posy, &max); xororiginal(); @@ -10620,14 +10675,14 @@ static void OLDmovecommand() trykbd(); pen(); } while (gg.gridx == x1 && gg.gridy == y1 && gg.t.depressed && - *gg.func == '\0'); + *gg.func == '\0'); m_colormode((long)m_xor); m_color((long)gg.color.select); rect(gg.posx, gg.posy, x1, y1); m_colormode((long)m_normal); scroll(); } while ((gg.t.depressed || abs(x1 - gg.posx) < 2 || - abs(y1 - gg.posy) < 2) && *gg.func == '\0'); + abs(y1 - gg.posy) < 2) && *gg.func == '\0'); sortshints(&gg.posx, &x1); sortshints(&gg.posy, &y1); remcursor(); @@ -10676,7 +10731,7 @@ static void OLDmovecommand() xorcopybuf(&buf, gg.posx, gg.posy, &max); restorecursor(); while (gg.posx == gg.gridx && gg.posy == gg.gridy && !gg.t.dn && - gg.stillnear && *gg.func == '\0') { + gg.stillnear && *gg.func == '\0') { pass(); trykbd(); pen(); @@ -10738,7 +10793,7 @@ static void moveobject() gg.gridx = gg.posx; gg.gridy = gg.posy; if (gg.markers && ((gg.gridx == gg.markerx1 && gg.gridy == gg.markery1) || - (gg.gridx == gg.markerx2 && gg.gridy == gg.markery2))) { + (gg.gridx == gg.markerx2 && gg.gridy == gg.markery2))) { remcursor(); drawmarkersc(gg.color.backgr); gg.markers = false; @@ -10754,7 +10809,7 @@ static void moveobject() trykbd(); pen(); } while (gg.gridx == gg.posx && gg.gridy == gg.posy && gg.t.depressed && - strcmp(gg.func, "REFR")); + strcmp(gg.func, "REFR")); m_colormode((long)m_xor); drawmarkersc(gg.color.marker); m_colormode((long)m_normal); @@ -10803,7 +10858,7 @@ static void moveobject() trykbd(); pen(); } while (gg.gridx == gg.posx && gg.gridy == gg.posy && gg.t.depressed && - strcmp(gg.func, "REFR")); + strcmp(gg.func, "REFR")); clipon(); xorlabel(gg.posx + x1, gg.posy + y1, gg.nearlabel); clipoff(); @@ -10877,7 +10932,7 @@ static void moveobject() trykbd(); pen(); } while (gg.gridx == gg.posx && gg.gridy == gg.posy && gg.t.depressed && - strcmp(gg.func, "REFR")); + strcmp(gg.func, "REFR")); clipon(); m_colormode((long)m_xor); drawboxc0(hx1, vy1, hx2, vy2, gg.color.dashbox); @@ -10961,7 +11016,7 @@ static void moveobject() trykbd(); pen(); } while (gg.gridx == gg.posx && gg.gridy == gg.posy && gg.t.depressed && - strcmp(gg.func, "REFR")); + strcmp(gg.func, "REFR")); movexorgate(gg.posx + x1, gg.posy + y1, gtype, gg.neargate->sig, yy); scroll(); } while (gg.t.depressed); @@ -11085,7 +11140,7 @@ static void moveobject() trykbd(); pen(); } while (gg.gridx == gg.posx && gg.gridy == gg.posy && gg.t.depressed && - strcmp(gg.func, "REFR")); + strcmp(gg.func, "REFR")); clipon(); m_colormode((long)m_xor); if (gg.nearhw != NULL) { @@ -11124,7 +11179,7 @@ static void moveobject() if (blp->hw != NULL) { hw1 = gg.hwbase[gg.curpage - 1]; while (hw1 != NULL && - (hw1->node != blp->hw->node || + (hw1->node != blp->hw->node || !P_ibetween((long)hw1->x1, (long)vx, (long)hw1->x2) || !P_ibetween((long)vy1, (long)hw1->y, (long)vy2))) hw1 = hw1->next; @@ -11136,7 +11191,7 @@ static void moveobject() } else if (blp->vw != NULL) { vw1 = gg.vwbase[gg.curpage - 1]; while (vw1 != NULL && - (vw1->node != blp->vw->node || + (vw1->node != blp->vw->node || !P_ibetween((long)vw1->y1, (long)hy, (long)vw1->y2) || !P_ibetween((long)hx1, (long)vw1->x, (long)hx2))) vw1 = vw1->next; @@ -11257,7 +11312,7 @@ static void openhoriz() xorrect(gg.posx, gg.posy, x1, y1); scroll(); } while ((gg.t.depressed || x1 == gg.posx || y1 == gg.posy) && - *gg.func == '\0'); + *gg.func == '\0'); sortshints(&gg.posx, &x1); sortshints(&gg.posy, &y1); remcursor(); @@ -11267,56 +11322,56 @@ static void openhoriz() flag = false; while (vw != NULL) { if (vw->x > gg.posx && - ((vw->y1 < gg.posy && gg.posy < vw->y2) || - (vw->y1 < y1 && y1 < vw->y2))) - flag = true; + ((vw->y1 < gg.posy && gg.posy < vw->y2) || + (vw->y1 < y1 && y1 < vw->y2))) + flag = true; vw = vw->next; } if (!flag) { g = gg.gbase[gg.curpage - 1]; while (g != NULL) { - if (gg.posy <= g->y && g->y <= y1 && g->x >= gg.posx) - shiftgate(g, x1 - gg.posx, 0); - g = g->next; + if (gg.posy <= g->y && g->y <= y1 && g->x >= gg.posx) + shiftgate(g, x1 - gg.posx, 0); + g = g->next; } s = gg.sbase[gg.curpage - 1]; while (s != NULL) { - if (!vlsi && gg.posy <= s->vwire->y2 && s->vwire->y1 <= y1 && + if (!vlsi && gg.posy <= s->vwire->y2 && s->vwire->y1 <= y1 && s->vwire->x > gg.posx) - s->x += x1 - gg.posx; - s = s->next; + s->x += x1 - gg.posx; + s = s->next; } hw = gg.hwbase[gg.curpage - 1]; while (hw != NULL) { - if (gg.posy <= hw->y && hw->y <= y1) { - if (hw->x1 > gg.posx) + if (gg.posy <= hw->y && hw->y <= y1) { + if (hw->x1 > gg.posx) hw->x1 += x1 - gg.posx; - if (hw->x2 >= gg.posx) + if (hw->x2 >= gg.posx) hw->x2 += x1 - gg.posx; - } - hw = hw->next; + } + hw = hw->next; } vw = gg.vwbase[gg.curpage - 1]; while (vw != NULL) { - if (gg.posy <= vw->y2 && vw->y1 <= y1 && vw->x > gg.posx) - vw->x += x1 - gg.posx; - vw = vw->next; + if (gg.posy <= vw->y2 && vw->y1 <= y1 && vw->x > gg.posx) + vw->x += x1 - gg.posx; + vw = vw->next; } b = gg.bbase[gg.curpage - 1]; while (b != NULL) { - if (gg.posy <= b->y1 && b->y2 <= y1) { - if (b->x1 >= gg.posx) + if (gg.posy <= b->y1 && b->y2 <= y1) { + if (b->x1 >= gg.posx) b->x1 += x1 - gg.posx; - if (b->x2 >= gg.posx) + if (b->x2 >= gg.posx) b->x2 += x1 - gg.posx; - } - b = b->next; + } + b = b->next; } l = gg.lbase[gg.curpage - 1]; while (l != NULL) { - if (gg.posy <= l->y && l->y <= y1 && l->x >= gg.posx) - l->x += x1 - gg.posx; - l = l->next; + if (gg.posy <= l->y && l->y <= y1 && l->x >= gg.posx) + l->x += x1 - gg.posx; + l = l->next; } refrfunc(); scroll(); @@ -11402,7 +11457,7 @@ static void openvert() xorrect_(gg.posx, gg.posy, x1, y1); scroll(); } while ((gg.t.depressed || x1 == gg.posx || y1 == gg.posy) && - *gg.func == '\0'); + *gg.func == '\0'); sortshints(&gg.posx, &x1); sortshints(&gg.posy, &y1); remcursor(); @@ -11412,56 +11467,56 @@ static void openvert() flag = false; while (hw != NULL) { if (hw->y > gg.posy && - ((hw->x1 < gg.posx && gg.posx < hw->x2) || - (hw->x1 < x1 && x1 < hw->x2))) - flag = true; + ((hw->x1 < gg.posx && gg.posx < hw->x2) || + (hw->x1 < x1 && x1 < hw->x2))) + flag = true; hw = hw->next; } if (!flag) { g = gg.gbase[gg.curpage - 1]; while (g != NULL) { - if (gg.posx <= g->x && g->x <= x1 && g->y >= gg.posy) - shiftgate(g, 0, y1 - gg.posy); - g = g->next; + if (gg.posx <= g->x && g->x <= x1 && g->y >= gg.posy) + shiftgate(g, 0, y1 - gg.posy); + g = g->next; } s = gg.sbase[gg.curpage - 1]; while (s != NULL) { - if (!vlsi && gg.posx <= s->hwire->x2 && s->hwire->x1 <= x1 && + if (!vlsi && gg.posx <= s->hwire->x2 && s->hwire->x1 <= x1 && s->hwire->y > gg.posy) - s->y += y1 - gg.posy; - s = s->next; + s->y += y1 - gg.posy; + s = s->next; } vw = gg.vwbase[gg.curpage - 1]; while (vw != NULL) { - if (gg.posx <= vw->x && vw->x <= x1) { - if (vw->y1 > gg.posy) + if (gg.posx <= vw->x && vw->x <= x1) { + if (vw->y1 > gg.posy) vw->y1 += y1 - gg.posy; - if (vw->y2 >= gg.posy) + if (vw->y2 >= gg.posy) vw->y2 += y1 - gg.posy; - } - vw = vw->next; + } + vw = vw->next; } hw = gg.hwbase[gg.curpage - 1]; while (hw != NULL) { - if (gg.posx <= hw->x2 && hw->x1 <= x1 && hw->y > gg.posy) - hw->y += y1 - gg.posy; - hw = hw->next; + if (gg.posx <= hw->x2 && hw->x1 <= x1 && hw->y > gg.posy) + hw->y += y1 - gg.posy; + hw = hw->next; } b = gg.bbase[gg.curpage - 1]; while (b != NULL) { - if (gg.posx <= b->x1 && b->x2 <= x1) { - if (b->y1 >= gg.posy) + if (gg.posx <= b->x1 && b->x2 <= x1) { + if (b->y1 >= gg.posy) b->y1 += y1 - gg.posy; - if (b->y2 >= gg.posy) + if (b->y2 >= gg.posy) b->y2 += y1 - gg.posy; - } - b = b->next; + } + b = b->next; } l = gg.lbase[gg.curpage - 1]; while (l != NULL) { - if (gg.posx <= l->x && l->x <= x1 && l->y >= gg.posy) - l->y += y1 - gg.posy; - l = l->next; + if (gg.posx <= l->x && l->x <= x1 && l->y >= gg.posy) + l->y += y1 - gg.posy; + l = l->next; } refrfunc(); scroll(); @@ -11547,7 +11602,7 @@ static void closehoriz() xorrect__(gg.posx, gg.posy, x1, y1); scroll(); } while ((gg.t.depressed || x1 == gg.posx || y1 == gg.posy) && - *gg.func == '\0'); + *gg.func == '\0'); sortshints(&gg.posx, &x1); sortshints(&gg.posy, &y1); remcursor(); @@ -11557,104 +11612,104 @@ static void closehoriz() flag = false; while (vw != NULL) { if (vw->x >= gg.posx && - ((vw->y1 < gg.posy && gg.posy < vw->y2) || - (vw->y1 < y1 && y1 < vw->y2))) - flag = true; + ((vw->y1 < gg.posy && gg.posy < vw->y2) || + (vw->y1 < y1 && y1 < vw->y2))) + flag = true; vw = vw->next; } if (!flag) { g = gg.gbase[gg.curpage - 1]; while (g != NULL) { - g1 = g->next; - if (gg.posy <= g->y && g->y <= y1 && g->x >= gg.posx) { - if (g->x <= x1) + g1 = g->next; + if (gg.posy <= g->y && g->y <= y1 && g->x >= gg.posx) { + if (g->x <= x1) delgate(g); - else + else shiftgate(g, gg.posx - x1, 0); - } - g = g1; + } + g = g1; } s = gg.sbase[gg.curpage - 1]; while (s != NULL) { - s1 = s->next; - if (!vlsi && gg.posy <= s->vwire->y2 && s->vwire->y1 <= y1 && + s1 = s->next; + if (!vlsi && gg.posy <= s->vwire->y2 && s->vwire->y1 <= y1 && s->vwire->x >= gg.posx) { - if (s->vwire->x > x1) + if (s->vwire->x > x1) s->x += gg.posx - x1; - } - s = s1; + } + s = s1; } hw = gg.hwbase[gg.curpage - 1]; while (hw != NULL) { - hw1 = hw->next; - if (gg.posy <= hw->y && hw->y <= y1 && hw->x2 >= gg.posx) { - if (hw->x1 >= gg.posx && hw->x2 < x1) + hw1 = hw->next; + if (gg.posy <= hw->y && hw->y <= y1 && hw->x2 >= gg.posx) { + if (hw->x1 >= gg.posx && hw->x2 < x1) delhwire(hw); - } - hw = hw1; + } + hw = hw1; } vw = gg.vwbase[gg.curpage - 1]; while (vw != NULL) { - vw1 = vw->next; - if (gg.posy <= vw->y2 && vw->y1 <= y1 && vw->x >= gg.posx && + vw1 = vw->next; + if (gg.posy <= vw->y2 && vw->y1 <= y1 && vw->x >= gg.posx && vw->x <= x1) - delvwire(vw); - vw = vw1; + delvwire(vw); + vw = vw1; } hw = gg.hwbase[gg.curpage - 1]; while (hw != NULL) { - if (gg.posy <= hw->y && hw->y <= y1 && hw->x2 >= gg.posx) { - if (hw->x1 >= gg.posx) { + if (gg.posy <= hw->y && hw->y <= y1 && hw->x2 >= gg.posx) { + if (hw->x1 >= gg.posx) { if (hw->x1 < x1) hw->x1 = gg.posx; else { hw->x1 += gg.posx - x1; hw->x2 += gg.posx - x1; } - } else if (hw->x2 >= x1) + } else if (hw->x2 >= x1) hw->x2 += gg.posx - x1; - else if (hw->x2 >= gg.posx) + else if (hw->x2 >= gg.posx) hw->x2 = gg.posx; - } - hw = hw->next; + } + hw = hw->next; } vw = gg.vwbase[gg.curpage - 1]; while (vw != NULL) { - if (gg.posy <= vw->y2 && vw->y1 <= y1 && vw->x >= gg.posx) - vw->x += gg.posx - x1; - vw = vw->next; + if (gg.posy <= vw->y2 && vw->y1 <= y1 && vw->x >= gg.posx) + vw->x += gg.posx - x1; + vw = vw->next; } b = gg.bbase[gg.curpage - 1]; while (b != NULL) { - b1 = b->next; - if (gg.posy <= b->y1 && b->y2 <= y1) { - if (b->x1 >= x1) { + b1 = b->next; + if (gg.posy <= b->y1 && b->y2 <= y1) { + if (b->x1 >= x1) { b->x1 += gg.posx - x1; b->x2 += gg.posx - x1; - } else if (b->x1 >= gg.posx) { + } else if (b->x1 >= gg.posx) { if (b->x2 < x1) dispbox(&b); else { b->x1 = gg.posx; b->x2 += gg.posx - x1; } - } else if (b->x2 >= x1) + } else if (b->x2 >= x1) b->x2 += gg.posx - x1; - else if (b->x2 >= gg.posx) + else if (b->x2 >= gg.posx) b->x2 = gg.posx; - } - b = b1; + } + b = b1; } l = gg.lbase[gg.curpage - 1]; while (l != NULL) { - l1 = l->next; - if (gg.posy <= l->y && l->y <= y1 && l->x >= gg.posx) { - if (l->x + strlen(gg.nearlabel->name) * 7 / gg.scale <= x1) + l1 = l->next; + if (gg.posy <= l->y && l->y <= y1 && l->x >= gg.posx) { + if (l->x + strlen(gg.nearlabel->name) * 7 / gg.scale <= x1) displabel(&l); - else + else l->x += gg.posx - x1; - } - l = l1; + } + l = l1; } refrfunc(); scroll(); @@ -11740,7 +11795,7 @@ static void closevert() xorrect___(gg.posx, gg.posy, x1, y1); scroll(); } while ((gg.t.depressed || x1 == gg.posx || y1 == gg.posy) && - *gg.func == '\0'); + *gg.func == '\0'); sortshints(&gg.posx, &x1); sortshints(&gg.posy, &y1); remcursor(); @@ -11750,105 +11805,105 @@ static void closevert() flag = false; while (hw != NULL) { if (hw->y >= gg.posy && - ((hw->x1 < gg.posx && gg.posx < hw->x2) || - (hw->x1 < x1 && x1 < hw->x2))) - flag = true; + ((hw->x1 < gg.posx && gg.posx < hw->x2) || + (hw->x1 < x1 && x1 < hw->x2))) + flag = true; hw = hw->next; } if (!flag) { g = gg.gbase[gg.curpage - 1]; while (g != NULL) { - g1 = g->next; - if (gg.posx <= g->x && g->x <= x1 && g->y >= gg.posy) { - if (g->y <= y1) + g1 = g->next; + if (gg.posx <= g->x && g->x <= x1 && g->y >= gg.posy) { + if (g->y <= y1) delgate(g); - else + else shiftgate(g, 0, gg.posy - y1); - } - g = g1; + } + g = g1; } s = gg.sbase[gg.curpage - 1]; while (s != NULL) { - s1 = s->next; - if (!vlsi && gg.posx <= s->hwire->x2 && s->hwire->x1 <= x1 && + s1 = s->next; + if (!vlsi && gg.posx <= s->hwire->x2 && s->hwire->x1 <= x1 && s->hwire->y >= gg.posy) { - if (s->hwire->y > y1) + if (s->hwire->y > y1) s->y += gg.posy - y1; - } - s = s1; + } + s = s1; } vw = gg.vwbase[gg.curpage - 1]; while (vw != NULL) { - vw1 = vw->next; - if (gg.posx <= vw->x && vw->x <= x1 && vw->y2 >= gg.posy) { - if (vw->y1 >= gg.posy && vw->y2 < y1) + vw1 = vw->next; + if (gg.posx <= vw->x && vw->x <= x1 && vw->y2 >= gg.posy) { + if (vw->y1 >= gg.posy && vw->y2 < y1) delvwire(vw); - } - vw = vw1; + } + vw = vw1; } hw = gg.hwbase[gg.curpage - 1]; while (hw != NULL) { - hw1 = hw->next; - if (gg.posx <= hw->x2 && hw->x1 <= x1 && hw->y >= gg.posy && + hw1 = hw->next; + if (gg.posx <= hw->x2 && hw->x1 <= x1 && hw->y >= gg.posy && hw->y <= y1) - delhwire(hw); - hw = hw1; + delhwire(hw); + hw = hw1; } vw = gg.vwbase[gg.curpage - 1]; while (vw != NULL) { - if (gg.posx <= vw->x && vw->x <= x1 && vw->y2 >= gg.posy) { - if (vw->y1 >= gg.posy) { + if (gg.posx <= vw->x && vw->x <= x1 && vw->y2 >= gg.posy) { + if (vw->y1 >= gg.posy) { if (vw->y1 < y1) vw->y1 = gg.posy; else { vw->y1 += gg.posy - y1; vw->y2 += gg.posy - y1; } - } else if (vw->y2 >= y1) + } else if (vw->y2 >= y1) vw->y2 += gg.posy - y1; - else if (vw->y2 >= gg.posy) + else if (vw->y2 >= gg.posy) vw->y2 = gg.posy; - } - vw = vw->next; + } + vw = vw->next; } hw = gg.hwbase[gg.curpage - 1]; while (hw != NULL) { - if (gg.posx <= hw->x2 && hw->x1 <= x1 && hw->y >= gg.posy) - hw->y += gg.posy - y1; - hw = hw->next; + if (gg.posx <= hw->x2 && hw->x1 <= x1 && hw->y >= gg.posy) + hw->y += gg.posy - y1; + hw = hw->next; } b = gg.bbase[gg.curpage - 1]; while (b != NULL) { - b1 = b->next; - if (gg.posx <= b->x1 && b->x2 <= x1) { - if (b->y1 >= y1) { + b1 = b->next; + if (gg.posx <= b->x1 && b->x2 <= x1) { + if (b->y1 >= y1) { b->y1 += gg.posy - y1; b->y2 += gg.posy - y1; - } else if (b->y1 >= gg.posy) { + } else if (b->y1 >= gg.posy) { if (b->y2 < y1) dispbox(&b); else { b->y1 = gg.posy; b->y2 += gg.posy - y1; } - } else if (b->y2 >= y1) + } else if (b->y2 >= y1) b->y2 += gg.posy - y1; - else if (b->y2 >= gg.posy) + else if (b->y2 >= gg.posy) b->y2 = gg.posy; - } - b = b1; + } + b = b1; } l = gg.lbase[gg.curpage - 1]; while (l != NULL) { - l1 = l->next; - if (gg.posx <= l->x && l->y >= gg.posy && + l1 = l->next; + if (gg.posx <= l->x && l->y >= gg.posy && l->x + strlen(gg.nearlabel->name) * 7 / gg.scale <= x1) { - if (l->y <= y1) + if (l->y <= y1) displabel(&l); - else + else l->y += gg.posy - y1; - } - l = l1; + } + l = l1; } refrfunc(); scroll(); @@ -12141,7 +12196,7 @@ char *rec; if (!bigendian) { /* d.flag.i = reverse(d.flag.i); */ - d.flag = reverse(d.flag); + d.flag = reverse(d.flag); } d.xx1= rec[12]; d.yy1= rec[13]; @@ -12210,7 +12265,7 @@ int loadit; FORLIM1 = maxkinds; for (j = 1; j <= FORLIM1; j++) { if (kind[j - 1] != NULL && kind[j - 1]->code == i0) - i = j; + i = j; } goto _L1; } @@ -12230,20 +12285,20 @@ int loadit; i = libptr; do { if (i >= maxkinds) - i = 0; + i = 0; i++; flag = false; FORLIM1 = gg.numpages; for (j = 0; j < FORLIM1; j++) { - g = gg.gbase[j]; - while (g != NULL) { - flag = (flag || (g->g & (log_kindoffset - 1)) == i); - g = g->next; - } + g = gg.gbase[j]; + while (g != NULL) { + flag = (flag || (g->g & (log_kindoffset - 1)) == i); + g = g->next; + } } FORLIM1 = kindgroupsize; for (j = 0; j < FORLIM1; j++) - flag = (flag || (kindgroup[j] & (log_kindoffset - 1)) == i); + flag = (flag || (kindgroup[j] & (log_kindoffset - 1)) == i); } while (flag && i != libptr); if (flag) { beginerror(); @@ -12258,8 +12313,8 @@ int loadit; /* p2c: log.text, line 11958: * Note: Using % for possibly-negative arguments [317] */ udrawgatec((int)(((i - 1) % catwidth * 2 + 1) * gridcen), - (int)(((i - 1) / catwidth * 2 + 1) * gridcen), i, - gg.color.backgr); + (int)(((i - 1) / catwidth * 2 + 1) * gridcen), i, + gg.color.backgr); } TEMP = kind[i - 1]->code - 1; P_clrbits_B(loadedgates, TEMP, 0, 3); @@ -12284,8 +12339,8 @@ int loadit; TRY(try15); i00 = indexoffset[i0 - 1]; fseek(libf1[V.f - 1]->f, - (libfstart[V.f - 1] + (i00 - 1L) / 16 - 1) * sizeof(filerec), - 0); + (libfstart[V.f - 1] + (i00 - 1L) / 16 - 1) * sizeof(filerec), + 0); SETUPBUF(libf1[V.f - 1]->f, filerec); GET(libf1[V.f - 1]->f, filerec); WITH1 = readdesc((char*) &GETFBUF(libf1[V.f - 1]->f, filerec).b[16*((i00 - 1) & @@ -12333,16 +12388,16 @@ int loadit; bound(kind[i - 1], (long)WITH->x2, (long)WITH->y2, &V); if (WITH->numvects != 0) { if (WITH->flag.U3.expanded) { - tempvects = (log_vectorrec *) + tempvects = (log_vectorrec *) Malloc(WITH->numvects * sizeof(log_vectorrec) * 2); - j = 0; - curcol = '1'; - V.dist = 0; - V.p *= 4; - FORLIM1 = WITH->numvects; - for (j0 = 1; j0 <= FORLIM1; j0++) { - ch = (char)readnum(&V); - if (ch >= '1' && ch <= '7') { + j = 0; + curcol = '1'; + V.dist = 0; + V.p *= 4; + FORLIM1 = WITH->numvects; + for (j0 = 1; j0 <= FORLIM1; j0++) { + ch = (char)readnum(&V); + if (ch >= '1' && ch <= '7') { do { ch2 = ch; ch = (char)readnum(&V); @@ -12353,16 +12408,16 @@ int loadit; tempvects[j - 1].numcoords = 0; curcol = ch2; } - } - j++; - WITH2 = &tempvects[j - 1]; - WITH2->vkind = ch; - switch (ch) { - - case 'v': - case 'C': - case 'e': - case 'E': + } + j++; + WITH2 = &tempvects[j - 1]; + WITH2->vkind = ch; + switch (ch) { + + case 'v': + case 'C': + case 'e': + case 'E': WITH2->x1 = readcoord(&V); WITH2->y1 = readcoord(&V); WITH2->UU.U99.x2 = readcoord(&V); @@ -12370,10 +12425,10 @@ int loadit; WITH2->numcoords = 2; bound(kind[i - 1], (long)WITH2->x1, (long)WITH2->y1, &V); bound(kind[i - 1], (long)WITH2->UU.U99.x2, - (long)WITH2->UU.U99.y2, &V); + (long)WITH2->UU.U99.y2, &V); break; - case 'r': + case 'r': WITH2->x1 = readcoord(&V); WITH2->y1 = readcoord(&V); WITH2->UU.U99.x2 = readcoord(&V); @@ -12382,11 +12437,11 @@ int loadit; WITH2->numcoords = 2; bound(kind[i - 1], (long)WITH2->x1, (long)WITH2->y1, &V); bound(kind[i - 1], (long)WITH2->UU.U99.x2, - (long)WITH2->UU.U99.y2, &V); + (long)WITH2->UU.U99.y2, &V); break; - case 'F': - case 'c': + case 'F': + case 'c': WITH2->x1 = readcoord(&V); WITH2->y1 = readcoord(&V); WITH2->UU.U99.x2 = readcoord(&V); @@ -12398,14 +12453,14 @@ int loadit; WITH2->numcoords = 4; bound(kind[i - 1], (long)WITH2->x1, (long)WITH2->y1, &V); bound(kind[i - 1], (long)WITH2->UU.U99.x2, - (long)WITH2->UU.U99.y2, &V); + (long)WITH2->UU.U99.y2, &V); bound(kind[i - 1], (long)WITH2->UU.U99.x3, - (long)WITH2->UU.U99.y3, &V); + (long)WITH2->UU.U99.y3, &V); bound(kind[i - 1], (long)WITH2->UU.U99.x4, - (long)WITH2->UU.U99.y4, &V); + (long)WITH2->UU.U99.y4, &V); break; - case 'p': + case 'p': WITH2->UU.U98.num = readnum(&V); WITH2->x1 = readcoord(&V); WITH2->y1 = readcoord(&V); @@ -12413,7 +12468,7 @@ int loadit; bound(kind[i - 1], (long)WITH2->x1, (long)WITH2->y1, &V); break; - case 'b': + case 'b': WITH2->UU.U98.num = readnum(&V); WITH2->x1 = readcoord(&V); WITH2->y1 = readcoord(&V); @@ -12422,10 +12477,10 @@ int loadit; WITH2->numcoords = 2; bound(kind[i - 1], (long)WITH2->x1, (long)WITH2->y1, &V); bound(kind[i - 1], (long)WITH2->UU.U99.x2, - (long)WITH2->UU.U99.y2, &V); + (long)WITH2->UU.U99.y2, &V); break; - case 't': + case 't': WITH2->UU.U116.tsize = readnum(&V); WITH2->UU.U116.torg = readnum(&V) - 1; WITH2->x1 = readcoord(&V); @@ -12441,40 +12496,40 @@ int loadit; WITH2->UU.U116.sp = strdup(buf); break; - default: + default: j--; break; - } - } - WITH->numvects = j; - WITH->vector = (log_vectorrec *) + } + } + WITH->numvects = j; + WITH->vector = (log_vectorrec *) Malloc(WITH->numvects * sizeof(log_vectorrec)); - memmove((void *)WITH->vector, (void *)tempvects, - WITH->numvects * sizeof(log_vectorrec)); - while (V.dist < WITH->bigvectsize) - j0 = readnum(&V); - V.p /= 4; - Free(tempvects); + memmove((void *)WITH->vector, (void *)tempvects, + WITH->numvects * sizeof(log_vectorrec)); + while (V.dist < WITH->bigvectsize) + j0 = readnum(&V); + V.p /= 4; + Free(tempvects); } else { - WITH->vector = (log_vectorrec *) + WITH->vector = (log_vectorrec *) Malloc(WITH->numvects * sizeof(log_vectorrec)); - FORLIM1 = WITH->numvects; - for (j = 0; j < FORLIM1; j++) { - readint(&V); - WITH->vector[j].vkind = 'v'; - WITH->vector[j].numcoords = 2; - WITH->vector[j].x1 = GETFBUF(libf1[V.f - 1]->f, filerec).vec[V.p].x1; - WITH->vector[j].y1 = GETFBUF(libf1[V.f - 1]->f, filerec).vec[V.p].y1; - WITH->vector[j].UU.U99.x2 = + FORLIM1 = WITH->numvects; + for (j = 0; j < FORLIM1; j++) { + readint(&V); + WITH->vector[j].vkind = 'v'; + WITH->vector[j].numcoords = 2; + WITH->vector[j].x1 = GETFBUF(libf1[V.f - 1]->f, filerec).vec[V.p].x1; + WITH->vector[j].y1 = GETFBUF(libf1[V.f - 1]->f, filerec).vec[V.p].y1; + WITH->vector[j].UU.U99.x2 = GETFBUF(libf1[V.f - 1]->f, filerec).vec[V.p].x2; - WITH->vector[j].UU.U99.y2 = + WITH->vector[j].UU.U99.y2 = GETFBUF(libf1[V.f - 1]->f, filerec).vec[V.p].y2; - bound(kind[i - 1], (long)WITH->vector[j].x1, - (long)WITH->vector[j].y1, &V); - bound(kind[i - 1], (long)WITH->vector[j].UU.U99.x2, - (long)WITH->vector[j].UU.U99.y2, &V); - V.p++; - } + bound(kind[i - 1], (long)WITH->vector[j].x1, + (long)WITH->vector[j].y1, &V); + bound(kind[i - 1], (long)WITH->vector[j].UU.U99.x2, + (long)WITH->vector[j].UU.U99.y2, &V); + V.p++; + } } } if (WITH->numpins != 0) { @@ -12483,31 +12538,31 @@ int loadit; Malloc(WITH->numpins * sizeof(na_strlist_t *)); FORLIM1 = WITH->numpins; for (j = 0; j < FORLIM1; j++) { - readint(&V); - WITH->pin[j].x = GETFBUF(libf1[V.f - 1]->f, filerec).pin[V.p].x / - log_scale0; - WITH->pin[j].y = GETFBUF(libf1[V.f - 1]->f, filerec).pin[V.p].y / - log_scale0; - WITH->pin[j].s = GETFBUF(libf1[V.f - 1]->f, filerec).pin[V.p].s; - WITH->pin[j].c = GETFBUF(libf1[V.f - 1]->f, filerec).pin[V.p].c; - bound(kind[i - 1], (long)(WITH->pin[j].x * log_scale0), + readint(&V); + WITH->pin[j].x = GETFBUF(libf1[V.f - 1]->f, filerec).pin[V.p].x / + log_scale0; + WITH->pin[j].y = GETFBUF(libf1[V.f - 1]->f, filerec).pin[V.p].y / + log_scale0; + WITH->pin[j].s = GETFBUF(libf1[V.f - 1]->f, filerec).pin[V.p].s; + WITH->pin[j].c = GETFBUF(libf1[V.f - 1]->f, filerec).pin[V.p].c; + bound(kind[i - 1], (long)(WITH->pin[j].x * log_scale0), (long)(WITH->pin[j].y * log_scale0), &V); - WITH->pinnames[j] = NULL; - V.p++; + WITH->pinnames[j] = NULL; + V.p++; } } /* p2c: log.text, line 12164: Note: Can't interpret size in NA_NEW [174] */ if (WITH->numpnums != 0) { - WITH->pnum = (log_pnumrec *)Malloc(WITH->numpnums * + WITH->pnum = (log_pnumrec *)Malloc(WITH->numpnums * sizeof(log_pnumrec)); FORLIM1 = WITH->numpnums; for (j = 0; j < FORLIM1; j++) { - readint(&V); + readint(&V); WITH->pnum[j] = readpnum((char *) &GETFBUF(libf1[V.f - 1]->f, filerec).b [4*V.p]); - bound(kind[i - 1], (long)WITH->pnum[j].x, (long)WITH->pnum[j].y, + bound(kind[i - 1], (long)WITH->pnum[j].x, (long)WITH->pnum[j].y, &V); - V.p++; + V.p++; } } /* p2c: log.text, line 12180: Note: Can't interpret size in NA_NEW [174] */ @@ -12518,41 +12573,41 @@ int loadit; ch = '\001'; FORLIM2 = WITH->biglblsize / 4; for (j1 = 1; j1 <= FORLIM2; j1++) { - readint(&V); - for (j = 0; j <= 3; j++) { - if (ch != '\0') { + readint(&V); + for (j = 0; j <= 3; j++) { + if (ch != '\0') { ch = GETFBUF(libf1[V.f - 1]->f, filerec).c4[V.p][j]; if (ch == '\001') { if (*buf == '\002') { - j0 = 0; - while (*buf != '\0') { - if (buf[0] == '\002') + j0 = 0; + while (*buf != '\0') { + if (buf[0] == '\002') j0++; - strcpy_overlap(buf, buf + 1); - j00 = strposc(buf, '\002', 1L); - if (j00 == 0) + strcpy_overlap(buf, buf + 1); + j00 = strposc(buf, '\002', 1L); + if (j00 == 0) j00 = strlen(buf) + 1; - j000 = strposc(buf, '\003', 1L); - if (j000 == 0) + j000 = strposc(buf, '\003', 1L); + if (j000 == 0) j000 = strlen(buf) + 1; - j00 = P_imin2((long)j00, (long)j000); - if (j00 > 1) { + j00 = P_imin2((long)j00, (long)j000); + if (j00 > 1) { if (j0 <= WITH->numpins) { sprintf(STR1, "%.*s", j00 - 1, buf); l2 = strlist_append(&WITH->pinnames[j0 - 1], STR1); l2->value = (na_long)((long)j0); } - } - strcpy_overlap(buf, buf + j00 - 1); - } + } + strcpy_overlap(buf, buf + j00 - 1); + } } else - l2 = strlist_append(&WITH->lbl, buf); + l2 = strlist_append(&WITH->lbl, buf); *buf = '\0'; } else if (ch != '\0') sprintf(buf + strlen(buf), "%c", ch); - } - } - V.p++; + } + } + V.p++; } parselabel(&WITH->lbl, &j, &WITH->attr); WITH->numattrs = j; @@ -12561,11 +12616,11 @@ int loadit; WITH->proc = (uchar *)Malloc(WITH->bigprocsize); FORLIM2 = WITH->bigprocsize / 4; for (j1 = 1; j1 <= FORLIM2; j1++) { - readint(&V); - for (j0 = 0; j0 <= 3; j0++) - WITH->proc[j1 * 4 + j0 - 4] = GETFBUF(libf1[V.f - 1]->f, - filerec).c[V.p * 4 + j0]; - V.p++; + readint(&V); + for (j0 = 0; j0 <= 3; j0++) + WITH->proc[j1 * 4 + j0 - 4] = GETFBUF(libf1[V.f - 1]->f, + filerec).c[V.p * 4 + j0]; + V.p++; } } else { WITH->proc = (uchar *)Malloc(4L); @@ -12576,7 +12631,7 @@ int loadit; WITH->bbx2 = (log_scale0 + WITH->bbx2 - 1) / log_scale0; WITH->bby2 = (log_scale0 + WITH->bby2 - 1) / log_scale0; WITH->bbmax = P_imax2(P_imax2((long)(-WITH->bbx1), (long)WITH->bbx2), - P_imax2((long)(-WITH->bby1), (long)WITH->bby2)); + P_imax2((long)(-WITH->bby1), (long)WITH->bby2)); calltoolkind(kind[i - 1], act_newkind); P_putbits_UB(loadedgates, i0 - 1, 1, 0, 3); RECOVER(try15); @@ -12585,10 +12640,10 @@ int loadit; _Escape(P_escapecode); else { if (P_escapecode != 0) { - beginerror(); - printf("%d/%d/%ld: ", P_escapecode, i, EXCP_LINE); - printf("Unable to read file \"%s\"\n", gatesname[V.f - 1]); - enderror(); + beginerror(); + printf("%d/%d/%ld: ", P_escapecode, i, EXCP_LINE); + printf("Unable to read file \"%s\"\n", gatesname[V.f - 1]); + enderror(); } i = 0; goto _L1; @@ -12788,14 +12843,14 @@ log_grec *g; z = g->rot; WITH = g->kind; gx1 = gx + (WITH->x1 * log_rotxx[z] + WITH->y1 * log_rotyx[z]) * - gg.scale / log_scale0; + gg.scale / log_scale0; gx2 = gx + (WITH->x2 * log_rotxx[z] + WITH->y2 * log_rotyx[z]) * - gg.scale / log_scale0; + gg.scale / log_scale0; sortshints(&gx1, &gx2); gy1 = gy + (WITH->x1 * log_rotxy[z] + WITH->y1 * log_rotyy[z]) * - gg.scale / log_scale0; + gg.scale / log_scale0; gy2 = gy + (WITH->x2 * log_rotxy[z] + WITH->y2 * log_rotyy[z]) * - gg.scale / log_scale0; + gg.scale / log_scale0; sortshints(&gy1, &gy2); gx1 -= 2; gx2 += 2; @@ -13043,7 +13098,7 @@ static void listlibrary() if (librgroupnames[curlistgroup] != NULL && strlen(librgroupnames[curlistgroup]) <= txacross - 26) fputs(strcjust(STR1, librgroupnames[curlistgroup], txacross - 26L), - stdout); + stdout); else printf("%*c", txacross - 26, ' '); printf("Group%2d\n", curlistgroup); @@ -13080,14 +13135,14 @@ static void listlibrary() if (k < huge_) { lsp = findlibrstr(index_[k - 1]); if (lsp != NULL) { - nk_gotoxy(0, txdown - 1); - printf("%.*s", txacross, lsp->str); + nk_gotoxy(0, txdown - 1); + printf("%.*s", txacross, lsp->str); } } nk_gotoxy(i * 10 + 2, j + 1); if (k < huge_) { if (P_getbits_UB(loadedgates, k - 1, 0, 3)) - putchar(chryellow); + putchar(chryellow); printf("%c%s%c%c", chrinverse, index_[k - 1], chrgreen, chrplain); } } else { @@ -13125,12 +13180,12 @@ static void listlibrary() if (k > 0) { if (k < huge_) { if (lsp != NULL) { - nk_gotoxy(0, txdown - 1); - putchar('\t'); + nk_gotoxy(0, txdown - 1); + putchar('\t'); } nk_gotoxy(i * 10 + 2, j + 1); if (P_getbits_UB(loadedgates, k - 1, 0, 3)) - putchar(chryellow); + putchar(chryellow); printf("%s%c", index_[k - 1], chrgreen); } } else { @@ -13198,7 +13253,7 @@ static void listlibrary() /* p2c: log.text, line 12838: * Note: Using % for possibly-negative arguments [317] */ } else if (ch == '\003' || ch == '\015' || ch == 'Q' || ch == 'q' || - (ch & 255) == 171 || ch == ' ') + (ch & 255) == 171 || ch == ' ') exitflag = true; } while (!exitflag); clearscreen(); @@ -13258,8 +13313,8 @@ int librmode; *bot3 = '\0'; botflag = false; if ((unsigned)x0 < catwidth && y0 >= 0 && - y0 * catwidth + x0 < maxkinds && - gg.t.near_ && kind[y0 * catwidth + x0] != NULL) { + y0 * catwidth + x0 < maxkinds && + gg.t.near_ && kind[y0 * catwidth + x0] != NULL) { flag = true; nm[8] = '\0'; k = kind[y0 * catwidth + x0]; @@ -13271,10 +13326,10 @@ int librmode; y00 = (y0 + 1) * gridcen * 2 + 2; remcursor(); /* m_getcpicture(imax(x00-2,0), y00-2, x00+w+4, y00+10, pic); - m_color(gg.color.backgr); - m_fillrect(x00-2, y00-2, x00+w+4, y00+10); - m_color(gg.color.selword); - m_centerstr((x0*2+1)*gridcen, y00, logfont_lfont, nm);*/ + m_color(gg.color.backgr); + m_fillrect(x00-2, y00-2, x00+w+4, y00+10); + m_color(gg.color.selword); + m_centerstr((x0*2+1)*gridcen, y00, logfont_lfont, nm);*/ m_colormode((long)m_xor); m_color((long)gg.color.selword); /* p2c: log.text, line 12914: @@ -13283,20 +13338,20 @@ int librmode; m_colormode((long)m_normal); lp = k->lbl; while (lp != NULL && lp->kind != '\0') - lp = lp->next; + lp = lp->next; while (lp != NULL && *bot3 == '\0') { - if (*bot1 == '\0') - strcpy(bot1, lp->s); - else if (*bot2 == '\0') - strcpy(bot2, lp->s); - else if (*bot3 == '\0') - strcpy(bot3, lp->s); - lp = lp->next; + if (*bot1 == '\0') + strcpy(bot1, lp->s); + else if (*bot2 == '\0') + strcpy(bot2, lp->s); + else if (*bot3 == '\0') + strcpy(bot3, lp->s); + lp = lp->next; } if (*bot1 == '\0') { - lsp = findlibrstr(k->name); - if (lsp != NULL) - strcpy(bot1, lsp->str); + lsp = findlibrstr(k->name); + if (lsp != NULL) + strcpy(bot1, lsp->str); } bottime = timers_sysclock(); } else @@ -13307,27 +13362,27 @@ int librmode; pass(); pen(); if (*bot1 != '\0' && !botflag) { - if (labs(x - gg.t.x) > 10 || labs(y - gg.t.y) > 10) - bottime = timers_sysclock(); - else if (timers_sysclock() > bottime + 10) { - m_color((long)gg.color.selword); - m_centerstr(across / 2L, down - 27L, NULL, bot1); - if (*bot2 != '\0') + if (labs(x - gg.t.x) > 10 || labs(y - gg.t.y) > 10) + bottime = timers_sysclock(); + else if (timers_sysclock() > bottime + 10) { + m_color((long)gg.color.selword); + m_centerstr(across / 2L, down - 27L, NULL, bot1); + if (*bot2 != '\0') m_centerstr(across / 2L, down - 17L, NULL, bot2); - if (*bot3 != '\0') + if (*bot3 != '\0') m_centerstr(across / 2L, down - 7L, NULL, bot3); - botflag = true; - } + botflag = true; + } } if (pollkbd2()) - ch = inkey2(); + ch = inkey2(); x1 = gg.t.x / (gridcen * 2); y1 = gg.t.y / (gridcen * 2); } while (!gg.t.dn && gg.t.near_ && x0 == x1 && y0 == y1 && ch == '\0'); if (flag) { remcursor(); /* m_putcpicture(imax(x00-2,0), y00-2, pic); - m_disposepicture(pic); */ + m_disposepicture(pic); */ m_colormode((long)m_xor); m_color((long)gg.color.selword); /* p2c: log.text, line 12972: @@ -13336,18 +13391,18 @@ int librmode; m_colormode((long)m_normal); m_color((long)gg.color.backgr); if (botflag) { - m_centerstr(across / 2L, down - 27L, NULL, bot1); - if (*bot2 != '\0') - m_centerstr(across / 2L, down - 17L, NULL, bot2); - if (*bot3 != '\0') - m_centerstr(across / 2L, down - 7L, NULL, bot3); + m_centerstr(across / 2L, down - 27L, NULL, bot1); + if (*bot2 != '\0') + m_centerstr(across / 2L, down - 17L, NULL, bot2); + if (*bot3 != '\0') + m_centerstr(across / 2L, down - 7L, NULL, bot3); } } if (gg.t.dn) { if ((x < 40 || x >= across - 37) && y >= down - 32) - librmode = true; + librmode = true; else - done = true; + done = true; } if (ch == 251 || ch == 250 || ch == ' ') { /* p2c: log.text, line 12989: Note: Character >= 128 encountered [281] */ @@ -13359,9 +13414,9 @@ int librmode; librmode = true; else if (ch == 'D' || ch == 'd') { if ((unsigned)x0 < catwidth && y0 >= 0 && - y0 * catwidth + x0 < maxkinds && - gg.t.near_ && kind[y0 * catwidth + x0] != NULL) - showgatedef(kind[y0 * catwidth + x0], NULL); + y0 * catwidth + x0 < maxkinds && + gg.t.near_ && kind[y0 * catwidth + x0] != NULL) + showgatedef(kind[y0 * catwidth + x0], NULL); } } while (!(done || librmode || refrflag)); oo = gg.t.off; @@ -13525,7 +13580,7 @@ int mu; strcpy(s, "G"); r /= 1e9; } else if (fabs(r) >= 1e6) { - strcpy(s, "Meg"); + strcpy(s, "Meg"); r /= 1e6; } else if (fabs(r) >= 1e3) { strcpy(s, "K"); @@ -13550,7 +13605,7 @@ int mu; } sprintf(s, "%s%s", realstr(STR1, r, p), strcpy(STR2, s)); sprintf(Result, "%s%s", s, u); -/* zfprintf(stdout, "realunit Result: %s\n", Result); ***MDG** */ +/* zfprintf(stdout, "realunit Result: %s\n", Result); ***MDG** */ return Result; } @@ -13661,13 +13716,13 @@ struct LOC_editattrs *LINK; case 'U': fputs(realunit(STR1, LINK->gattr[i - 1].UU.r, WITH->prec, - WITH->UU.U82.u, false), stdout); + WITH->UU.U82.u, false), stdout); break; case 'F': printf("%s%s", - realstr(STR1, LINK->gattr[i - 1].UU.r, WITH->prec), - WITH->UU.U82.u); + realstr(STR1, LINK->gattr[i - 1].UU.r, WITH->prec), + WITH->UU.U82.u); break; case 'I': @@ -13676,7 +13731,7 @@ struct LOC_editattrs *LINK; case 'H': fputs(strhex(STR4, LINK->gattr[i - 1].UU.U73.i1, (long)WITH->prec), - stdout); + stdout); break; case 'C': @@ -13832,7 +13887,7 @@ struct LOC_editattrs *LINK; static void editattrs(gattr_, numattrs_, kattr_, lbl_, name_, proc, chproc_, - relproc, attrstamp) + relproc, attrstamp) log_gattrrec *gattr_; short numattrs_; log_kattrrec *kattr_; @@ -13916,11 +13971,11 @@ long *attrstamp; if (V.kattr[V.p - 1].y <= V.ybase) { V.ybase = V.kattr[V.p - 1].y - 1; if (V.p == 1) - V.ybase = P_imax2(0L, (long)(V.kattr[V.p - 1].y - txdown)); + V.ybase = P_imax2(0L, (long)(V.kattr[V.p - 1].y - txdown)); } else { V.ybase = V.kattr[V.p - 1].y - txdown + 1; if (V.p == V.numattrs) - V.ybase = P_imin2(ytotal - txdown - 1L, (long)V.kattr[V.p - 1].y); + V.ybase = P_imin2(ytotal - txdown - 1L, (long)V.kattr[V.p - 1].y); } if (abs(V.ybase - i1) < txdown) nc_scrollXY(0, V.ybase - i1); @@ -13934,7 +13989,7 @@ long *attrstamp; FORLIM = V.numattrs; for (i = 1; i <= FORLIM; i++) { if (!V.gattr[i - 1].supr) - drawvalue(i, i == V.p, &V); + drawvalue(i, i == V.p, &V); } } else drawvalue(V.p, true, &V); @@ -13946,29 +14001,29 @@ long *attrstamp; FORLIM = V.numattrs; for (i = 1; i <= FORLIM; i++) { if (V.gattr[i - 1].changed) { - stamp(attrstamp); - if (!V.gattr[i - 1].supr) { - drawvalue(i, i == V.p, &V); - if (V.kattr[i - 1].dtype == 'V') + stamp(attrstamp); + if (!V.gattr[i - 1].supr) { + drawvalue(i, i == V.p, &V); + if (V.kattr[i - 1].dtype == 'V') maskvalues(&V); - if (V.gattr[V.p - 1].supr) + if (V.gattr[V.p - 1].supr) ch = '\037'; - noblink(); - } + noblink(); + } } } pen(); /* if gg.t.near and (gg.t.ay <> olday) then - begin - i := 1; - while (i <= numattrs) and (kattr^[i].y <> gg.t.ay) do - i := i + 1; - if (i <= numattrs) and (not gattr^[i].supr) then - if i < p then - ch := #31 - else if i > p then - ch := #10; - end; */ + begin + i := 1; + while (i <= numattrs) and (kattr^[i].y <> gg.t.ay) do + i := i + 1; + if (i <= numattrs) and (not gattr^[i].supr) then + if i < p then + ch := #31 + else if i > p then + ch := #10; + end; */ if (pollkbd2()) ch = inkey2(); } while (!(ch != '\0' || gg.t.dn)); @@ -13983,27 +14038,27 @@ long *attrstamp; else if ((ch & 255) != 251 && (ch & 255) != 250) { if (ch == '\n') { do { - V.p++; + V.p++; } while (V.p <= V.numattrs && V.gattr[V.p - 1].supr); if (V.p > V.numattrs) - V.p = p0; + V.p = p0; } else if (ch == '\037') { do { - V.p--; + V.p--; } while (V.p >= 1 && V.gattr[V.p - 1].supr); if (V.p < 1) /*should never happen!*/ - V.p = p0; + V.p = p0; } else if (ch == '\034') { gg.actflag = false; gg.actflag2 = true; callconfig(relproc, &V); if (!gg.actflag) { - switch (V.kattr[V.p - 1].dtype) { + switch (V.kattr[V.p - 1].dtype) { - case 'R': - case 'U': - case 'F': - if (!WITH->blnk) { + case 'R': + case 'U': + case 'F': + if (!WITH->blnk) { r1 = scrnincr(V.p, &V); saver = WITH->UU.r; WITH->UU.r = cleanup(WITH->UU.r + r1, r1, &V); @@ -14012,54 +14067,54 @@ long *attrstamp; touched = true; } else WITH->UU.r = saver; - } - break; + } + break; - case 'I': - case 'H': - if (!WITH->blnk) { + case 'I': + case 'H': + if (!WITH->blnk) { WITH->UU.U73.i1++; if (tryconfig(&V)) { drawvalue(V.p, false, &V); touched = true; } else WITH->UU.U73.i1--; - } - break; - - case 'C': - case 'A': - understood = false; - break; - - case 'B': - saveb = WITH->UU.b; - saveb2 = WITH->blnk; - WITH->UU.b = true; - WITH->blnk = false; - if (!tryconfig(&V)) { + } + break; + + case 'C': + case 'A': + understood = false; + break; + + case 'B': + saveb = WITH->UU.b; + saveb2 = WITH->blnk; + WITH->UU.b = true; + WITH->blnk = false; + if (!tryconfig(&V)) { WITH->UU.b = saveb; WITH->blnk = saveb2; - } - if (WITH->UU.b != saveb || WITH->blnk != saveb2) { + } + if (WITH->UU.b != saveb || WITH->blnk != saveb2) { drawvalue(V.p, false, &V); touched = true; - } - break; + } + break; - case 'V': - savei = WITH->UU.nv; - if (WITH->UU.nv < V.kattr[V.p - 1].UU.U86.nv - 1) + case 'V': + savei = WITH->UU.nv; + if (WITH->UU.nv < V.kattr[V.p - 1].UU.U86.nv - 1) WITH->UU.nv++; - if (!tryconfig(&V)) + if (!tryconfig(&V)) WITH->UU.nv = savei; - if (WITH->UU.nv != savei) { + if (WITH->UU.nv != savei) { maskvalues(&V); drawvalue(V.p, false, &V); touched = true; - } - break; - } + } + break; + } } stamp(attrstamp); chpage((int)gg.curpage); @@ -14068,12 +14123,12 @@ long *attrstamp; gg.actflag2 = false; callconfig(relproc, &V); if (!gg.actflag) { - switch (V.kattr[V.p - 1].dtype) { + switch (V.kattr[V.p - 1].dtype) { - case 'R': - case 'U': - case 'F': - if (!WITH->blnk) { + case 'R': + case 'U': + case 'F': + if (!WITH->blnk) { r1 = scrnincr(V.p, &V); saver = WITH->UU.r; WITH->UU.r = cleanup(WITH->UU.r - r1, r1, &V); @@ -14082,54 +14137,54 @@ long *attrstamp; touched = true; } else WITH->UU.r = saver; - } - break; + } + break; - case 'I': - case 'H': - if (!WITH->blnk) { + case 'I': + case 'H': + if (!WITH->blnk) { WITH->UU.U73.i1--; if (tryconfig(&V)) { drawvalue(V.p, false, &V); touched = true; } else WITH->UU.U73.i1++; - } - break; - - case 'C': - case 'A': - understood = false; - break; - - case 'B': - saveb = WITH->UU.b; - saveb2 = WITH->blnk; - WITH->UU.b = false; - WITH->blnk = false; - if (!tryconfig(&V)) { + } + break; + + case 'C': + case 'A': + understood = false; + break; + + case 'B': + saveb = WITH->UU.b; + saveb2 = WITH->blnk; + WITH->UU.b = false; + WITH->blnk = false; + if (!tryconfig(&V)) { WITH->UU.b = saveb; WITH->blnk = saveb2; - } - if (WITH->UU.b != saveb || WITH->blnk != saveb2) { + } + if (WITH->UU.b != saveb || WITH->blnk != saveb2) { drawvalue(V.p, false, &V); touched = true; - } - break; + } + break; - case 'V': - savei = WITH->UU.nv; - if (WITH->UU.nv > 0) + case 'V': + savei = WITH->UU.nv; + if (WITH->UU.nv > 0) WITH->UU.nv--; - if (!tryconfig(&V)) + if (!tryconfig(&V)) WITH->UU.nv = savei; - if (WITH->UU.nv != savei) { + if (WITH->UU.nv != savei) { maskvalues(&V); drawvalue(V.p, false, &V); touched = true; - } - break; - } + } + break; + } } stamp(attrstamp); chpage((int)gg.curpage); @@ -14155,31 +14210,31 @@ long *attrstamp; saveb = WITH->blnk; saver = WITH->UU.r; if (*buf == '\0' || - !(buf[0] == '-' || buf[0] == '+' || buf[0] == '.' || + !(buf[0] == '-' || buf[0] == '+' || buf[0] == '.' || isdigit(buf[0]))) { - if (V.kattr[V.p - 1].opt) - WITH->blnk = true; - else { - WITH->blnk = false; - WITH->UU.r = V.kattr[V.p - 1].UU.U82.r; - } - touched = true; + if (V.kattr[V.p - 1].opt) + WITH->blnk = true; + else { + WITH->blnk = false; + WITH->UU.r = V.kattr[V.p - 1].UU.U82.r; + } + touched = true; } else { - TRY(try16); - readreal(buf, &r1); - WITH->UU.r = r1; - WITH->blnk = false; - touched = true; - RECOVER(try16); - if (P_escapecode == -20) + TRY(try16); + readreal(buf, &r1); + WITH->UU.r = r1; + WITH->blnk = false; + touched = true; + RECOVER(try16); + if (P_escapecode == -20) _Escape(P_escapecode); - warning(); - ENDTRY(try16); + warning(); + ENDTRY(try16); } if (!tryconfig(&V)) { - WITH->UU.r = saver; - WITH->blnk = saveb; - touched = saveb2; + WITH->UU.r = saver; + WITH->blnk = saveb; + touched = saveb2; } break; @@ -14191,31 +14246,31 @@ long *attrstamp; saveb = WITH->blnk; savei = WITH->UU.U73.i1; if (*buf == '\0' || - !(buf[0] == '+' || buf[0] == '-' || isdigit(buf[0]))) { - if (V.kattr[V.p - 1].opt) - WITH->blnk = true; - else { - WITH->blnk = false; - WITH->UU.U73.i1 = V.kattr[V.p - 1].UU.U73.i1; - } - touched = true; + !(buf[0] == '+' || buf[0] == '-' || isdigit(buf[0]))) { + if (V.kattr[V.p - 1].opt) + WITH->blnk = true; + else { + WITH->blnk = false; + WITH->UU.U73.i1 = V.kattr[V.p - 1].UU.U73.i1; + } + touched = true; } else { - TRY(try17); - j1 = strtol(buf, &STR2, 10); - j = STR2 - buf + 1; - WITH->UU.U73.i1 = j1; - WITH->blnk = false; - touched = true; - RECOVER(try17); - if (P_escapecode == -20) + TRY(try17); + j1 = strtol(buf, &STR2, 10); + j = STR2 - buf + 1; + WITH->UU.U73.i1 = j1; + WITH->blnk = false; + touched = true; + RECOVER(try17); + if (P_escapecode == -20) _Escape(P_escapecode); - warning(); - ENDTRY(try17); + warning(); + ENDTRY(try17); } if (!tryconfig(&V)) { - WITH->UU.U73.i1 = savei; - WITH->blnk = saveb; - touched = saveb2; + WITH->UU.U73.i1 = savei; + WITH->blnk = saveb; + touched = saveb2; } break; @@ -14227,30 +14282,30 @@ long *attrstamp; saveb = WITH->blnk; savei = WITH->UU.U73.i1; if (*buf == '\0' || - !((buf[0] >= 'a' && buf[0] <= 'f') || + !((buf[0] >= 'a' && buf[0] <= 'f') || (buf[0] >= 'A' && buf[0] <= 'F') || isdigit(buf[0]))) { - if (V.kattr[V.p - 1].opt) - WITH->blnk = true; - else { - WITH->blnk = false; - WITH->UU.U73.i1 = V.kattr[V.p - 1].UU.U73.i1; - } - touched = true; + if (V.kattr[V.p - 1].opt) + WITH->blnk = true; + else { + WITH->blnk = false; + WITH->UU.U73.i1 = V.kattr[V.p - 1].UU.U73.i1; + } + touched = true; } else { - TRY(try18); - WITH->UU.U73.i1 = strtol(buf, NULL, 16); - WITH->blnk = false; - touched = true; - RECOVER(try18); - if (P_escapecode == -20) + TRY(try18); + WITH->UU.U73.i1 = strtol(buf, NULL, 16); + WITH->blnk = false; + touched = true; + RECOVER(try18); + if (P_escapecode == -20) _Escape(P_escapecode); - warning(); - ENDTRY(try18); + warning(); + ENDTRY(try18); } if (!tryconfig(&V)) { - WITH->UU.U73.i1 = savei; - WITH->blnk = saveb; - touched = saveb2; + WITH->UU.U73.i1 = savei; + WITH->blnk = saveb; + touched = saveb2; } break; @@ -14261,17 +14316,17 @@ long *attrstamp; strcpy(STR1, strltrim(strrtrim(strcpy(STR3, buf)))); strcpy(buf, STR1); if (*buf == '\0' && !V.kattr[V.p - 1].opt) - strcpy(buf, V.kattr[V.p - 1].UU.c); + strcpy(buf, V.kattr[V.p - 1].UU.c); else if (strlen(buf) > V.kattr[V.p - 1].prec) { - buf[V.kattr[V.p - 1].prec] = '\0'; + buf[V.kattr[V.p - 1].prec] = '\0'; /* p2c: log.text, line 13845: * Note: Modification of string length may translate incorrectly [146] */ } strcpy(WITH->UU.c, buf); if (tryconfig(&V)) - touched = true; + touched = true; else - strcpy(WITH->UU.c, savebuf); + strcpy(WITH->UU.c, savebuf); WITH->blnk = (*WITH->UU.c == '\0'); break; @@ -14282,12 +14337,12 @@ long *attrstamp; strcpy(STR1, strltrim(strrtrim(strcpy(STR3, buf)))); strcpy(buf, STR1); if (*buf == '\0' && !V.kattr[V.p - 1].opt) - strcpy(buf, V.kattr[V.p - 1].UU.sp); + strcpy(buf, V.kattr[V.p - 1].UU.sp); strchange(&WITH->UU.sp, buf); if (tryconfig(&V)) - touched = true; + touched = true; else - strchange(&WITH->UU.sp, savebuf); + strchange(&WITH->UU.sp, savebuf); WITH->blnk = (*WITH->UU.sp == '\0'); break; @@ -14296,24 +14351,24 @@ long *attrstamp; saveb2 = WITH->UU.b; ch = inkey2(); if (ch == '1' || ch == 'y' || ch == 'Y' || ch == 't' || ch == 'T') { - WITH->UU.b = true; - WITH->blnk = false; + WITH->UU.b = true; + WITH->blnk = false; } else if (ch == '0' || ch == 'n' || ch == 'N' || ch == 'f' || - ch == 'F') { - WITH->UU.b = false; - WITH->blnk = false; + ch == 'F') { + WITH->UU.b = false; + WITH->blnk = false; } else if ((ch == '\003' || ch == '\015' || ch == 'x' || ch == 'X') && - V.kattr[V.p - 1].opt) - WITH->blnk = true; + V.kattr[V.p - 1].opt) + WITH->blnk = true; else if (ch == '\003' || ch == '\015' || ch == 'z' || ch == 'Z') { - WITH->UU.b = !WITH->UU.b; - WITH->blnk = false; + WITH->UU.b = !WITH->UU.b; + WITH->blnk = false; } if (tryconfig(&V)) - touched = true; + touched = true; else { - WITH->blnk = saveb; - WITH->UU.b = saveb2; + WITH->blnk = saveb; + WITH->UU.b = saveb2; } break; @@ -14324,14 +14379,14 @@ long *attrstamp; strcpy(buf, STR1); l1 = V.kattr[V.p - 1].UU.U86.v; while (l1 != NULL && strcicmp(l1->s, buf) != 0) - l1 = l1->next; + l1 = l1->next; if (l1 != NULL) - WITH->UU.nv = (long)l1->value; + WITH->UU.nv = (long)l1->value; if (tryconfig(&V)) { - maskvalues(&V); - touched = true; + maskvalues(&V); + touched = true; } else - WITH->UU.nv = savei; + WITH->UU.nv = savei; break; } stamp(attrstamp); @@ -14351,7 +14406,7 @@ long *attrstamp; static void editattrsx(gattr, numattrs, kattr, lbl, name, proc, chproc, - relproc) + relproc) log_gattrrec *gattr; short numattrs; log_kattrrec *kattr; @@ -14397,7 +14452,7 @@ log_grec *g; TEMP5 = gproc2; TEMP6 = gproc3; editattrs(g->attr, g->kind->numattrs, g->kind->attr, g->kind->lbl, - g->kind->name, TEMP, TEMP5, TEMP6, &gg.gattrstamp); + g->kind->name, TEMP, TEMP5, TEMP6, &gg.gattrstamp); } @@ -14435,7 +14490,7 @@ char *name; TEMP5 = nproc2; TEMP6 = nproc3; editattrs(n->attr, n->simtype->nnumattrs, n->simtype->nattr, - n->simtype->nlbl, name, TEMP, TEMP5, TEMP6, &gg.nattrstamp); + n->simtype->nlbl, name, TEMP, TEMP5, TEMP6, &gg.nattrstamp); } @@ -14651,11 +14706,11 @@ char *buf; WITH->UU.b = true; WITH->blnk = false; } else if (buf[0] == '0' || buf[0] == 'n' || buf[0] == 'N' || - buf[0] == 'f' || buf[0] == 'F') { + buf[0] == 'f' || buf[0] == 'F') { WITH->UU.b = false; WITH->blnk = false; } else if ((buf[0] == 'x' || buf[0] == 'X' || buf[0] == ' ') && - V.kattr[V.p - 1].opt) + V.kattr[V.p - 1].opt) WITH->blnk = true; else if (buf[0] == 'z' || buf[0] == 'Z' || buf[0] == ' ') { WITH->UU.b = !WITH->UU.b; @@ -14922,13 +14977,13 @@ log_grec *g; /* p2c: log.text, line 14457: * Warning: Symbol 'LOGFONT_LFONT' is not defined [221] */ drawstr2((int)(g->x * gg.scale - gg.xoff - m_strwidth(logfont_lfont, - strrtrim(strcpy(STR1, n))) + NAMEGAP), - (int)(g->y * gg.scale - gg.yoff - 3), - strrtrim(strcpy(STR2, n))); + strrtrim(strcpy(STR1, n))) + NAMEGAP), + (int)(g->y * gg.scale - gg.yoff - 3), + strrtrim(strcpy(STR2, n))); } else drawstr2((int)(g->x * gg.scale - gg.xoff - NAMEGAP), - (int)(g->y * gg.scale - gg.yoff - 3), - strrtrim(strcpy(STR1, n))); + (int)(g->y * gg.scale - gg.yoff - 3), + strrtrim(strcpy(STR1, n))); m_colormode((long)m_normal); if (!pollkbd2()) { do { @@ -14943,18 +14998,18 @@ log_grec *g; /* p2c: log.text, line 14471: * Warning: Symbol 'LOGFONT_LFONT' is not defined [221] */ drawstr2((int)(g->x * gg.scale - gg.xoff - m_strwidth(logfont_lfont, - strrtrim(strcpy(STR1, n))) + NAMEGAP), - (int)(g->y * gg.scale - gg.yoff - 3), - strrtrim(strcpy(STR2, n))); + strrtrim(strcpy(STR1, n))) + NAMEGAP), + (int)(g->y * gg.scale - gg.yoff - 3), + strrtrim(strcpy(STR2, n))); } else drawstr2((int)(g->x * gg.scale - gg.xoff - NAMEGAP), - (int)(g->y * gg.scale - gg.yoff - 3), - strrtrim(strcpy(STR1, n))); + (int)(g->y * gg.scale - gg.yoff - 3), + strrtrim(strcpy(STR1, n))); m_colormode((long)m_normal); n[strlen(n) - 1] = '\0'; if (pollkbd2()) { ch = inkey2(); - if ((strlen(n) < 256-2 && ch > ' ' && ch != 250 && ch != 251) + if ((strlen(n) < 256-2 && ch > ' ' && ch != 250 && ch != 251) || (ch == ' ' && *n != '\0')) sprintf(n + strlen(n), "%c", ch); /* p2c: log.text, line 14480: Note: Character >= 128 encountered [281] */ @@ -14969,11 +15024,11 @@ log_grec *g; /* p2c: log.text, line 14490: * Warning: Symbol 'LOGFONT_LFONT' is not defined [221] */ drawstr2((int)(g->x * gg.scale - gg.xoff - m_strwidth(logfont_lfont, - strrtrim(strcpy(STR1, n))) + NAMEGAP), - (int)(g->y * gg.scale - gg.yoff - 3), strrtrim(strcpy(STR2, n))); + strrtrim(strcpy(STR1, n))) + NAMEGAP), + (int)(g->y * gg.scale - gg.yoff - 3), strrtrim(strcpy(STR2, n))); } else drawstr2((int)(g->x * gg.scale - gg.xoff - NAMEGAP), - (int)(g->y * gg.scale - gg.yoff - 3), strrtrim(strcpy(STR1, n))); + (int)(g->y * gg.scale - gg.yoff - 3), strrtrim(strcpy(STR1, n))); settofrom(&g, n); signalcaps = nk_setcapslock(savecaps); } @@ -15209,7 +15264,7 @@ short num, *x, *y; i = k->numvects; while (i >= 1 && (k->vector[i - 1].vkind != 'p' || - k->vector[i - 1].UU.U98.num != num)) + k->vector[i - 1].UU.U98.num != num)) i--; if (i >= 1) { *x = k->vector[i - 1].x1; @@ -15227,7 +15282,7 @@ short num, *x1, *y1, *x2, *y2; i = k->numvects; while (i >= 1 && (k->vector[i - 1].vkind != 'b' || - k->vector[i - 1].UU.U98.num != num)) + k->vector[i - 1].UU.U98.num != num)) i--; if (i < 1) return; @@ -15265,7 +15320,7 @@ char *s; /* p2c: log.text, line 14769: * Warning: Symbol 'LOGFONT_LFONT' is not defined [221] */ m_drawstr(x * gg.scale - gg.xoff, y * gg.scale - gg.yoff + 2, logfont_lfont, - s); + s); clipoff(); gg.nearlabel = l; } @@ -15346,7 +15401,7 @@ log_lrec *l; if (touching) { while (i <= strlen(name) && gg.t.x - x1 > m_strwidth(logfont_lfont, - (sprintf(STR1, "%.*s", i, name), STR1))) { + (sprintf(STR1, "%.*s", i, name), STR1))) { /* p2c: log.text, line 14851: * Warning: Symbol 'LOGFONT_LFONT' is not defined [221] */ i++; @@ -15545,7 +15600,7 @@ static void addbox() m_colormode((long)m_normal); scroll(); } while (gg.t.depressed || abs(x1 - gg.posx) < 2 || - abs(y1 - gg.posy) < 2); + abs(y1 - gg.posy) < 2); sortshints(&gg.posx, &x1); sortshints(&gg.posy, &y1); remcursor(); @@ -15747,7 +15802,7 @@ short sig, y; newattrs(&(*hn)->attr, tool->hnumattrs, tool->hattr); if (gg.traceflag) fprintf(tracefile, "Histaddsignal: %ld, %d\n", - (long)(*hn)->attr, tool->hnumattrs); + (long)(*hn)->attr, tool->hnumattrs); (*hn)->next = gg.hnbase; gg.hnbase = *hn; reshuffle(); @@ -16260,7 +16315,7 @@ struct LOC_historycommand *LINK; TEMP5 = haproc2; TEMP6 = haproc3; editattrs(histgattr, histnumattrs, histkattr, histlbl, "Scope", TEMP, TEMP5, - TEMP6, &LINK->stamp); + TEMP6, &LINK->stamp); if (flag) return; hn = gg.hnbase; @@ -16490,7 +16545,7 @@ struct LOC_historycommand *LINK; m_drawline((long)LINK->gridx2, 0L, (long)LINK->gridx2, (long)histdown); gg.actval = (double)abs(LINK->gridx2 - LINK->gridx1) / histdivision; realunit(LINK->gridstr, gg.actval * histgattr[histsecdiv - 1].UU.r, 4, - "s", true); + "s", true); break; case 1: @@ -16500,8 +16555,8 @@ struct LOC_historycommand *LINK; m_drawline((long)LINK->gridx2, 0L, (long)LINK->gridx2, (long)histdown); gg.actval = (double)(LINK->gridx2 - histleft) / histdivision; realunit(LINK->gridstr, gg.actval * histgattr[histsecdiv - 1].UU.r + - histgattr[histfirsttime - 1].UU.r, 4, "s", - true); + histgattr[histfirsttime - 1].UU.r, 4, "s", + true); break; case 3: @@ -16566,7 +16621,7 @@ struct LOC_historycommand *LINK; if (*gg.actstr == '\0') strcpy(gg.actstr, realunit(STR1, gg.actval, 4, "", true)); sprintf(LINK->gridstr, "%s -> %s", - realunit(STR1, LINK->gridtime, 4, "s", true), gg.actstr); + realunit(STR1, LINK->gridtime, 4, "s", true), gg.actstr); break; case 203: @@ -16740,7 +16795,7 @@ static void historycommand() histdivsacross * histgattr[histsecdiv - 1].UU.r); if (!flag && histonscreen) { histgattr[histfirsttime - 1].UU.r = - gg.time - histdivsacross * histgattr[histsecdiv - 1].UU.r * 0.1; + gg.time - histdivsacross * histgattr[histsecdiv - 1].UU.r * 0.1; ch = ' '; } histonscreen = flag; @@ -16768,46 +16823,46 @@ static void historycommand() switch (V.whichmenu) { case 0: - if (gg.t.x < triggerpos - 3) { - confighistmode(&V); - V.rflag = true; - } else if (gg.t.x < resetpos - 3) { - if (gg.histactive) + if (gg.t.x < triggerpos - 3) { + confighistmode(&V); + V.rflag = true; + } else if (gg.t.x < resetpos - 3) { + if (gg.histactive) gg.histactive = false; - else { + else { gg.histactive = true; histreset = true; - } - } else if (gg.t.x < onoffpos - 3) - gg.resetflag = true; - else if (gg.t.x < gridpos - 3) - gg.pwrflag = !gg.pwrflag; - else if (gg.t.x < gridwpos - 3) - nextgridmode(&V); - else if (gg.t.x < fastpos - 3) - nextgridwhich(&V); - else if (gg.t.x < dumppos - 3) - fastmode(&V); - else if (gg.t.x < nextpos - 3) - dumpcmd(&V); - break; + } + } else if (gg.t.x < onoffpos - 3) + gg.resetflag = true; + else if (gg.t.x < gridpos - 3) + gg.pwrflag = !gg.pwrflag; + else if (gg.t.x < gridwpos - 3) + nextgridmode(&V); + else if (gg.t.x < fastpos - 3) + nextgridwhich(&V); + else if (gg.t.x < dumppos - 3) + fastmode(&V); + else if (gg.t.x < nextpos - 3) + dumpcmd(&V); + break; case 1: - if (gg.t.x < yaxispos - 3) { - V.xactive = !V.xactive; - V.yactive = false; - refraxes(&V); - } else if (gg.t.x < exprpos - 3) { - V.xactive = false; - V.yactive = !V.yactive; - refraxes(&V); - } else if (gg.t.x < timepos - 3) - getexpr(&V); - else if (gg.t.x < plotpos - 3) - setaxis("Time", &V); - else if (gg.t.x < next2pos - 3) - plotcmd(&V); - break; + if (gg.t.x < yaxispos - 3) { + V.xactive = !V.xactive; + V.yactive = false; + refraxes(&V); + } else if (gg.t.x < exprpos - 3) { + V.xactive = false; + V.yactive = !V.yactive; + refraxes(&V); + } else if (gg.t.x < timepos - 3) + getexpr(&V); + else if (gg.t.x < plotpos - 3) + setaxis("Time", &V); + else if (gg.t.x < next2pos - 3) + plotcmd(&V); + break; } } } else if (gg.t.x < histleft - 3) { @@ -16819,13 +16874,13 @@ static void historycommand() hn2a = NULL; while (hn != NULL) { if (hn->y > gg.t.y - histvscale && hn->y < gg.t.y + histvscale) { - if (histgridhn == hn) { - hn2 = hn; - hn2a = hn0; - } else { - hn1 = hn; - hn1a = hn0; - } + if (histgridhn == hn) { + hn2 = hn; + hn2a = hn0; + } else { + hn1 = hn; + hn1a = hn0; + } } hn0 = hn; hn = hn->next; @@ -16841,21 +16896,21 @@ static void historycommand() switch (V.whichmenu) { case 0: - if (justtap()) { - gg.actnode = gg.signaltab[hn->sig - 1].np; - gg.acty = hn->sig; - gg.acttool = gg.actnode->simtype; - TEMP = hnproc1; - TEMP5 = hnproc2; - TEMP6 = hnproc3; - editattrs(hn->attr, gg.acttool->hnumattrs, gg.acttool->hattr, + if (justtap()) { + gg.actnode = gg.signaltab[hn->sig - 1].np; + gg.acty = hn->sig; + gg.acttool = gg.actnode->simtype; + TEMP = hnproc1; + TEMP5 = hnproc2; + TEMP6 = hnproc3; + editattrs(hn->attr, gg.acttool->hnumattrs, gg.acttool->hattr, gg.acttool->hlbl, gg.signaltab[hn->sig - 1].name, TEMP, TEMP5, TEMP6, &V.stamp); - V.rflag = true; - } else { - movinghn = hn; - drawsigname(hn, 2, &V); - do { + V.rflag = true; + } else { + movinghn = hn; + drawsigname(hn, 2, &V); + do { hn->y = gg.t.y; flag = (gg.t.y > 0 && gg.t.y < histdown + 3); alignsigname(&hn->y); @@ -16868,8 +16923,8 @@ static void historycommand() } while (gg.t.depressed && gg.t.y == gg.t0.y); if (flag) drawsigname(hn, 3, &V); - } while (gg.t.depressed); - if (!flag) { + } while (gg.t.depressed); + if (!flag) { if (gg.traceflag) fprintf(tracefile, "Delete trace %ld\n", (long)hn); if (hn == histgridhn) { @@ -16884,14 +16939,14 @@ static void historycommand() hn0->next = hn->next; Free(hn); reshuffle(); - } - V.rflag = true; - } - break; + } + V.rflag = true; + } + break; case 1: - setaxis(gg.signaltab[hn->sig - 1].name, &V); - break; + setaxis(gg.signaltab[hn->sig - 1].name, &V); + break; } } } else { @@ -16899,17 +16954,17 @@ static void historycommand() case 0: if (justtap()) { - hn = findtrace(V.gridx1, V.gridy1, &V); - if (hn != NULL) - setgridwhich(hn, &V); + hn = findtrace(V.gridx1, V.gridy1, &V); + if (hn != NULL) + setgridwhich(hn, &V); } else - measurecmd(&V); + measurecmd(&V); break; case 1: hn = findtrace((int)gg.t.x, (int)gg.t.y, &V); if (hn != NULL) - setaxis(gg.signaltab[hn->sig - 1].name, &V); + setaxis(gg.signaltab[hn->sig - 1].name, &V); break; } } @@ -16958,7 +17013,7 @@ static void historycommand() m_color((long)gg.color.scroll); if (scrollpos > 0) m_drawline(scrollpos + histleft - 1L, 0L, scrollpos + histleft - 1L, - (long)histdown); + (long)histdown); m_drawline(scrollpos + across + 1L, 0L, scrollpos + across + 1L, (long)histdown); m_colormode((long)m_normal); @@ -16974,17 +17029,17 @@ static void historycommand() m_color((long)gg.color.scroll); if (scrollpos > 0) m_drawline(scrollpos + histleft - 1L, 0L, scrollpos + histleft - 1L, - (long)histdown); + (long)histdown); m_drawline(scrollpos + across + 1L, 0L, scrollpos + across + 1L, (long)histdown); m_colormode((long)m_normal); } while (ch < 32 && ((1L << ch) & 0x10000100L) != 0 && - abs(scrollpos) <= across - histleft - 10); + abs(scrollpos) <= across - histleft - 10); if (scrollpos == scrollmin) newhistfirsttime = 0.0; else newhistfirsttime = histgattr[histfirsttime - 1].UU.r + - (double)scrollpos / histdivision * histgattr[histsecdiv - 1].UU.r; + (double)scrollpos / histdivision * histgattr[histsecdiv - 1].UU.r; if (histgattr[histfirsttime - 1].UU.r != newhistfirsttime) { histgattr[histfirsttime - 1].UU.r = newhistfirsttime; histgattr[histfirsttime - 1].changed = true; @@ -17010,11 +17065,11 @@ static void historycommand() drawstr2(0, y - 4, name); m_colormode((long)m_normal); while (!gg.t.dn && !keyflag) { - passetc(&V); - if (pollkbd2()) { - ch = inkey2(); - keyflag = true; - } + passetc(&V); + if (pollkbd2()) { + ch = inkey2(); + keyflag = true; + } } m_colormode((long)m_xor); m_color((long)gg.color.signal); @@ -17023,11 +17078,11 @@ static void historycommand() m_colormode((long)m_normal); name[strlen(name) - 1] = '\0'; if (keyflag) { - keyflag = false; - if (ch > ' ' || (ch == ' ' && *name != '\0')) - sprintf(name + strlen(name), "%c", ch); - if (ch == '\007' && *name != '\0') - name[strlen(name) - 1] = '\0'; + keyflag = false; + if (ch > ' ' || (ch == ' ' && *name != '\0')) + sprintf(name + strlen(name), "%c", ch); + if (ch == '\007' && *name != '\0') + name[strlen(name) - 1] = '\0'; } } while (!((ch < 32 && ((1L << ch) & 0x2008) != 0) || gg.t.dn)); sprintf(STR2, "%c", ch); @@ -17371,7 +17426,7 @@ char *filename_; while (n1 != NULL) { fprintf(f, "%d ", n1->simtype->simtype); fprintf(f, "%d\n", - countattrs(n1->attr, n1->simtype->nnumattrs, n1->simtype->nattr, + countattrs(n1->attr, n1->simtype->nnumattrs, n1->simtype->nattr, n1->simtype->nlbl, &V)); writeattrs(&f, n1->attr, n1->simtype->nnumattrs, n1->simtype->nattr, n1->simtype->nlbl, &V); @@ -17382,14 +17437,14 @@ char *filename_; n1 = (log_nrec *)n1->temp; } - /* ensure that each signal has a named gate on this page. */ + /* ensure that each signal has a named gate on this page. */ FORLIM = gg.lastsignal; for (i = 0; i < FORLIM; i++) gg.signaltab[i].f = false; g = gg.gbase[pgnum - 1]; while (g != NULL) { - if (g->sig > 0 && g->sig <= gg.lastsignal && + if (g->sig > 0 && g->sig <= gg.lastsignal && gg.signaltab[g->sig -1].np != NULL && gg.signaltab[g->sig -1].np->flag) gg.signaltab[g->sig -1].f = true; @@ -17430,15 +17485,15 @@ char *filename_; hw = V.firsthwire; while (hw != NULL) { fprintf(f, "%d %d %d %d %d %s\n", - hw->x1, hw->y, hw->x2, hw->y, countnode(hw->node, &V), - colorname(STR1, hw->wcolr)); + hw->x1, hw->y, hw->x2, hw->y, countnode(hw->node, &V), + colorname(STR1, hw->wcolr)); hw = (log_hwrec *)hw->temp; } vw = V.firstvwire; while (vw != NULL) { fprintf(f, "%d %d %d %d %d %s\n", - vw->x, vw->y1, vw->x, vw->y2, countnode(vw->node, &V), - colorname(STR1, vw->wcolr)); + vw->x, vw->y1, vw->x, vw->y2, countnode(vw->node, &V), + colorname(STR1, vw->wcolr)); vw = (log_vwrec *)vw->temp; } count = 0; @@ -17478,8 +17533,8 @@ char *filename_; l = firstlabel; while (l != NULL) { fprintf(f, "%d %d %ld %s\n", - l->x, l->y, m_strwidth(logfont_lfont, l->name) / log_scale0, - l->name); + l->x, l->y, m_strwidth(logfont_lfont, l->name) / log_scale0, + l->name); l = (log_lrec *)l->temp; } /* p2c: log.text, line 16829: @@ -17515,13 +17570,13 @@ char *filename_; FORLIM = g->sig; for (j = 0; j < FORLIM; j++) { if (gg.signaltab[j].f) - i++; + i++; } } fprintf(f, "%d %d %d ", g->x, g->y, g->rot); fprintf(f, "%d %ld %d ", g->gc, (long)g->vars, i); fprintf(f, "%d\n", - countattrs(g->attr, k->numattrs, k->attr, k->lbl, &V)); + countattrs(g->attr, k->numattrs, k->attr, k->lbl, &V)); FORLIM = k->numpins; for (i = 1; i <= FORLIM; i++) { if (i != 1) @@ -17923,7 +17978,7 @@ short count; do { ch = getc(*f); if (ch == '\n') - ch = ' '; + ch = ' '; } while (ch == ' '); } } else @@ -17950,46 +18005,46 @@ short count; case 'U': case 'F': if (ch == 'F' || ch == 'U' || ch == 'R') - fscanf(*f, "%lg", &(*gattr)[jj - 1].UU.r); + fscanf(*f, "%lg", &(*gattr)[jj - 1].UU.r); break; case 'I': case 'H': if (ch == 'H' || ch == 'I') - fscanf(*f, "%ld", &(*gattr)[jj - 1].UU.U73.i1); + fscanf(*f, "%ld", &(*gattr)[jj - 1].UU.U73.i1); break; case 'C': if (ch == 'A' || ch == 'C') { - *buf = '\0'; - fscanf(*f, "%[^\n]", buf); - if (strlen(buf) <= kattr[jj - 1].prec) - strcpy((*gattr)[jj - 1].UU.c, buf); + *buf = '\0'; + fscanf(*f, "%[^\n]", buf); + if (strlen(buf) <= kattr[jj - 1].prec) + strcpy((*gattr)[jj - 1].UU.c, buf); } break; case 'A': if (ch == 'A' || ch == 'C') { - *buf = '\0'; - fscanf(*f, "%[^\n]", buf); - strchange(&(*gattr)[jj - 1].UU.sp, buf); + *buf = '\0'; + fscanf(*f, "%[^\n]", buf); + strchange(&(*gattr)[jj - 1].UU.sp, buf); } break; case 'B': if (ch == 'B') { - ch = getc(*f); - if (ch == '\n') - ch = ' '; - (*gattr)[jj - 1].UU.b = (ch == 't' || ch == 'T' || ch == '1'); + ch = getc(*f); + if (ch == '\n') + ch = ' '; + (*gattr)[jj - 1].UU.b = (ch == 't' || ch == 'T' || ch == '1'); } break; case 'V': if (ch == 'V') { - fscanf(*f, "%hd", &(*gattr)[jj - 1].UU.nv); - if ((*gattr)[jj - 1].UU.nv >= kattr[jj - 1].UU.U86.nv) - (*gattr)[jj - 1].UU.nv = 0; + fscanf(*f, "%hd", &(*gattr)[jj - 1].UU.nv); + if ((*gattr)[jj - 1].UU.nv >= kattr[jj - 1].UU.U86.nv) + (*gattr)[jj - 1].UU.nv = 0; } break; } @@ -18035,7 +18090,7 @@ struct LOC_loadpage *LINK; fclose(LINK->f); if (LINK->ip) Free(LINK->ip); - if (msg == NULL) + if (msg == NULL) _Escape(0); strcpy(LINK->reason, msg); _Escape(1); @@ -18307,7 +18362,7 @@ char *reason_; wp = (wirerec *)Malloc(numwires * sizeof(wirerec)); for (i = 0; i < numwires; i++) { fscanf(V.f, "%hd%hd%hd%hd%hd%c%c%*[^\n]", &x1, &y1, &x2, &y2, &j, &ch, - &ch1); + &ch1); getc(V.f); if (ch == '\n') ch = ' '; @@ -18376,15 +18431,15 @@ char *reason_; while (!P_eoln(V.f)) { fscanf(V.f, "%hd", &j); if (wp[j - 1].horiz) { - if (s->hwire == NULL) - s->hwire = wp[j - 1].UU.hw; - else - s->hwire2 = wp[j - 1].UU.hw; + if (s->hwire == NULL) + s->hwire = wp[j - 1].UU.hw; + else + s->hwire2 = wp[j - 1].UU.hw; } else { - if (s->vwire == NULL) - s->vwire = wp[j - 1].UU.vw; - else - s->vwire2 = wp[j - 1].UU.vw; + if (s->vwire == NULL) + s->vwire = wp[j - 1].UU.vw; + else + s->vwire2 = wp[j - 1].UU.vw; } } fscanf(V.f, "%*[^\n]"); @@ -18453,9 +18508,9 @@ char *reason_; g1 = g; newgate(&g, j + x1 * log_kindoffset); if (g1 == NULL) - gg.gbase[gg.curpage - 1] = g; + gg.gbase[gg.curpage - 1] = g; else - g1->next = g; + g1->next = g; g->next = NULL; g->rot = x1; g->x = x; @@ -18463,29 +18518,29 @@ char *reason_; g->gc = y1; g->vars = (na_long)ii; if (x2 == 0) - g->sig = 0; + g->sig = 0; else - g->sig = V.ip[x2 - 1]; + g->sig = V.ip[x2 - 1]; stamp(&g->kind->simtype->netstamp); j = 1; while (j <= g->kind->numpins && !P_eoln(V.f)) { - fscanf(V.f, "%hd", &k); - g->pin[j - 1] = countnode_(k, &V); - j++; + fscanf(V.f, "%hd", &k); + g->pin[j - 1] = countnode_(k, &V); + j++; } while (j <= g->kind->numpins) { - newnode(&g->pin[j - 1], g->kind->pin[j - 1].s); - j++; + newnode(&g->pin[j - 1], g->kind->pin[j - 1].s); + j++; } fscanf(V.f, "%*[^\n]"); getc(V.f); readattrs(&V.f, &g->attr, g->kind->numattrs, g->kind->attr, - g->kind->lbl, y2); + g->kind->lbl, y2); initpinpos(g); gg.actflag = true; calltoolgate(g, act_connectgate); if (!gg.actflag) - report(11, rtn); + report(11, rtn); gg.actfile = &V.f; gg.actflag = true; calltoolgate(g, act_readgate); @@ -18511,18 +18566,18 @@ char *reason_; for (i = 1; i <= count; i++) { fscanf(V.f, "%hd%hd%c", &y, &x1, &ch); if (ch == '\n') - ch = ' '; + ch = ' '; fgets(tempname, 256, V.f); TEMP = (char *)strchr(tempname, '\n'); if (TEMP != NULL) - *TEMP = 0; + *TEMP = 0; x = getsignal(0, tempname); if (x == 0) - loadfail(NULL, &V); + loadfail(NULL, &V); n = gg.signaltab[x - 1].np; histaddsignal(&hn, x, y); readattrs(&V.f, &hn->attr, n->simtype->hnumattrs, n->simtype->hattr, - n->simtype->hlbl, x1); + n->simtype->hlbl, x1); } ch = getc(V.f); if (ch == '\n') @@ -18606,7 +18661,7 @@ static void loadcommand() if gg.t.x < 22 then x := 0; if gg.t.y < 46 then y := 0; */ if (x < 0 || (unsigned)y > dirmax || x > dircol || dirs[x] == NULL || - *dirs[x][y] == '\0') + *dirs[x][y] == '\0') x = -1; else { nk_gotoxy(x * 15 + 2, y + 2); @@ -18627,8 +18682,8 @@ static void loadcommand() if gg.t.x < 22 then x1 := 0; if gg.t.y < 46 then y1 := 0; */ if (y1 < 0 || x1 < 0 || y1 > dirmax || x1 > dircol || - dirs[x1] == NULL || *dirs[x1][y1] == '\0') - x1 = -1; + dirs[x1] == NULL || *dirs[x1][y1] == '\0') + x1 = -1; } while (!(pollkbd2() || gg.t.dn || x != x1 || y != y1) && gg.t.near_); nc_cursor_off(); remcursor(); @@ -18670,7 +18725,7 @@ static void loadcommand() } else { - m_graphics_on(); + m_graphics_on(); } } else strcpy(filename, gg.funcarg); @@ -18878,18 +18933,18 @@ char *reason_; getc(*V.f); addgate1(x1, y1, (int)(k + x2 * log_kindoffset)); if (gg.neargate != NULL) { - g = gg.neargate; - g->gc = y2; - g->vars = (na_long)ii; - if (m != 0) - settofrom(&g, gg.signaltab[ V.ip[m - 1] - 1].name); - fscanf(*V.f, "%*[^\n]"); /*ignore pins*/ - getc(*V.f); - readattrs(V.f, &g->attr, g->kind->numattrs, g->kind->attr, - g->kind->lbl, (int)n); - gg.actfile = V.f; - gg.actflag = false; - calltoolgate(g, act_readgate); + g = gg.neargate; + g->gc = y2; + g->vars = (na_long)ii; + if (m != 0) + settofrom(&g, gg.signaltab[ V.ip[m - 1] - 1].name); + fscanf(*V.f, "%*[^\n]"); /*ignore pins*/ + getc(*V.f); + readattrs(V.f, &g->attr, g->kind->numattrs, g->kind->attr, + g->kind->lbl, (int)n); + gg.actfile = V.f; + gg.actflag = false; + calltoolgate(g, act_readgate); } } while (!P_eoln(*V.f) && !P_eof(*V.f)) { @@ -19176,20 +19231,20 @@ static void toolcommand() do { j = which(&V); if (j >= 0) { - putchar(chrinverse); - describe(j, &V); - putchar(chrplain); + putchar(chrinverse); + describe(j, &V); + putchar(chrplain); } if (gg.t.near_ && gg.t.inalpha) - nk_gotoxy(gg.t.ax, gg.t.ay); + nk_gotoxy(gg.t.ax, gg.t.ay); else - noblink(); + noblink(); do { - pass(); - pen(); + pass(); + pen(); } while (!(which(&V) != j || gg.t.dn || pollkbd2())); if (j >= 0) - describe(j, &V); + describe(j, &V); } while (!(gg.t.dn || pollkbd2())); nk_gotoxy(0, txdown); if (pollkbd2()) @@ -19200,21 +19255,21 @@ static void toolcommand() switch (j) { case -1: - ch = '\003'; - break; + ch = '\003'; + break; default: - ch = (char)(j + 64); - if (V.ta[ch - 64] == NULL) - ch = '\003'; - break; + ch = (char)(j + 64); + if (V.ta[ch - 64] == NULL) + ch = '\003'; + break; } } if (ch >= 'A' && ch <= 'X') { tp = V.ta[ch - 64]; if (tp != NULL) { - selecttool(tp->name, &V); - exitflag = true; + selecttool(tp->name, &V); + exitflag = true; } } else if (ch == '\003' || ch == '\015' || ch == ' ') exitflag = true; @@ -19268,7 +19323,7 @@ static void status_log() char STR2[9]; char STR3[81]; char * months[12] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; if (gg.actflag) { sysdate(&date); @@ -19521,14 +19576,14 @@ static void status_macro(int v) j++; } while (j < txdown && j < n_to_print+4 && mp != NULL); if (i < 40) { - for (k = 0, mp = macrobase; mp != NULL && k < half ; k++) + for (k = 0, mp = macrobase; mp != NULL && k < half ; k++) mp = mp->next; } i += 40; } while (i <= txacross && mp != NULL); for (k=0; mp != NULL; k++, mp = mp->next) - ; + ; nk_gotoxy((int)2, (int)txdown); printf("[%d of %d]",((n+1)/(n_displayed/2))+1,(n_macros/n_displayed)+1); @@ -19631,9 +19686,9 @@ char *name_; calltool(tp, act_status); if (gg.actflag) { if (tp->ready) - printf(" (No status for this tool)\n"); + printf(" (No status for this tool)\n"); else - printf(" (Not yet activated)\n"); + printf(" (Not yet activated)\n"); } break; } @@ -19720,12 +19775,12 @@ short num; m_getcpicture(kindgroupleft+1, baseline, kindgroupright-1, down, menupicture); */ m_color((long)gg.color.backgr); m_fillrect(kindgroupleft + 1L, (long)baseline, kindgroupright - 1L, - (long)down); + (long)down); m_color((long)gg.color.popupbox); m_drawrect(kindgroupleft + 3L, (long)baseline, kindgroupright - 3L, - down - 2L); + down - 2L); m_drawrect(kindgroupleft + 5L, baseline + 2L, kindgroupright - 5L, - down - 4L); + down - 4L); xx = (kindgroupsize * kindgroupspacing - 10) / (cols + 1); x = across / 2 - xx * (cols - 1) / 2; x0 = x; @@ -20356,9 +20411,9 @@ static void dofunction() clearfunc(); if (!gg.textinvisible) { if (*gg.funcarg == '\0') - editlabel(NULL); + editlabel(NULL); else - addlabel(&gg.nearlabel, gg.funcarg); + addlabel(&gg.nearlabel, gg.funcarg); } } else if (!strcmp(gg.func, "BOX")) { if (!gg.textinvisible) @@ -20368,8 +20423,8 @@ static void dofunction() } else if (!strcmp(gg.func, "VLSI")) { clearfunc(); if (gg.gbase[gg.curpage - 1] != NULL || - gg.hwbase[gg.curpage - 1] != NULL || - gg.vwbase[gg.curpage - 1] != NULL) + gg.hwbase[gg.curpage - 1] != NULL || + gg.vwbase[gg.curpage - 1] != NULL) warning(); else setvlsimode(!vlsi); @@ -20437,12 +20492,12 @@ static void dofunction() } else if (!strcmp(gg.func, "TRAIN")) { /* training := not training; if training and firsttraining then - begin - gethelp('[Tutorial]'); - firsttraining := false; - end; + begin + gethelp('[Tutorial]'); + firsttraining := false; + end; if not training then - m_graphics_on; + m_graphics_on; clearalpha; */ clearfunc(); } else if (!strcmp(gg.func, "STATUS")) { @@ -20453,13 +20508,13 @@ static void dofunction() getbool(gg.funcarg, &gg.markers); if (gg.markers != oflag) { if (gg.markers) { - gg.markerx1 = (gg.xoff + 30) / gg.scale; - gg.markery1 = (gg.yoff + 30) / gg.scale; - gg.markerx2 = (gg.xoff + across - 30) / gg.scale; - gg.markery2 = (gg.yoff + baseline - 30) / gg.scale; - drawmarkersc(gg.color.marker); + gg.markerx1 = (gg.xoff + 30) / gg.scale; + gg.markery1 = (gg.yoff + 30) / gg.scale; + gg.markerx2 = (gg.xoff + across - 30) / gg.scale; + gg.markery2 = (gg.yoff + baseline - 30) / gg.scale; + drawmarkersc(gg.color.marker); } else - drawmarkersc(gg.color.backgr); + drawmarkersc(gg.color.backgr); stamp(&gg.markerstamp); } vmessageflag("Markers are ", gg.markers); @@ -20504,8 +20559,8 @@ static void dofunction() printf("The following page(s) have not been saved: "); FORLIM = gg.numpages; for (i = 1; i <= FORLIM; i++) { - if (pagechanged(i)) - printf("%d ", i); + if (pagechanged(i)) + printf("%d ", i); } putchar('\n'); } @@ -20931,11 +20986,11 @@ struct LOC_initialize *LINK; getword(txbuf, LINK->cmdbuf); if (!strcmp(LINK->cmdbuf, "BOBCAT")) { if (nc_gType() != nc_g300) - *txbuf = '\0'; + *txbuf = '\0'; getword(txbuf, LINK->cmdbuf); } else if (!strcmp(LINK->cmdbuf, "CHIPMUNK")) { if (nc_gType() == nc_g300) - *txbuf = '\0'; + *txbuf = '\0'; getword(txbuf, LINK->cmdbuf); } if (!strcmp(LINK->cmdbuf, "LOG:")) @@ -20950,16 +21005,16 @@ struct LOC_initialize *LINK; continue; if (strends(LINK->cmdbuf, ":") && strlen(LINK->cmdbuf) > 1) { if (*txbuf == '\0') - continue; + continue; LINK->cmdbuf[strlen(LINK->cmdbuf) - 1] = '\0'; /* p2c: log.text, line 19956: * Note: Suspicious mixture of sizes in NA_NEW [173] */ cnfp = (cnfrec *)Malloc(sizeof(cnfrec)); cnfp->next = NULL; if (LINK->cnflast == NULL) - cnfbase = cnfp; + cnfbase = cnfp; else - LINK->cnflast->next = cnfp; + LINK->cnflast->next = cnfp; cnfp->next = NULL; strcpy(cnfp->tool, LINK->cmdbuf); strcpy(cnfp->s, txbuf); @@ -20968,9 +21023,9 @@ struct LOC_initialize *LINK; } if (!strcmp(LINK->cmdbuf, "INCLUDE")) { do { - strwordx(txbuf, txarg); - if (*txarg != '\0') - readcnf(txarg, LINK); + strwordx(txbuf, txarg); + if (*txarg != '\0') + readcnf(txarg, LINK); } while (*txarg != '\0'); continue; } @@ -20981,26 +21036,26 @@ struct LOC_initialize *LINK; if (!strcmp(LINK->cmdbuf, "GATES")) { strwordx(txbuf, txarg); if (!strcmp(txarg, "+")) - strwordx(txbuf, txarg); + strwordx(txbuf, txarg); else { - if (erasegates) - strlist_empty(&gatefilenames); + if (erasegates) + strlist_empty(&gatefilenames); } erasegates = false; while (*txarg != '\0') { - addgatesfile(txarg, LINK); - strwordx(txbuf, txarg); + addgatesfile(txarg, LINK); + strwordx(txbuf, txarg); } continue; } if (!strcmp(LINK->cmdbuf, "HELP")) { if (locatefile(txbuf, LINK)) - strcpy(loghelpname, txbuf); + strcpy(loghelpname, txbuf); continue; } if (!strcmp(LINK->cmdbuf, "NEWS")) { if (locatefile(txbuf, LINK)) - strcpy(lognewsname, txbuf); + strcpy(lognewsname, txbuf); continue; } if (!strcmp(LINK->cmdbuf, "TABLET")) { @@ -21010,84 +21065,84 @@ struct LOC_initialize *LINK; if (!strcmp(LINK->cmdbuf, "MENU")) { getword(txbuf, txarg); if (!strcmp(txarg, "+")) - getword(txbuf, txarg); + getword(txbuf, txarg); else { - if (erasemenu) - strlist_empty(&LINK->logmenu); + if (erasemenu) + strlist_empty(&LINK->logmenu); } erasemenu = false; while (*txarg != '\0') { - l1 = strlist_append(&LINK->logmenu, txarg); - getword(txbuf, txarg); + l1 = strlist_append(&LINK->logmenu, txarg); + getword(txbuf, txarg); } continue; } if (!strcmp(LINK->cmdbuf, "GET") || !strcmp(LINK->cmdbuf, "LOAD")) { getword(txbuf, txarg); if (!strcmp(txarg, "+")) - getword(txbuf, txarg); + getword(txbuf, txarg); else { - if (eraseload) - strlist_empty(&LINK->loadgates); + if (eraseload) + strlist_empty(&LINK->loadgates); } eraseload = false; while (*txarg != '\0') { - l1 = strlist_append(&LINK->loadgates, txarg); - getword(txbuf, txarg); + l1 = strlist_append(&LINK->loadgates, txarg); + getword(txbuf, txarg); } continue; } if (!strcmp(LINK->cmdbuf, "GETGROUP")) { getword(txbuf, txarg); if (!strcmp(txarg, "+")) - getword(txbuf, txarg); + getword(txbuf, txarg); else { - if (eraseload) - strlist_empty(&LINK->loadgates); + if (eraseload) + strlist_empty(&LINK->loadgates); } eraseload = false; l1 = strlist_append(&LINK->loadgates, ""); l1->value = (na_long)NULL; while (*txarg != '\0') { - l2 = strlist_append((na_strlist_t **)(&l1->value), txarg); - getword(txbuf, txarg); + l2 = strlist_append((na_strlist_t **)(&l1->value), txarg); + getword(txbuf, txarg); } continue; } if (!strcmp(LINK->cmdbuf, "TOOL")) { getword(txbuf, txarg); if (*txarg == '\0') - continue; + continue; tp = gg.toolbase; while (tp != NULL && strcmp(tp->name, txarg)) - tp = tp->next; + tp = tp->next; if (tp != NULL) - continue; + continue; newtool(&tp, txarg); strwordx(txbuf, txarg); if (*txarg != '\0') - strcpy(tp->comment, txarg); + strcpy(tp->comment, txarg); getword(txbuf, txarg); continue; } if (!strcmp(LINK->cmdbuf, "COMMAND")) { getword(txbuf, txarg2); if (*txarg2 == '\0') - continue; + continue; do { - getword(txbuf, txarg); - if (*txarg != '\0') { - l1 = strlist_add(&commandlist, txarg); - *(char **)((char **)(&l1->value)) = strdup(txarg2); - } + getword(txbuf, txarg); + if (*txarg != '\0') { + l1 = strlist_add(&commandlist, txarg); + *(char **)((char **)(&l1->value)) = strdup(txarg2); + } } while (*txarg != '\0'); continue; } if (!strcmp(LINK->cmdbuf, "SIGNALS") || !strcmp(LINK->cmdbuf, "NODES")) { LINK->j = getint(txbuf, 0L); if (LINK->j < 1) { - P_escapecode = -1; - goto _Ltry33; + P_escapecode = -1; + goto _Ltry33; } gg.maxsignal = LINK->j; continue; @@ -21245,7 +21300,7 @@ static void initialize() l2 = strlist_append(&histlbl, "On Reset;OUs:Time to start trigger:"); l2 = strlist_append(&histlbl, "On Reset;OUs:Time to stop trigger:"); l2 = strlist_append(&histlbl, - "VTrigger off,Simulation off:Action when memory full:"); + "VTrigger off,Simulation off:Action when memory full:"); l2 = strlist_append(&histlbl, ""); l2 = strlist_append(&histlbl, "Us:Minimum timestep:"); l2 = strlist_append(&histlbl, "Us:Maximum timestep:"); @@ -21395,53 +21450,53 @@ static void initialize() flag = false; TRY(try36); if (libf1[k]->f != NULL) - libf1[k]->f = freopen(gatesname[k], "r", libf1[k]->f); + libf1[k]->f = freopen(gatesname[k], "r", libf1[k]->f); else - libf1[k]->f = fopen(gatesname[k], "r"); + libf1[k]->f = fopen(gatesname[k], "r"); if (libf1[k]->f == NULL) { - P_escapecode = -10; - P_ioresult = FileNotFound; - goto _Ltry36; + P_escapecode = -10; + P_ioresult = FileNotFound; + goto _Ltry36; } RESETBUF(libf1[k]->f, filerec); flag = true; RECOVER2(try36,_Ltry36); if (P_escapecode == -20) - goto _Ltry35; + goto _Ltry35; TRY(try37); - if (libf1[k]->f != NULL) { - sprintf(STR2, "%s/%s", GetChipmunkPath("LOGLIB", LOGLIB), - gatesname[k]); - libf1[k]->f = freopen(STR2, "r", libf1[k]->f); - } else { - sprintf(STR2, "%s/%s", GetChipmunkPath("LOGLIB", LOGLIB), - gatesname[k]); - libf1[k]->f = fopen(STR2, "r"); - } - if (libf1[k]->f == NULL) { - P_escapecode = -10; - P_ioresult = FileNotFound; - goto _Ltry37; - } - RESETBUF(libf1[k]->f, filerec); - sprintf(STR2, "%s/%s", GetChipmunkPath("LOGLIB", LOGLIB), - gatesname[k]); - strcpy(gatesname[k], STR2); - flag = true; + if (libf1[k]->f != NULL) { + sprintf(STR2, "%s/%s", GetChipmunkPath("LOGLIB", LOGLIB), + gatesname[k]); + libf1[k]->f = freopen(STR2, "r", libf1[k]->f); + } else { + sprintf(STR2, "%s/%s", GetChipmunkPath("LOGLIB", LOGLIB), + gatesname[k]); + libf1[k]->f = fopen(STR2, "r"); + } + if (libf1[k]->f == NULL) { + P_escapecode = -10; + P_ioresult = FileNotFound; + goto _Ltry37; + } + RESETBUF(libf1[k]->f, filerec); + sprintf(STR2, "%s/%s", GetChipmunkPath("LOGLIB", LOGLIB), + gatesname[k]); + strcpy(gatesname[k], STR2); + flag = true; RECOVER2(try37,_Ltry37); - if (P_escapecode == -20) - goto _Ltry35; + if (P_escapecode == -20) + goto _Ltry35; ENDTRY(try37); ENDTRY(try36); if (flag) { if (libf1[k]->f != NULL) - rewind(libf1[k]->f); + rewind(libf1[k]->f); else - libf1[k]->f = tmpfile(); + libf1[k]->f = tmpfile(); if (libf1[k]->f == NULL) { - P_escapecode = -10; - P_ioresult = FileNotFound; - goto _Ltry35; + P_escapecode = -10; + P_ioresult = FileNotFound; + goto _Ltry35; } SETUPBUF(libf1[k]->f, filerec); fseek(libf1[k]->f, 0L, 0); @@ -21490,21 +21545,21 @@ static void initialize() TRY(try38); gptr[i]++; if ((gptr[i] & 31) == 0) - GET(libf1[i]->f, filerec); + GET(libf1[i]->f, filerec); strcpy(gname[i], " "); strmove(8, GETFBUF(libf1[i]->f, filerec).ix[gptr[i] & 31], 1, gname[i], 1); ggroup[i] = 0; for (V.j = 1; V.j <= 8; V.j++) { - if ((gname[i][V.j - 1] & (~127)) != 0) { + if ((gname[i][V.j - 1] & (~127)) != 0) { /* p2c: log.text, line 20412: Note: Character >= 128 encountered [281] */ - ggroup[i] = V.j; - gname[i][V.j - 1] = (char)((uchar)gname[i][V.j - 1] - 128); - } + ggroup[i] = V.j; + gname[i][V.j - 1] = (char)((uchar)gname[i][V.j - 1] - 128); + } } RECOVER(try38); if (P_escapecode == -20) - _Escape(P_escapecode); + _Escape(P_escapecode); beginfatal(&V); printf("Can't read gates file \"%s\"\n", gatesname[i]); endfatal(&V); @@ -21572,7 +21627,7 @@ static void initialize() } if (WITH->matrix[i - nk_keylow][1 - nk_keymodlow].c == 157) /*shift-left*/ - WITH->matrix[i - nk_keylow][1 - nk_keymodlow].c = 25; + WITH->matrix[i - nk_keylow][1 - nk_keymodlow].c = 25; else if (WITH->matrix[i - nk_keylow][1 - nk_keymodlow].c == 158) WITH->matrix[i - nk_keylow][1 - nk_keymodlow].c = 26; } @@ -21746,7 +21801,7 @@ int main(int argc, char * argv[]) long FORLIM; char STR1[81]; - nc_text_in_window = 1; + nc_text_in_window = 1; PASCAL_MAIN(argc, argv); tracefile = NULL; dumpfile = NULL; @@ -21772,103 +21827,103 @@ int main(int argc, char * argv[]) tempverbose = false; suppressdots = false; if (justonecommand && thingstodo == NULL) { - P_escapecode = 20; - goto _Ltry41; + P_escapecode = 20; + goto _Ltry41; } if (gg.showpage <= 0) - refrscreen(); + refrscreen(); m_graphics_on(); nc_cursor_off(); while (messages != NULL) { - switch ((long)messages->value) { + switch ((long)messages->value) { - case 0: - message(messages->s); - break; + case 0: + message(messages->s); + break; - case 1: - vmessage(messages->s); - break; - } - strlist_delete(&messages, &messages); + case 1: + vmessage(messages->s); + break; + } + strlist_delete(&messages, &messages); } if (gg.startpoint) - crosshair(gg.posx, gg.posy); + crosshair(gg.posx, gg.posy); else - nocrosshair(); + nocrosshair(); gg.stillnear = true; rabtime = timers_sysclock(); if (displaynews) - shownews(); + shownews(); if (*gg.func == '\0') { - do { - if (refrtimer == 0 && !gg.startpoint) { + do { + if (refrtimer == 0 && !gg.startpoint) { refresh(); gg.refrflag = true; - } - if (refrtimer > 0) { + } + if (refrtimer > 0) { if (gg.t.moving) refrtimer = refrtimer0; else refrtimer--; - } - pass(); - trykbdscroll(); - pen(); - if (!gg.stillnear) { + } + pass(); + trykbdscroll(); + pen(); + if (!gg.stillnear) { gg.startpoint = false; gg.stillnear = true; nocrosshair(); - } - if (gg.t.near_) { + } + if (gg.t.near_) { if (rabflag) norabbits(); rabtime = timers_sysclock(); - } - if (timers_sysclock() - rabtime > rabdelay && !avoidrabbits) + } + if (timers_sysclock() - rabtime > rabdelay && !avoidrabbits) addrabbit(); - } while (!(gg.t.dn || *gg.func != '\0')); + } while (!(gg.t.dn || *gg.func != '\0')); } if (displaynews) { - clearalpha(); - displaynews = false; + clearalpha(); + displaynews = false; } if (rabflag) - norabbits(); + norabbits(); nocrosshair(); clipoff(); if (*gg.func != '\0') { - commandfound = false; - dofunction(); - if (!commandfound) { - beginerror(); - printf("Can't understand function %s\n", gg.func); - enderror(); - clearfunc(); - } + commandfound = false; + dofunction(); + if (!commandfound) { + beginerror(); + printf("Can't understand function %s\n", gg.func); + enderror(); + clearfunc(); + } } else if (gg.incircuit) { - pass(); - clipoff(); - gg.oldx = gg.posx; - gg.oldy = gg.posy; - ospointflag = gg.startpoint; - gg.posx = gg.gridx; - gg.posy = gg.gridy; - gg.startpoint = true; - if (!ospointflag && !justtap() && !gg.invisible && !gg.showconflicts) { - if (gg.probemode) + pass(); + clipoff(); + gg.oldx = gg.posx; + gg.oldy = gg.posy; + ospointflag = gg.startpoint; + gg.posx = gg.gridx; + gg.posy = gg.gridy; + gg.startpoint = true; + if (!ospointflag && !justtap() && !gg.invisible && !gg.showconflicts) { + if (gg.probemode) yardstick(); - else { + else { moveobject(); gg.movinghw = NULL; gg.movingvw = NULL; - } - } else { - closergate(gg.posx, gg.posy); - if (gg.nearlabel != NULL && !gg.invisible && !gg.textinvisible) { + } + } else { + closergate(gg.posx, gg.posy); + if (gg.nearlabel != NULL && !gg.invisible && !gg.textinvisible) { editlabel(gg.nearlabel); gg.startpoint = false; - } else if (!ospointflag && gg.neargate != NULL) { + } else if (!ospointflag && gg.neargate != NULL) { if (gg.probemode) { configgate(gg.neargate); gg.startpoint = false; @@ -21876,13 +21931,13 @@ int main(int argc, char * argv[]) touchgate(gg.neargate); gg.startpoint = false; } - } else if (!ospointflag) { + } else if (!ospointflag) { closerwire(gg.posx, gg.posy); if (gg.probemode) { if (gg.nearhw != NULL) - confignode(gg.nearhw->node, "(Node)"); + confignode(gg.nearhw->node, "(Node)"); else if (gg.nearvw != NULL) - confignode(gg.nearvw->node, "(Node)"); + confignode(gg.nearvw->node, "(Node)"); gg.startpoint = false; } else if (gg.nearhw != NULL && gg.nearvw != NULL && gg.nearhw->x1 != gg.posx && @@ -21890,55 +21945,55 @@ int main(int argc, char * argv[]) gg.nearvw->y1 != gg.posy && gg.nearvw->y2 != gg.posy) { if (findsolder(gg.posx, gg.posy) != NULL) { - unsoldernear(); - pen(); /* Restore cursor */ - gg.startpoint = false; + unsoldernear(); + pen(); /* Restore cursor */ + gg.startpoint = false; } else if (!vlsi || gg.nearhw->wcolr == log_wcol_blue || - gg.nearvw->wcolr == log_wcol_blue) { - soldernear(); - gg.startpoint = false; + gg.nearvw->wcolr == log_wcol_blue) { + soldernear(); + gg.startpoint = false; } } - } else { + } else { if (hvline(gg.oldx, gg.oldy, &gg.posx, &gg.posy)) { if (gg.posx != gg.oldx) - addhwire(gg.posx, gg.oldx, gg.posy, curwcolor); + addhwire(gg.posx, gg.oldx, gg.posy, curwcolor); if (gg.posy != gg.oldy) - addvwire(gg.posx, gg.oldy, gg.posy, curwcolor); + addvwire(gg.posx, gg.oldy, gg.posy, curwcolor); } - } - if (gg.invisible || gg.probemode || gg.showconflicts) + } + if (gg.invisible || gg.probemode || gg.showconflicts) gg.startpoint = false; - } + } } else if (inbox((int)(menux1 - 4), line1 - 5, 34, 20)) - popupmenu(1); + popupmenu(1); else if (inbox((int)(menux1 - 4), line2 - 5, 34, 20)) - assertfunc("HELP"); + assertfunc("HELP"); else if (inbox((int)(menux2 - 4), line1 - 5, 34, 20)) - popupmenu(2); + popupmenu(2); else if (inbox((int)(menux2 - 4), line2 - 5, 34, 20)) - assertfunc("CAT"); + assertfunc("CAT"); else if (inbox((int)(across + menux3 - 4), line1 - 5, 34, 20)) - popupmenu(3); + popupmenu(3); else if (inbox((int)(across + menux4 - 4), line1 - 5, 34, 20)) - popupmenu(4); + popupmenu(4); else if (inbox((int)(across + menux4 - 4), line2 - 5, 34, 20)) - assertfunc("TAPMODE"); + assertfunc("TAPMODE"); else { - if (kindgroupleft <= gg.t.x && gg.t.x < kindgroupright && + if (kindgroupleft <= gg.t.x && gg.t.x < kindgroupright && gg.t.y < down) { - temp1 = (gg.t.x - kindgroupleft) / kindgroupspacing + 1; - if (gg.probemode) + temp1 = (gg.t.x - kindgroupleft) / kindgroupspacing + 1; + if (gg.probemode) configkind((int)temp1); - else if (justtap()) + else if (justtap()) flipkind(); - else if (!gg.invisible && !gg.probemode && !gg.showconflicts) { + else if (!gg.invisible && !gg.probemode && !gg.showconflicts) { if (addgate(kindgroup[temp1 - 1], kindsig[temp1 - 1], - kindattr[temp1 - 1])) + kindattr[temp1 - 1])) nextkindsig((int)temp1); - } - } - gg.startpoint = false; + } + } + gg.startpoint = false; } /* sleep(2);zfprintf(stdout, "z"); fflush(stdout); **MDG** test */ } while (!pigsfly); @@ -21974,7 +22029,7 @@ int main(int argc, char * argv[]) for (temp4 = 1; temp4 <= maxgatesfiles; temp4++) { if (libf1[temp4 - 1] != NULL) { if (libf1[temp4 - 1]->f != NULL) - fclose(libf1[temp4 - 1]->f); + fclose(libf1[temp4 - 1]->f); libf1[temp4 - 1]->f = NULL; } } @@ -21987,7 +22042,7 @@ int main(int argc, char * argv[]) } else { clearshowalpha(); printf("\n\n%c%cUnexpected runtime error%c%c\n\n", - chryellow, chrunderl, chrplain, chrgreen); + chryellow, chrunderl, chrplain, chrgreen); printf(" Escapecode = %ld\n", temp2); if (temp2 == -10) printf(" Ioresult = %ld = %s\n", @@ -22035,22 +22090,22 @@ int main(int argc, char * argv[]) if (gg.initdone) { printf("Want debugging printout? "); do { - tempch = nk_getkey(); + tempch = nk_getkey(); } while (tempch != 'n' && tempch != 'N' && tempch != 'y' && tempch != 'Y'); printf("%c\n", tempch); if (tempch == 'y' || tempch == 'Y') { - TRY(try43); - gg.traceflag = true; - tracemessage(""); - fprintf(tracefile, "ESCAPECODE %ld\n", temp2); - fprintf(tracefile, "IORESULT %ld\n", temp1); - fprintf(tracefile, "LINE %ld\n\n", excpline); - fprintf(tracefile, "Current page: %ld\n", gg.curpage); - dumpnodes(); - RECOVER(try43); - printf("Debugging printout failed.\n"); - ENDTRY(try43); + TRY(try43); + gg.traceflag = true; + tracemessage(""); + fprintf(tracefile, "ESCAPECODE %ld\n", temp2); + fprintf(tracefile, "IORESULT %ld\n", temp1); + fprintf(tracefile, "LINE %ld\n\n", excpline); + fprintf(tracefile, "Current page: %ld\n", gg.curpage); + dumpnodes(); + RECOVER(try43); + printf("Debugging printout failed.\n"); + ENDTRY(try43); } putchar('\n'); } @@ -22058,12 +22113,12 @@ int main(int argc, char * argv[]) for (temp1 = 1; temp1 <= FORLIM; temp1++) { printf("Try to save page %ld? ", temp1); do { - tempch = nk_getkey(); + tempch = nk_getkey(); } while (tempch != 'n' && tempch != 'N' && tempch != 'y' && tempch != 'Y'); printf("%c\n", tempch); if (tempch == 'y' || tempch == 'Y') - emergencysave((int)temp1); + emergencysave((int)temp1); } } RECOVER(try42); diff --git a/psys/src/p2clib.c b/psys/src/p2clib.c index c2d0364ab1656b89ee0f3af5cd18ef35b5790757..c71cca9bb5ec388ec37265ac0ea1f4c87694e01d 100644 --- a/psys/src/p2clib.c +++ b/psys/src/p2clib.c @@ -148,7 +148,7 @@ char *strltrim(char *s) { while (isspace(*s)) s++; - return s - 1; + return s; } /* Trim blanks at right end of string. */