shithub: riscv

Download patch

ref: d4a6dc8910014eb18eb72afa566c9839a9957b47
parent: ca2fa9596b5d0d893be28c6e8fd8a52a89a0c3c6
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;
 	}