From 9a21fb5a2f2ef9935cf06e8c2c986bfca430d074 Mon Sep 17 00:00:00 2001 From: Zeex Date: Fri, 12 Jan 2018 20:26:45 +0600 Subject: [PATCH] Reset errline to -1 instead of 0 --- source/compiler/sc1.c | 12 ++++++------ source/compiler/sc5.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/compiler/sc1.c b/source/compiler/sc1.c index ede7c9a..b9260f2 100644 --- a/source/compiler/sc1.c +++ b/source/compiler/sc1.c @@ -2858,7 +2858,7 @@ static void decl_const(int vclass) /* temporarily reset the line number to where the symbol was defined */ errorset(sSETPOS,symbolline); error(213); /* tagname mismatch */ - errorset(sSETPOS,0); + errorset(sSETPOS,-1); } /* if */ sym=add_constant(constname,val,vclass,tag); if (sym!=NULL) @@ -4780,7 +4780,7 @@ static int testsymbols(symbol *root,int level,int testlabs,int testconst) } else if ((sym->usage & uREAD)==0) { errorset(sSETPOS,sym->lnumber); error(203,sym->name); /* symbol isn't used: ... */ - errorset(sSETPOS,0); + errorset(sSETPOS,-1); } /* if */ } /* if */ break; @@ -4800,7 +4800,7 @@ static int testsymbols(symbol *root,int level,int testlabs,int testconst) if (testconst && (sym->usage & uREAD)==0) { errorset(sSETPOS,sym->lnumber); error(203,sym->name); /* symbol isn't used: ... */ - errorset(sSETPOS,0); + errorset(sSETPOS,-1); } /* if */ break; default: @@ -4810,16 +4810,16 @@ static int testsymbols(symbol *root,int level,int testlabs,int testconst) if ((sym->usage & (uWRITTEN | uREAD | uSTOCK | uPUBLIC))==0) { errorset(sSETPOS,sym->lnumber); error(203,sym->name,sym->lnumber); /* symbol isn't used (and not stock) */ - errorset(sSETPOS,0); + errorset(sSETPOS,-1); } else if ((sym->usage & (uREAD | uSTOCK | uPUBLIC))==0) { errorset(sSETPOS,sym->lnumber); error(204,sym->name); /* value assigned to symbol is never used */ - errorset(sSETPOS,0); + errorset(sSETPOS,-1); #if 0 // ??? not sure whether it is a good idea to force people use "const" } else if ((sym->usage & (uWRITTEN | uPUBLIC | uCONST))==0 && sym->ident==iREFARRAY) { errorset(sSETPOS,sym->lnumber); error(214,sym->name); /* make array argument "const" */ - errorset(sSETPOS,0); + errorset(sSETPOS,-1); #endif } /* if */ /* also mark the variable (local or global) to the debug information */ diff --git a/source/compiler/sc5.c b/source/compiler/sc5.c index 0208f79..ac08c96 100644 --- a/source/compiler/sc5.c +++ b/source/compiler/sc5.c @@ -269,7 +269,7 @@ static short lastfile; assert(errstart<=errline); va_start(argptr,number); if (strlen(errfname)==0) { - int start= (errstart==errline) ? -1 : errstart; + int start=(errstart==errline) ? -1 : errstart; if (pc_error(number,msg,inpfname,start,errline,argptr)) { if (outf!=NULL) { pc_closeasm(outf,TRUE); @@ -356,7 +356,7 @@ int pc_enablewarning(int number,int enable) if (number<200) return FALSE; /* errors and fatal errors cannot be disabled */ - number -= 200; + number-=200; if (number>=NUM_WARNINGS) return FALSE;