summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2018-02-10 09:00:09 (GMT)
committerfvogel <fvogelnew1@free.fr>2018-02-10 09:00:09 (GMT)
commite93687e98f7a46c65307e4820355ada663131577 (patch)
tree13d267d2617a5aa36823369f5271483cdc3d59d5
parent861c3b79214beb32cdd3861a1054cbbdabd80b0d (diff)
downloadtk-e93687e98f7a46c65307e4820355ada663131577.zip
tk-e93687e98f7a46c65307e4820355ada663131577.tar.gz
tk-e93687e98f7a46c65307e4820355ada663131577.tar.bz2
Better debug output formatting (from Scott).
-rw-r--r--generic/tkCanvas.c20
-rw-r--r--win/makefile.vc2
2 files changed, 15 insertions, 7 deletions
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index 331b7e3..609ed6e 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -2709,7 +2709,13 @@ DrawCanvas(
for (iy = 0; iy < ximagePtr->height; ++ iy) {
Tcl_AppendResult(interp, " {", NULL);
for (ix = 0; ix < ximagePtr->bytes_per_line; ++ ix) {
- sprintf(buffer," 0x%2.2x",ximagePtr->data[ximagePtr->bytes_per_line * iy + ix]&0xFF);
+ if (ix > 0) {
+ if (ix % 4 == 0)
+ Tcl_AppendResult(interp, "-", NULL);
+ else
+ Tcl_AppendResult(interp, " ", NULL);
+ }
+ sprintf(buffer,"%2.2x",ximagePtr->data[ximagePtr->bytes_per_line * iy + ix]&0xFF);
Tcl_AppendResult(interp, buffer, NULL);
}
Tcl_AppendResult(interp, " }", NULL);
@@ -2775,9 +2781,6 @@ DrawCanvas(
#endif
for(x = 0; x < blockPtr.width; ++x) {
unsigned long pixel;
-#ifdef DEBUG_DRAWCANVAS
- Tcl_AppendResult(interp, " {", NULL);
-#endif
switch (ximagePtr->bits_per_pixel) {
/*
@@ -2827,8 +2830,13 @@ DrawCanvas(
#ifdef DEBUG_DRAWCANVAS
{
int ix;
- for (ix = 0; ix < 3; ++ix)
- sprintf(buffer,"0x%2.2x",blockPtr.pixelPtr[blockPtr.pitch * y + blockPtr.pixelSize * x + ix]&0xFF); Tcl_AppendResult(interp, " ", buffer, NULL);
+ if (x > 0)
+ Tcl_AppendResult(interp, "-", NULL);
+ for (ix = 0; ix < 4; ++ix) {
+ if (ix > 0)
+ Tcl_AppendResult(interp, " ", NULL);
+ sprintf(buffer,"%2.2x",blockPtr.pixelPtr[blockPtr.pitch * y + blockPtr.pixelSize * x + ix]&0xFF); Tcl_AppendResult(interp, buffer, NULL);
+ }
}
#endif
}
diff --git a/win/makefile.vc b/win/makefile.vc
index 4050663..744974e 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -305,7 +305,7 @@ PRJ_INCLUDES = -I"$(BITMAPDIR)" -I"$(XLIBDIR)"
CONFIG_DEFS =-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 \
-DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 \
-DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 \
- -DSUPPORT_CONFIG_EMBEDDED \
+ -DSUPPORT_CONFIG_EMBEDDED -DDEBUG_DRAWCANVAS \
!if $(HAVE_UXTHEME_H)
-DHAVE_UXTHEME_H=1 \
!endif