| Date: Tue, 11 Jan 2005 16:48:35 +0000
changes from rob
Diffstat:
M src/cmd/plot/libplot/machdep.c | 3 ++-
M src/cmd/plot/libplot/subr.c | 8 +-------
2 files changed, 3 insertions(+), 8 deletions(-)
--- |
| t@@ -68,7 +68,8 @@ void m_initialize(char *s){
int dx, dy;
USED(s);
if(first){
- initdraw(0,0,"plot");
+ if(initdraw(0,0,"plot") < 0)
+ sysfatal("plot: can't open display: %r");
einit(Emouse);
clipminx=mapminx=screen->r.min.x+4;
clipminy=mapminy=screen->r.min.y+4; |
| t@@ -18,16 +18,10 @@ bcolor(char *s){
switch (*s) {
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
- c=0;
- while('0'<=*s && *s<='9')
- c=c*10+*s++-'0';
- if(c < 0)
- return DBlack;
- return cmap2rgba(c);
+ return strtoul(s, 0, 0);
case 'k': case 'z': /* zero was old name for kblack */
return(DBlack);
case 'r':
-print("RED");
return(DRed);
case 'g':
return(DGreen); |