Use MS-DOS style numbering for COMx. [rsc] --rw-rw-r-- M 28433 jmk sys 1777 Sep 19 06:48 sys/src/9/pc/uartisa.c /n/sourcesdump/2005/0919/plan9/sys/src/9/pc/uartisa.c:34,40 - /n/sourcesdump/2005/0920/plan9/sys/src/9/pc/uartisa.c:34,40 } uart->regs = ctlr; - snprint(buf, sizeof(buf), "COM%d", ctlrno); + snprint(buf, sizeof(buf), "COM%d", ctlrno+1); kstrdup(&uart->name, buf); uart->freq = isa->freq; uart->phys = &i8250physuart; Move atexit into its own file. [rsc] --rw-rw-r-- M 28433 rsc sys 220 Sep 19 06:47 sys/src/ape/lib/ap/stdio/atexit.c [rsc] --rw-rw-r-- M 28433 glenda sys 321 Sep 19 06:47 sys/src/ape/lib/ap/stdio/exit.c /n/sourcesdump/2005/0919/plan9/sys/src/ape/lib/ap/stdio/exit.c:15,27 - /n/sourcesdump/2005/0920/plan9/sys/src/ape/lib/ap/stdio/exit.c:15,17 _doatexits(); _exit(status); } - atexit(int (*f)(void)) - { - int i; - for(i=0; iop = OCONST; + r->type = TINT; + r->fmt = 'D'; + r->ival = sysr1(); } void Add setmalloctag calls to help find memory leaks. [rsc] --rw-rw-r-- M 28433 glenda sys 617 Sep 19 07:19 sys/src/libmp/port/betomp.c /n/sourcesdump/2005/0919/plan9/sys/src/libmp/port/betomp.c:9,16 - /n/sourcesdump/2005/0920/plan9/sys/src/libmp/port/betomp.c:9,18 int m, s; mpdigit x; - if(b == nil) + if(b == nil){ b = mpnew(0); + setmalloctag(b, getcallerpc(&p)); + } // dump leading zeros while(*p == 0 && n > 1){ [rsc] --rw-rw-r-- M 28433 glenda sys 2685 Sep 19 07:19 sys/src/libmp/port/mpaux.c /n/sourcesdump/2005/0919/plan9/sys/src/libmp/port/mpaux.c:58,63 - /n/sourcesdump/2005/0920/plan9/sys/src/libmp/port/mpaux.c:58,64 sysfatal("mpsetminbits: n < 0"); b = mallocz(sizeof(mpint), 1); + setmalloctag(b, getcallerpc(&n)); if(b == nil) sysfatal("mpnew: %r"); n = DIGITS(n); [rsc] --rw-rw-r-- M 28433 glenda sys 915 Sep 19 07:19 sys/src/libmp/port/mptobe.c /n/sourcesdump/2005/0919/plan9/sys/src/libmp/port/mptobe.c:15,20 - /n/sourcesdump/2005/0920/plan9/sys/src/libmp/port/mptobe.c:15,21 if(p == nil){ n = (b->top+1)*Dbytes; p = malloc(n); + setmalloctag(p, getcallerpc(&b)); } if(p == nil) return -1; Your text here. [rsc] --rw-rw-r-- M 28433 glenda sys 50918 Sep 19 07:19 sys/src/libsec/port/x509.c /n/sourcesdump/2005/0919/plan9/sys/src/libsec/port/x509.c:172,177 - /n/sourcesdump/2005/0920/plan9/sys/src/libsec/port/x509.c:172,178 exits("out of memory"); } memset(p, 0, n); + setmalloctag(p, getcallerpc(&n)); return p; } /n/sourcesdump/2005/0919/plan9/sys/src/libsec/port/x509.c:259,267 - /n/sourcesdump/2005/0920/plan9/sys/src/libsec/port/x509.c:260,270 if(err == ASN_OK) { err = length_decode(pp, pend, &length); if(err == ASN_OK) { - if(tag.class == Universal) + if(tag.class == Universal) { err = value_decode(pp, pend, length, tag.num, isconstr, &val); - else + if(val.tag == VSeq || val.tag == VSet) + setmalloctag(val.u.seqval, getcallerpc(&pp)); + }else err = value_decode(pp, pend, length, OCTET_STRING, 0, &val); if(err == ASN_OK) { pelem->tag = tag; /n/sourcesdump/2005/0919/plan9/sys/src/libsec/port/x509.c:498,503 - /n/sourcesdump/2005/0920/plan9/sys/src/libsec/port/x509.c:501,507 case SEQUENCE: err = seq_decode(&p, pend, length, isconstr, &vl); + setmalloctag(vl, getcallerpc(&pp)); if(err == ASN_OK) { pval->tag = VSeq ; pval->u.seqval = vl; /n/sourcesdump/2005/0919/plan9/sys/src/libsec/port/x509.c:506,511 - /n/sourcesdump/2005/0920/plan9/sys/src/libsec/port/x509.c:510,516 case SETOF: err = seq_decode(&p, pend, length, isconstr, &vl); + setmalloctag(vl, getcallerpc(&pp)); if(err == ASN_OK) { pval->tag = VSet; pval->u.setval = vl; /n/sourcesdump/2005/0919/plan9/sys/src/libsec/port/x509.c:742,747 - /n/sourcesdump/2005/0920/plan9/sys/src/libsec/port/x509.c:747,753 } *pp = p; *pelist = ans; + setmalloctag(ans, getcallerpc(&pp)); return err; } /n/sourcesdump/2005/0919/plan9/sys/src/libsec/port/x509.c:1402,1407 - /n/sourcesdump/2005/0920/plan9/sys/src/libsec/port/x509.c:1408,1414 Elist* el; el = (Elist*)emalloc(sizeof(Elist)); + setmalloctag(el, getcallerpc(&e)); el->hd = e; el->tl = tail; return el; /n/sourcesdump/2005/0919/plan9/sys/src/libsec/port/x509.c:2042,2048 - /n/sourcesdump/2005/0920/plan9/sys/src/libsec/port/x509.c:2049,2054 /* see 9.2.1 of rfc2437 */ pkcs1 = betomp(signature->data, signature->len, nil); mpexp(pkcs1, pk->ek, pk->n, pkcs1); - pkcs1buf = nil; buflen = mptobe(pkcs1, nil, 0, &pkcs1buf); buf = pkcs1buf; if(buflen != nlen || buf[0] != 1) { Add — and – [rsc] --rw-rw-r-- M 28433 glenda sys 25915 Sep 19 22:28 sys/src/libhtml/lex.c /n/sourcesdump/2005/0919/plan9/sys/src/libhtml/lex.c:250,256 - /n/sourcesdump/2005/0920/plan9/sys/src/libhtml/lex.c:250,256 // Character entity to unicode character number map. // Keep sorted by name. - StringInt chartab[142]= { + StringInt chartab[]= { {L"AElig", 198}, {L"Aacute", 193}, {L"Acirc", 194}, /n/sourcesdump/2005/0919/plan9/sys/src/libhtml/lex.c:307,315 - /n/sourcesdump/2005/0920/plan9/sys/src/libhtml/lex.c:307,315 {L"eacute", 233}, {L"ecirc", 234}, {L"egrave", 232}, - {L"emdash", 8212}, + {L"emdash", 8212}, /* non-standard but commonly used */ {L"emsp", 8195}, - {L"endash", 8211}, + {L"endash", 8211}, /* non-standard but commonly used */ {L"ensp", 8194}, {L"epsilon", 949}, {L"eta", 951}, /n/sourcesdump/2005/0919/plan9/sys/src/libhtml/lex.c:333,342 - /n/sourcesdump/2005/0920/plan9/sys/src/libhtml/lex.c:333,344 {L"ldots", 8230}, {L"lt", 60}, {L"macr", 175}, + {L"mdash", 8212}, {L"micro", 181}, {L"middot", 183}, {L"mu", 956}, {L"nbsp", 160}, + {L"ndash", 8211}, {L"not", 172}, {L"ntilde", 241}, {L"nu", 957}, [rsc] --rw-rw-r-- M 28433 glenda sys 25915 Sep 19 22:28 sys/src/libhtml/lex.c