Followed the discussions in the Pull request #682.

* Fixed a misspelling
* Fixed styles
* Added sample codes
This commit is contained in:
AIDA Shinra
2018-06-12 02:06:01 +09:00
parent 2b25329423
commit fd67284b4d
14 changed files with 195 additions and 13 deletions

View File

@@ -59,6 +59,7 @@ unsigned char PassCount = 2; /* How many passed do we do? */
signed char NewlineAfterJMP = -1; /* Add a newline after a JMP insn? */
signed char NewlineAfterRTS = -1; /* Add a newline after a RTS insn? */
long StartAddr = -1L; /* Start/load address of the program */
unsigned char SyncLines = 0; /* Accept line markers in the info file */
long InputOffs = -1L; /* Offset into input file */
long InputSize = -1L; /* Number of bytes to read from input */

View File

@@ -60,6 +60,7 @@ extern unsigned char PassCount; /* How many passed do we do? */
extern signed char NewlineAfterJMP;/* Add a newline after a JMP insn? */
extern signed char NewlineAfterRTS;/* Add a newline after a RTS insn? */
extern long StartAddr; /* Start/load address of the program */
extern unsigned char SyncLines; /* Accept line markers in the info file */
extern long InputOffs; /* Offset into input file */
extern long InputSize; /* Number of bytes to read from input */

View File

@@ -318,7 +318,7 @@ static void OptSyncLines (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Handle the --sync-lines option */
{
InfoSyncLines = 1;
SyncLines = 1;
}

View File

@@ -76,8 +76,6 @@ static unsigned InputCol = 0;
static FILE* InputFile = 0;
static char* InputSrcName = 0;
/* Options */
unsigned char InfoSyncLines = 0;
/*****************************************************************************/
@@ -119,6 +117,7 @@ void InfoError (const char* Format, ...)
/*****************************************************************************/
/* Code */
/*****************************************************************************/
@@ -164,7 +163,7 @@ static void SkipBlanks (int SingleLine)
}
}
static long GetDecimalToken ()
static long GetDecimalToken (void)
{
long Value = 0;
@@ -226,15 +225,15 @@ Store:
static void LineMarkerOrComment ()
/* Handle a line beginning with '#'. Possible interpretations are:
* - #line <lineno> ["<filename>"] (C preprocessor input)
* - # <lineno> "<filename>" [<flag>]... (gcc preprocessor output)
* - #<comment>
*/
** - #line <lineno> ["<filename>"] (C preprocessor input)
** - # <lineno> "<filename>" [<flag>]... (gcc preprocessor output)
** - #<comment>
*/
{
unsigned long LineNo = 0;
int LineDirective = 0;
StrBuf SrcNameBuf = AUTO_STRBUF_INITIALIZER;
/* Skip the first "# " */
NextChar ();
SkipBlanks (1);
@@ -440,7 +439,7 @@ Again:
case '#':
/* # lineno "sourcefile" or # comment */
if (InfoSyncLines && InputCol == 1) {
if (SyncLines && InputCol == 1) {
LineMarkerOrComment ();
} else {
do {

View File

@@ -138,8 +138,6 @@ extern long InfoIVal;
extern unsigned InfoErrorLine;
extern unsigned InfoErrorCol;
/* Options */
extern unsigned char InfoSyncLines;
/*****************************************************************************/