VFS: Fix various things

- The "ALL" fake pathID is replaced by what does SM, having a public var NULL_STRING which will acts as NULL when needed.
  To make compiler accepting public array, this patch was needed: https://hg.alliedmods.net/sourcemod-central/rev/b12f329def09
- The offset thing in read_dir: considering that's something very specific to this native and that implementation in CDirectory doesn't make sense because of the offset compatibility for windows, all code is now in the native.
This commit is contained in:
Arkshine
2015-03-25 13:50:07 +01:00
parent 8f6b8588c1
commit 52c73126e1
12 changed files with 101 additions and 97 deletions

View File

@ -1895,8 +1895,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 */
/* if this variable is never used (which can be detected only in the
@ -1936,7 +1938,7 @@ static void declglb(char *firstname,int firsttag,int fpublic,int fstatic,int fst
sym->usage|=uDEFINE;
} /* if */
if (ispublic)
sym->usage|=uPUBLIC;
sym->usage|=uPUBLIC|uREAD;
if (fconst)
sym->usage|=uCONST;
if (fstock)

View File

@ -619,7 +619,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 */
@ -794,7 +794,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;