From: Greg King Date: Tue, 7 May 2013 00:35:18 +0000 (-0400) Subject: Removed unneeded variable and function. X-Git-Tag: V2.14~17^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1b2095d7e94d1d690b3f458a1c66cbf88a4adc0a;p=cc65 Removed unneeded variable and function. They were used with built-in configurations. Commit 37c492b544dec2460fc2c16a3d66275cc0d4edc0 made them obsolete. --- diff --git a/src/ld65/scanner.c b/src/ld65/scanner.c index bb9d5c1c4..b60381fb6 100644 --- a/src/ld65/scanner.c +++ b/src/ld65/scanner.c @@ -6,7 +6,7 @@ /* */ /* */ /* */ -/* (C) 1998-2010, Ullrich von Bassewitz */ +/* (C) 1998-2013, Ullrich von Bassewitz */ /* Roemerstrasse 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ @@ -66,9 +66,8 @@ unsigned long CfgIVal; /* Error location */ FilePos CfgErrorPos; -/* Input sources for the configuration */ +/* Input source for the configuration */ static const char* CfgName = 0; -static const char* CfgBuf = 0; /* Other input stuff */ static int C = ' '; @@ -126,18 +125,8 @@ void CfgError (const FilePos* Pos, const char* Format, ...) static void NextChar (void) /* Read the next character from the input file */ { - if (CfgBuf) { - /* Read from buffer */ - C = (unsigned char)(*CfgBuf); - if (C == 0) { - C = EOF; - } else { - ++CfgBuf; - } - } else { - /* Read from the file */ - C = getc (InputFile); - } + /* Read from the file */ + C = getc (InputFile); /* Count columns */ 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) /* 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) /* Open the input file if we have one */ { - /* If we have a config name given, open the file, otherwise we will read - * from a buffer. - */ - if (!CfgBuf) { - - /* Open the file */ - InputFile = fopen (CfgName, "r"); - if (InputFile == 0) { - 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 */ C = ' '; InputPos.Line = 1; InputPos.Col = 0; - InputPos.Name = GetStringId (CfgBuf? "[builtin config]" : CfgName); + InputPos.Name = GetStringId (CfgName); /* Start the ball rolling ... */ CfgNextTok (); diff --git a/src/ld65/scanner.h b/src/ld65/scanner.h index cd69d644e..cb3914657 100644 --- a/src/ld65/scanner.h +++ b/src/ld65/scanner.h @@ -6,7 +6,7 @@ /* */ /* */ /* */ -/* (C) 1998-2012, Ullrich von Bassewitz */ +/* (C) 1998-2013, Ullrich von Bassewitz */ /* Roemerstrasse 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ @@ -227,9 +227,6 @@ void CfgBoolToken (void); void CfgSetName (const char* Name); /* Set a name for a config file */ -void CfgSetBuf (const char* Buf); -/* Set a memory buffer for the config */ - int CfgAvail (void); /* Return true if we have a configuration available */ @@ -246,4 +243,3 @@ void CfgCloseInput (void); -