Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Dec 2011 21:02:33 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r228425 - head/usr.sbin/vidcontrol
Message-ID:  <201112112102.pBBL2XQs069032@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Sun Dec 11 21:02:33 2011
New Revision: 228425
URL: http://svn.freebsd.org/changeset/base/228425

Log:
  Add static keywords to vidcontrol(1).
  
  While there, remove the false optimisation of the colors array. It seems
  that changing it to an array of pointers instead of a 16x16 array does
  not cause any increase in binary size at all.

Modified:
  head/usr.sbin/vidcontrol/vidcontrol.c

Modified: head/usr.sbin/vidcontrol/vidcontrol.c
==============================================================================
--- head/usr.sbin/vidcontrol/vidcontrol.c	Sun Dec 11 21:02:01 2011	(r228424)
+++ head/usr.sbin/vidcontrol/vidcontrol.c	Sun Dec 11 21:02:33 2011	(r228425)
@@ -63,7 +63,7 @@ static const char rcsid[] =
 /* Screen dump file format revision */
 #define DUMP_FMT_REV	1
 
-char 	legal_colors[16][16] = {
+static const char *legal_colors[16] = {
 	"black", "blue", "green", "cyan",
 	"red", "magenta", "brown", "white",
 	"grey", "lightblue", "lightgreen", "lightcyan",
@@ -78,18 +78,16 @@ struct {
 	struct video_info	video_mode_info;
 } cur_info;
 
-int	hex = 0;
-int	number;
-int	vesa_cols;
-int	vesa_rows;
-int	font_height;
-int	colors_changed;
-int	video_mode_changed;
-int	normal_fore_color, normal_back_color;
-int	revers_fore_color, revers_back_color;
-char	letter;
-struct	vid_info info;
-struct	video_info new_mode_info;
+static int	hex = 0;
+static int	vesa_cols;
+static int	vesa_rows;
+static int	font_height;
+static int	colors_changed;
+static int	video_mode_changed;
+static int	normal_fore_color, normal_back_color;
+static int	revers_fore_color, revers_back_color;
+static struct	vid_info info;
+static struct	video_info new_mode_info;
 
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201112112102.pBBL2XQs069032>