[hackers] [st] Avoid initialization of vt100_0 in each call to tsetchar || "Roberto E. Vargas Caballero"

From: <hg_AT_suckless.org>
Date: Sun, 7 Oct 2012 11:11:51 +0200 (CEST)

changeset: 362:04aba539bee9
user: "Roberto E. Vargas Caballero" <k0ga_AT_shike2.com>
date: Sun Oct 07 11:06:08 2012 +0200
files: st.c
description:
Avoid initialization of vt100_0 in each call to tsetchar
If vt100_0 is a automatic variable then it is initializated in each call to
tsetchar, but if the variable is static it is initializated only in compile
time.
---
 st.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff -r 79b08dd4049d -r 04aba539bee9 st.c
--- a/st.c	Sun Oct 07 11:06:00 2012 +0200
+++ b/st.c	Sun Oct 07 11:06:08 2012 +0200
_AT_@ -1183,7 +1183,7 @@
 
 void
 tsetchar(char *c) {
-	char *vt100_0[62] = { /* 0x41 - 0x7e */
+	static char *vt100_0[62] = { /* 0x41 - 0x7e */
 		"↑", "↓", "→", "←", "█", "▚", "☃", /* A - G */
 		0, 0, 0, 0, 0, 0, 0, 0, /* H - O */
 		0, 0, 0, 0, 0, 0, 0, 0, /* P - W */
Received on Sun Oct 07 2012 - 11:11:51 CEST

This archive was generated by hypermail 2.3.0 : Sun Oct 07 2012 - 11:12:09 CEST