Move default rows, cols to config.def.h

    Add default_cols, default_rows as static ints in the config.def.h
    header, instead of using constants directly in the code.

cheers
aes
From ba8a00c0c2b10b5b3224ce6c9f498e07352cec5d Mon Sep 17 00:00:00 2001
From: Anders Eurenius <a...@spotify.com>
Date: Sat, 21 Jun 2014 20:34:11 +0200
Subject: [PATCH 5/8] Move default rows, cols to config.def.h

Add default_cols, default_rows as static ints in the config.def.h
header, instead of using constants directly in the code.
---
 config.def.h | 2 ++
 st.c         | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/config.def.h b/config.def.h
index fadcfa0..68c2051 100644
--- a/config.def.h
+++ b/config.def.h
@@ -6,6 +6,8 @@
  * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
  */
 static char font[] = "Liberation Mono:pixelsize=12:antialias=false:autohint=false";
+static int default_cols = 80;
+static int default_rows = 24;
 static int borderpx = 2;
 static char shell[] = "/bin/sh";
 
diff --git a/st.c b/st.c
index 40dcdf3..1621352 100644
--- a/st.c
+++ b/st.c
@@ -3862,7 +3862,8 @@ usage(void) {
 int
 main(int argc, char *argv[]) {
 	char *titles;
-	uint cols = 80, rows = 24;
+	uint cols = default_cols;
+	uint rows = default_rows;
 
 	xw.l = xw.t = 0;
 	xw.isfixed = False;
-- 
2.0.0

Reply via email to