Port sc5 to C++.
This commit is contained in:
		
							parent
							
								
									3eb1faa470
								
							
						
					
					
						commit
						9c005d93ed
					
				@ -86,7 +86,7 @@ binary.sources += [
 | 
			
		||||
  'sc2.c',
 | 
			
		||||
  'sc3.c',
 | 
			
		||||
  'sc4.c',
 | 
			
		||||
  'sc5.c',
 | 
			
		||||
  'sc5.cpp',
 | 
			
		||||
  'sc6.cpp',
 | 
			
		||||
  'sc7.cpp',
 | 
			
		||||
  'scexpand.cpp',
 | 
			
		||||
 | 
			
		||||
@ -67,7 +67,7 @@ int pc_printf(const char *message,...)
 | 
			
		||||
 *		If the function returns 0, the parser attempts to continue compilation.
 | 
			
		||||
 *		On a non-zero return value, the parser aborts.
 | 
			
		||||
 */
 | 
			
		||||
int pc_error(int number,char *message,char *filename,int firstline,int lastline,va_list argptr)
 | 
			
		||||
int pc_error(int number,const char *message,const char *filename,int firstline,int lastline,va_list argptr)
 | 
			
		||||
{
 | 
			
		||||
static const char *prefix[3]={ "error", "fatal error", "warning" };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -564,7 +564,7 @@ const char *type_to_name(int tag);
 | 
			
		||||
int pc_printf(const char *message,...);
 | 
			
		||||
 | 
			
		||||
/* error report function */
 | 
			
		||||
int pc_error(int number,char *message,char *filename,int firstline,int lastline,va_list argptr);
 | 
			
		||||
int pc_error(int number,const char *message,const char *filename,int firstline,int lastline,va_list argptr);
 | 
			
		||||
 | 
			
		||||
/* input from source file */
 | 
			
		||||
void *pc_opensrc(char *filename); /* reading only */
 | 
			
		||||
 | 
			
		||||
@ -42,7 +42,7 @@ unsigned char errstr_table
[][2] = {
 | 
			
		||||
};
 | 
			
		||||
/*-*SCPACK end of pair table, do not change or remove this line */
 | 
			
		||||
 | 
			
		||||
static char *errmsg[] = {
 | 
			
		||||
static const char *errmsg[] = {
 | 
			
		||||
#ifdef SCPACK
 | 
			
		||||
/*001*/  "expected token: \"%s\", but found \"%s\"\n",
 | 
			
		||||
/*002*/  "only a single statement (or expression) can follow each \"case\"\n",
 | 
			
		||||
@ -362,7 +362,7 @@ static char *errmsg[] = {
 | 
			
		||||
#endif
 | 
			
		||||
       };
 | 
			
		||||
 | 
			
		||||
static char *fatalmsg[] = {
 | 
			
		||||
static const char *fatalmsg[] = {
 | 
			
		||||
#ifdef SCPACK
 | 
			
		||||
/*160*/  "cannot read from file: \"%s\"\n",
 | 
			
		||||
/*161*/  "cannot write to file: \"%s\"\n",
 | 
			
		||||
@ -398,7 +398,7 @@ static char *fatalmsg[] = {
 | 
			
		||||
#endif
 | 
			
		||||
       };
 | 
			
		||||
 | 
			
		||||
static char *warnmsg[] = {
 | 
			
		||||
static const char *warnmsg[] = {
 | 
			
		||||
#ifdef SCPACK
 | 
			
		||||
/*200*/  "symbol \"%s\" is truncated to %d characters\n",
 | 
			
		||||
/*201*/  "redefinition of constant/macro (symbol \"%s\")\n",
 | 
			
		||||
 | 
			
		||||
@ -69,10 +69,10 @@ static int sErrLine;     /* forced line number for the error message */
 | 
			
		||||
 */
 | 
			
		||||
SC_FUNC int error(int number,...)
 | 
			
		||||
{
 | 
			
		||||
static char *prefix[3]={ "error", "fatal error", "warning" };
 | 
			
		||||
static const char *prefix[3]={ "error", "fatal error", "warning" };
 | 
			
		||||
static int lastline,errorcount;
 | 
			
		||||
static short lastfile;
 | 
			
		||||
  char *msg,*pre;
 | 
			
		||||
  const char *msg,*pre;
 | 
			
		||||
  va_list argptr;
 | 
			
		||||
 | 
			
		||||
  // sErrLine is used to temporarily change the line number of reported errors.
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user