arrays can now be public variables

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40132
This commit is contained in:
David Anderson 2006-10-31 07:17:23 +00:00
parent 0196df3cc9
commit 4f5f8dced9
2 changed files with 6 additions and 3 deletions

View File

@ -1678,8 +1678,10 @@ static void declglb(char *firstname,int firsttag,int fpublic,int fstatic,int fst
if (size > INT_MAX)
error(105); /* overflow, exceeding capacity */
#endif
#if 0 /* We don't actually care */
if (ispublic)
error(56,name); /* arrays cannot be public */
#endif
dim[numdim++]=(int)size;
} /* while */
assert(sc_curstates==0);
@ -1857,7 +1859,7 @@ static void declglb(char *firstname,int firsttag,int fpublic,int fstatic,int fst
assert(sym!=NULL);
sc_curstates=0;
if (ispublic)
sym->usage|=uPUBLIC;
sym->usage|=uPUBLIC|uREAD;
if (fconst)
sym->usage|=uCONST;
if (fstock)

View File

@ -713,7 +713,7 @@ SC_FUNC int assemble(FILE *fout,FILE *fin)
assert(sym->vclass==sGLOBAL);
mainaddr=sym->addr;
} /* if */
} else if (sym->ident==iVARIABLE) {
} else if (sym->ident==iVARIABLE || sym->ident == iARRAY || sym->ident == iREFARRAY) {
if ((sym->usage & uPUBLIC)!=0 && (sym->usage & (uREAD | uWRITTEN))!=0)
match=++numpubvars;
} /* if */
@ -891,7 +891,8 @@ SC_FUNC int assemble(FILE *fout,FILE *fin)
/* write the public variables table */
count=0;
for (sym=glbtab.next; sym!=NULL; sym=sym->next) {
if (sym->ident==iVARIABLE && (sym->usage & uPUBLIC)!=0 && (sym->usage & (uREAD | uWRITTEN))!=0) {
if ((sym->ident==iVARIABLE || sym->ident==iARRAY || sym->ident==iREFARRAY)
&& (sym->usage & uPUBLIC)!=0 && (sym->usage & (uREAD | uWRITTEN))!=0) {
assert((sym->usage & uDEFINE)!=0);
assert(sym->vclass==sGLOBAL);
func.address=sym->addr;