commit
6a3ab7c9f4
@ -4690,7 +4690,7 @@ static int testsymbols(symbol *root,int level,int testlabs,int testconst)
|
|||||||
/* a variable */
|
/* a variable */
|
||||||
if (sym->parent!=NULL)
|
if (sym->parent!=NULL)
|
||||||
break; /* hierarchical data type */
|
break; /* hierarchical data type */
|
||||||
if ((sym->usage & (uWRITTEN | uREAD | uSTOCK))==0) {
|
if ((sym->usage & (uWRITTEN | uREAD | uSTOCK | uPUBLIC))==0) {
|
||||||
if (testconst)
|
if (testconst)
|
||||||
errorset(sSETPOS,sym->lnumber);
|
errorset(sSETPOS,sym->lnumber);
|
||||||
error(203,sym->name,sym->lnumber); /* symbol isn't used (and not stock) */
|
error(203,sym->name,sym->lnumber); /* symbol isn't used (and not stock) */
|
||||||
|
@ -1343,8 +1343,19 @@ static int command(void)
|
|||||||
} /* if */
|
} /* if */
|
||||||
break;
|
break;
|
||||||
default: {
|
default: {
|
||||||
char s2[20];
|
|
||||||
extern char *sc_tokens[];/* forward declaration */
|
extern char *sc_tokens[];/* forward declaration */
|
||||||
|
char s2[33]="-";
|
||||||
|
if ((char)tok=='-') {
|
||||||
|
if (lex(&val,&str)==tNUMBER) {
|
||||||
|
outval(-val,FALSE);
|
||||||
|
code_idx+=opargs(1);
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
strcpy(s2+1, str);
|
||||||
|
error(1,sc_tokens[tSYMBOL-tFIRST],s2);
|
||||||
|
break;
|
||||||
|
} /* if */
|
||||||
|
} /* if */
|
||||||
if (tok<256)
|
if (tok<256)
|
||||||
sprintf(s2,"%c",(char)tok);
|
sprintf(s2,"%c",(char)tok);
|
||||||
else
|
else
|
||||||
|
@ -160,26 +160,26 @@ static uint32_t *align32(uint32_t *v)
|
|||||||
#if PAWN_CELL_SIZE>=64
|
#if PAWN_CELL_SIZE>=64
|
||||||
static uint64_t *align64(uint64_t *v)
|
static uint64_t *align64(uint64_t *v)
|
||||||
{
|
{
|
||||||
unsigned char *s = (unsigned char *)v;
|
unsigned char *s = (unsigned char *)v;
|
||||||
unsigned char t;
|
unsigned char t;
|
||||||
|
|
||||||
t=s[0];
|
t=s[0];
|
||||||
s[0]=s[7];
|
s[0]=s[7];
|
||||||
s[7]=t;
|
s[7]=t;
|
||||||
|
|
||||||
t=s[1];
|
t=s[1];
|
||||||
s[1]=s[6];
|
s[1]=s[6];
|
||||||
s[6]=t;
|
s[6]=t;
|
||||||
|
|
||||||
t=s[2];
|
t=s[2];
|
||||||
s[2]=s[5];
|
s[2]=s[5];
|
||||||
s[5]=t;
|
s[5]=t;
|
||||||
|
|
||||||
t=s[3];
|
t=s[3];
|
||||||
s[3]=s[4];
|
s[3]=s[4];
|
||||||
s[4]=t;
|
s[4]=t;
|
||||||
|
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -747,7 +747,8 @@ SC_FUNC int assemble(FILE *fout,FILE *fin)
|
|||||||
mainaddr=sym->addr;
|
mainaddr=sym->addr;
|
||||||
} /* if */
|
} /* if */
|
||||||
} else if (sym->ident==iVARIABLE) {
|
} else if (sym->ident==iVARIABLE) {
|
||||||
if ((sym->usage & uPUBLIC)!=0)
|
if ((sym->usage & uPUBLIC)!=0
|
||||||
|
&& ((sym->usage & uSTOCK)==0 || (sym->usage & (uREAD | uWRITTEN))!=0))
|
||||||
match=++numpubvars;
|
match=++numpubvars;
|
||||||
} /* if */
|
} /* if */
|
||||||
if (match) {
|
if (match) {
|
||||||
@ -925,6 +926,8 @@ SC_FUNC int assemble(FILE *fout,FILE *fin)
|
|||||||
count=0;
|
count=0;
|
||||||
for (sym=glbtab.next; sym!=NULL; sym=sym->next) {
|
for (sym=glbtab.next; sym!=NULL; sym=sym->next) {
|
||||||
if (sym->ident==iVARIABLE && (sym->usage & uPUBLIC)!=0) {
|
if (sym->ident==iVARIABLE && (sym->usage & uPUBLIC)!=0) {
|
||||||
|
if ((sym->usage & uSTOCK)!=0 && (sym->usage & (uREAD | uWRITTEN))==0)
|
||||||
|
continue;
|
||||||
assert((sym->usage & uDEFINE)!=0);
|
assert((sym->usage & uDEFINE)!=0);
|
||||||
assert(sym->vclass==sGLOBAL);
|
assert(sym->vclass==sGLOBAL);
|
||||||
func.address=sym->addr;
|
func.address=sym->addr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user