[hackers] [st] only compile tdump if DEBUG flag is set || Anselm R Garbe

From: <hg_AT_suckless.org>
Date: Fri, 10 Jul 2009 15:27:18 +0000 (UTC)

changeset: 66:4801aa121163
tag: tip
user: Anselm R Garbe <garbeam_AT_gmail.com>
date: Fri Jul 10 16:27:14 2009 +0100
files: st.c
description:
only compile tdump if DEBUG flag is set

diff -r 59c763efd3a0 -r 4801aa121163 st.c
--- a/st.c Fri Jul 10 16:23:11 2009 +0100
+++ b/st.c Fri Jul 10 16:27:14 2009 +0100
@@ -41,11 +41,6 @@
 enum { SCupdate, SCredraw };
 
 typedef int Color;
-
-typedef struct {
- KeySym k;
- char s[ESCSIZ];
-} Key;
 
 typedef struct {
         char c; /* character code */
@@ -125,7 +120,6 @@
 static void tcursor(int);
 static void tdeletechar(int);
 static void tdeleteline(int);
-static void tdump(void);
 static void tinsertblank(int);
 static void tinsertblankline(int);
 static void tmoveto(int, int);
@@ -169,6 +163,26 @@
 static int cmdfd;
 static pid_t pid;
 static int running;
+
+#ifdef DEBUG
+void
+tdump(void) {
+ int row, col;
+ Glyph c;
+
+ for(row = 0; row < term.row; row++) {
+ for(col = 0; col < term.col; col++) {
+ if(col == term.c.x && row == term.c.y)
+ putchar('#');
+ else {
+ c = term.line[row][col];
+ putchar(c.state & CRset ? c.c : '.');
+ }
+ }
+ putchar('\n');
+ }
+}
+#endif
 
 void
 die(const char *errstr, ...) {
@@ -798,24 +812,6 @@
 }
 
 void
-tdump(void) {
- int row, col;
- Glyph c;
-
- for(row = 0; row < term.row; row++) {
- for(col = 0; col < term.col; col++) {
- if(col == term.c.x && row == term.c.y)
- putchar('#');
- else {
- c = term.line[row][col];
- putchar(c.state & CRset ? c.c : '.');
- }
- }
- putchar('\n');
- }
-}
-
-void
 tresize(int col, int row) {
         int i;
         Line *line;
Received on Fri Jul 10 2009 - 15:27:18 UTC

This archive was generated by hypermail 2.2.0 : Fri Jul 10 2009 - 15:36:05 UTC