* keys.c (History_Init): Make it static. Tidy-up its formatting.

(History_Shutdown): Likewise.


git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@229 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
sezero 2010-06-25 23:55:41 +00:00
parent 5d8098f1a5
commit 5739389db5

View file

@ -682,19 +682,21 @@ void Key_WriteBindings (FILE *f)
fprintf (f, "bind \"%s\" \"%s\"\n", Key_KeynumToString(i), keybindings[i]); fprintf (f, "bind \"%s\" \"%s\"\n", Key_KeynumToString(i), keybindings[i]);
} }
void History_Init (void)
static void History_Init (void)
{ {
int i, c; int i, c;
FILE *hf; FILE *hf;
for (i = 0; i < CMDLINES; i++) { for (i = 0; i < CMDLINES; i++)
{
key_lines[i][0] = ']'; key_lines[i][0] = ']';
key_lines[i][1] = 0; key_lines[i][1] = 0;
} }
key_linepos = 1; key_linepos = 1;
// if (cl_savehistory.value) // if (cl_savehistory.value)
if ((hf = fopen(HISTORY_FILE_NAME, "rt"))) if ((hf = fopen(HISTORY_FILE_NAME, "rt")) != NULL)
{ {
do do
{ {
@ -715,13 +717,13 @@ void History_Init (void)
} }
} }
void History_Shutdown (void) static void History_Shutdown (void)
{ {
int i; int i;
FILE *hf; FILE *hf;
// if (cl_savehistory.value) // if (cl_savehistory.value)
if ((hf = fopen(HISTORY_FILE_NAME, "wt"))) if ((hf = fopen(HISTORY_FILE_NAME, "wt")) != NULL)
{ {
i = edit_line; i = edit_line;
do do
@ -731,7 +733,9 @@ void History_Shutdown (void)
do do
{ {
// fprintf(hf, "%s\n", wcs2str(key_lines[i] + 1)); // Baker: I commented this line out because byte colored text isn't a feature in most ordinary engines // Baker: I commented this line out because byte colored
// text isn't a feature in most ordinary engines.
// fprintf(hf, "%s\n", wcs2str(key_lines[i] + 1));
fprintf(hf, "%s\n", key_lines[i] + 1); fprintf(hf, "%s\n", key_lines[i] + 1);
i = (i + 1) & (CMDLINES - 1); i = (i + 1) & (CMDLINES - 1);
} while (i != edit_line && key_lines[i][1]); } while (i != edit_line && key_lines[i][1]);
@ -739,7 +743,6 @@ void History_Shutdown (void)
} }
} }
/* /*
=================== ===================
Key_Init Key_Init
@ -753,8 +756,7 @@ void Key_Init (void)
History_Init (); History_Init ();
#if 0 // This section of code is now done in History_Init #if 0 /* This section of code is now done in History_Init */
for (i=0 ; i<32 ; i++) for (i=0 ; i<32 ; i++)
{ {
key_lines[i][0] = ']'; key_lines[i][0] = ']';