Removed unneeded variable and function.

They were used with built-in configurations.
Commit 37c492b544 made them obsolete.
This commit is contained in:
Greg King 2013-05-06 20:35:18 -04:00
parent 983c6285e1
commit 1b2095d7e9
2 changed files with 11 additions and 41 deletions

View file

@ -6,7 +6,7 @@
/* */ /* */
/* */ /* */
/* */ /* */
/* (C) 1998-2010, Ullrich von Bassewitz */ /* (C) 1998-2013, Ullrich von Bassewitz */
/* Roemerstrasse 52 */ /* Roemerstrasse 52 */
/* D-70794 Filderstadt */ /* D-70794 Filderstadt */
/* EMail: uz@cc65.org */ /* EMail: uz@cc65.org */
@ -66,9 +66,8 @@ unsigned long CfgIVal;
/* Error location */ /* Error location */
FilePos CfgErrorPos; FilePos CfgErrorPos;
/* Input sources for the configuration */ /* Input source for the configuration */
static const char* CfgName = 0; static const char* CfgName = 0;
static const char* CfgBuf = 0;
/* Other input stuff */ /* Other input stuff */
static int C = ' '; static int C = ' ';
@ -126,18 +125,8 @@ void CfgError (const FilePos* Pos, const char* Format, ...)
static void NextChar (void) static void NextChar (void)
/* Read the next character from the input file */ /* Read the next character from the input file */
{ {
if (CfgBuf) { /* Read from the file */
/* Read from buffer */ C = getc (InputFile);
C = (unsigned char)(*CfgBuf);
if (C == 0) {
C = EOF;
} else {
++CfgBuf;
}
} else {
/* Read from the file */
C = getc (InputFile);
}
/* Count columns */ /* Count columns */
if (C != EOF) { if (C != EOF) {
@ -553,18 +542,10 @@ void CfgSetName (const char* Name)
void CfgSetBuf (const char* Buf)
/* Set a memory buffer for the config */
{
CfgBuf = Buf;
}
int CfgAvail (void) int CfgAvail (void)
/* Return true if we have a configuration available */ /* Return true if we have a configuration available */
{ {
return CfgName != 0 || CfgBuf != 0; return CfgName != 0;
} }
@ -572,24 +553,17 @@ int CfgAvail (void)
void CfgOpenInput (void) void CfgOpenInput (void)
/* Open the input file if we have one */ /* Open the input file if we have one */
{ {
/* If we have a config name given, open the file, otherwise we will read /* Open the file */
* from a buffer. InputFile = fopen (CfgName, "r");
*/ if (InputFile == 0) {
if (!CfgBuf) { Error ("Cannot open `%s': %s", CfgName, strerror (errno));
/* Open the file */
InputFile = fopen (CfgName, "r");
if (InputFile == 0) {
Error ("Cannot open `%s': %s", CfgName, strerror (errno));
}
} }
/* Initialize variables */ /* Initialize variables */
C = ' '; C = ' ';
InputPos.Line = 1; InputPos.Line = 1;
InputPos.Col = 0; InputPos.Col = 0;
InputPos.Name = GetStringId (CfgBuf? "[builtin config]" : CfgName); InputPos.Name = GetStringId (CfgName);
/* Start the ball rolling ... */ /* Start the ball rolling ... */
CfgNextTok (); CfgNextTok ();

View file

@ -6,7 +6,7 @@
/* */ /* */
/* */ /* */
/* */ /* */
/* (C) 1998-2012, Ullrich von Bassewitz */ /* (C) 1998-2013, Ullrich von Bassewitz */
/* Roemerstrasse 52 */ /* Roemerstrasse 52 */
/* D-70794 Filderstadt */ /* D-70794 Filderstadt */
/* EMail: uz@cc65.org */ /* EMail: uz@cc65.org */
@ -227,9 +227,6 @@ void CfgBoolToken (void);
void CfgSetName (const char* Name); void CfgSetName (const char* Name);
/* Set a name for a config file */ /* Set a name for a config file */
void CfgSetBuf (const char* Buf);
/* Set a memory buffer for the config */
int CfgAvail (void); int CfgAvail (void);
/* Return true if we have a configuration available */ /* Return true if we have a configuration available */
@ -246,4 +243,3 @@ void CfgCloseInput (void);