ref: df4875324f4df4597b157cd9f959dac100f47261
parent: 89ecf06a4283225745708e0d71372c61fcc9f151
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Apr 29 17:03:52 EDT 2017
libdraw: get rid of _drawdebug variable
--- a/sys/include/ape/draw.h
+++ b/sys/include/ape/draw.h
@@ -509,7 +509,6 @@
extern Image *screen;
extern Screen *_screen;
extern int _cursorfd;
-extern int _drawdebug; /* set to 1 to see errors from flushimage */
extern void _setdrawop(Display*, Drawop);
#define BGSHORT(p) ((p)[0]|((p)[1]<<8))
--- a/sys/include/draw.h
+++ b/sys/include/draw.h
@@ -502,7 +502,6 @@
extern Image *screen;
extern Screen *_screen;
extern int _cursorfd;
-extern int _drawdebug; /* set to 1 to see errors from flushimage */
extern void _setdrawop(Display*, Drawop);
#define BGSHORT(p) ((p)[0]|((p)[1]<<8))
--- a/sys/src/libdraw/init.c
+++ b/sys/src/libdraw/init.c
@@ -5,7 +5,6 @@
Display *display;
Font *font;
Image *screen;
-int _drawdebug = 0;
static char deffontname[] = "*default*";
Screen *_screen;
@@ -411,15 +410,13 @@
int
doflush(Display *d)
{- int n, nn;
+ int n;
n = d->bufp-d->buf;
if(n <= 0)
return 1;
- if((nn=write(d->fd, d->buf, n)) != n){- if(_drawdebug)
- fprint(2, "flushimage fail: d=%p: n=%d nn=%d %r\n", d, n, nn); /**/
+ if(write(d->fd, d->buf, n) != n){d->bufp = d->buf; /* might as well; chance of continuing */
return -1;
}
--
⑨