diff --git a/amx/amx.c b/amx/amx.c index d5b9150..de7bfc3 100644 --- a/amx/amx.c +++ b/amx/amx.c @@ -14,7 +14,7 @@ * License for the specific language governing permissions and limitations * under the License. * - * Version: $Id: amx.c 6973 2023-08-05 20:07:04Z thiadmer $ + * Version: $Id: amx.c 7151 2024-03-23 16:08:18Z thiadmer $ */ #define WIN32_LEAN_AND_MEAN @@ -93,7 +93,7 @@ #define AMX_EXPLIT_FUNCTIONS #endif #if !defined AMX_EXPLIT_FUNCTIONS - /* no constant set, set them all */ + /* no constant set, set them all (except amx_InitJIT() and other JIT support) */ #define AMX_ALIGN /* amx_Align16(), amx_Align32() and amx_Align64() */ #define AMX_ALLOT /* amx_Allot() and amx_Release() */ #define AMX_DEFCALLBACK /* amx_Callback() */ @@ -102,7 +102,6 @@ #define AMX_EXEC /* amx_Exec() */ #define AMX_FLAGS /* amx_Flags() */ #define AMX_INIT /* amx_Init() */ - #define AMX_JIT /* amx_InitJIT() and other JIT support */ #define AMX_MEMINFO /* amx_MemInfo() */ #define AMX_NAMELENGTH /* amx_NameLength() */ #define AMX_NATIVEINFO /* amx_NativeInfo() */ diff --git a/amx/amx.h b/amx/amx.h index 26403e5..1e12c11 100644 --- a/amx/amx.h +++ b/amx/amx.h @@ -14,7 +14,7 @@ * License for the specific language governing permissions and limitations * under the License. * - * Version: $Id: amx.h 6965 2023-07-20 15:44:35Z thiadmer $ + * Version: $Id: amx.h 7152 2024-03-23 20:47:23Z thiadmer $ */ #ifndef AMX_H_INCLUDED @@ -158,7 +158,7 @@ extern "C" { #define AMXAPI __stdcall #elif defined CDECL #define AMXAPI __cdecl - #elif defined GCC_HASCLASSVISIBILITY + #elif defined GCC_HASCLASSVISIBILITY && defined __cplusplus #define AMXAPI __attribute__((visibility("default"))) #else #define AMXAPI @@ -263,7 +263,7 @@ typedef int (AMXAPI *AMX_IDLE)(struct tagAMX *amx, int AMXAPI Exec(struct tagAMX #else #pragma pack(push) #pragma pack(1) /* structures must be packed (byte-aligned) */ - #if defined __TURBOC__ + #if defined __BORLANDC__ #pragma option -a- /* "pack" pragma for older Borland compilers */ #endif #endif diff --git a/amx/amxdbg.h b/amx/amxdbg.h index f027c5b..99cfaf3 100644 --- a/amx/amxdbg.h +++ b/amx/amxdbg.h @@ -17,7 +17,7 @@ * License for the specific language governing permissions and limitations * under the License. * - * Version: $Id: amxdbg.h 6131 2020-04-29 19:47:15Z thiadmer $ + * Version: $Id: amxdbg.h 7152 2024-03-23 20:47:23Z thiadmer $ */ #ifndef AMXDBG_H_INCLUDED @@ -52,7 +52,7 @@ extern "C" { #else #pragma pack(push) #pragma pack(1) /* structures must be packed (byte-aligned) */ - #if defined __TURBOC__ + #if defined __BORLANDC__ #pragma option -a- /* "pack" pragma for older Borland compilers */ #endif #endif diff --git a/amx/amxfile.c b/amx/amxfile.c index 2b4d9c4..a437653 100644 --- a/amx/amxfile.c +++ b/amx/amxfile.c @@ -14,7 +14,7 @@ * License for the specific language governing permissions and limitations * under the License. * - * Version: $Id: amxfile.c 6965 2023-07-20 15:44:35Z thiadmer $ + * Version: $Id: amxfile.c 6969 2023-07-26 12:26:41Z thiadmer $ */ #if defined _UNICODE || defined __UNICODE__ || defined UNICODE # if !defined UNICODE /* for Windows */ diff --git a/amx/amxtime.c b/amx/amxtime.c index 7b3842b..ec727c1 100644 --- a/amx/amxtime.c +++ b/amx/amxtime.c @@ -14,7 +14,7 @@ * License for the specific language governing permissions and limitations * under the License. * - * Version: $Id: amxtime.c 6965 2023-07-20 15:44:35Z thiadmer $ + * Version: $Id: amxtime.c 6969 2023-07-26 12:26:41Z thiadmer $ */ #include #include diff --git a/amx/minIni.c b/amx/minIni.c index b7a3060..a66d2ef 100644 --- a/amx/minIni.c +++ b/amx/minIni.c @@ -17,7 +17,7 @@ * License for the specific language governing permissions and limitations * under the License. * - * Version: $Id: minIni.c 5691 2017-06-09 19:48:22Z thiadmer $ + * Version: $Id: minIni.c 6965 2023-07-20 15:44:35Z thiadmer $ */ #if (defined _UNICODE || defined __UNICODE__ || defined UNICODE) && !defined INI_ANSIONLY diff --git a/amx/osdefs.h b/amx/osdefs.h index 4fa6787..2675ada 100644 --- a/amx/osdefs.h +++ b/amx/osdefs.h @@ -84,20 +84,20 @@ * eCos option management. */ #include - #if CYGPKG_PAWN_AMX_ANSIONLY==1 + #if defined CYGPKG_PAWN_AMX_ANSIONLY && CYGPKG_PAWN_AMX_ANSIONLY==1 #define AMX_ANSIONLY #endif #define PAWN_CELL_SIZE CYGPKG_PAWN_AMX_CELLSIZE - #if CYGPKG_PAWN_CORE_RANDOM==0 + #if defined CYGPKG_PAWN_CORE_RANDOM && CYGPKG_PAWN_CORE_RANDOM==0 #define AMX_NORANDOM #endif - #if CYGPKG_PAWN_CORE_PROPERTY==0 + #if defined CYGPKG_PAWN_CORE_PROPERTY && CYGPKG_PAWN_CORE_PROPERTY==0 #define AMX_NOPROPLIST #endif - #if CYGPKG_PAWN_AMX_CONS_FIXEDPOINT==1 + #if defined CYGPKG_PAWN_AMX_CONS_FIXEDPOINT && CYGPKG_PAWN_AMX_CONS_FIXEDPOINT==1 #define FIXEDPOINT #endif - #if CYGPKG_PAWN_AMX_CONS_FLOATPOINT==1 + #if defined CYGPKG_PAWN_AMX_CONS_FLOATPOINT && CYGPKG_PAWN_AMX_CONS_FLOATPOINT==1 #define FLOATPOINT #endif #endif diff --git a/amx/pawndbg.c b/amx/pawndbg.c index b81654c..9a2ce4f 100644 --- a/amx/pawndbg.c +++ b/amx/pawndbg.c @@ -28,7 +28,7 @@ * License for the specific language governing permissions and limitations * under the License. * - * Version: $Id: pawndbg.c 6131 2020-04-29 19:47:15Z thiadmer $ + * Version: $Id: pawndbg.c 7133 2024-03-05 10:31:12Z thiadmer $ * * * Command line options: @@ -1228,12 +1228,12 @@ static void remote_write_rs232(AMX *amx,cell vaddr,int number) while (number>0) { num=(number>10) ? 10 : number; number-=num; - sprintf(buffer,"?W%lx",(long)vaddr); + sprintf(buffer,"?W%lx",(unsigned long)vaddr); while (num>0) { cptr=VirtAddressToPhys(amx,vaddr); assert(cptr!=NULL); strcat(buffer,","); - sprintf(buffer+strlen(buffer),"%x",*cptr); + sprintf(buffer+strlen(buffer),"%lx",(unsigned long)*cptr); num--; vaddr+=sizeof(cell); } /* while */ diff --git a/compiler/libpawnc.c b/compiler/libpawnc.c index 12a8780..cf6650b 100644 --- a/compiler/libpawnc.c +++ b/compiler/libpawnc.c @@ -16,7 +16,7 @@ * License for the specific language governing permissions and limitations * under the License. * - * Version: $Id: libpawnc.c 6131 2020-04-29 19:47:15Z thiadmer $ + * Version: $Id: libpawnc.c 7152 2024-03-23 20:47:23Z thiadmer $ */ #include #include @@ -124,12 +124,10 @@ int pc_printf(const char *message,...) */ int pc_error(int number,const char *message,const char *filename,int firstline,int lastline,va_list argptr) { -static char *prefix[3]={ "error", "fatal error", "warning" }; +static const char *prefix[3]={ "error", "fatal error", "warning" }; if (number!=0) { - char *pre; - - pre=prefix[number/100]; + const char *pre=prefix[number/100]; if (firstline>=0) fprintf(stderr,"%s(%d -- %d) : %s %03d: ",filename,firstline,lastline,pre,number); else @@ -252,7 +250,7 @@ int pc_eofsrc(void *handle) /* should return a pointer, which is used as a "magic cookie" to all I/O * functions; return NULL for failure */ -void *pc_openasm(char *filename) +void *pc_openasm(const char *filename) { #if defined __MSDOS__ || defined PAWN_LIGHT return fopen(filename,"w+t"); @@ -309,7 +307,7 @@ char *pc_readasm(void *handle, char *string, int maxchars) /* Should return a pointer, which is used as a "magic cookie" to all I/O * functions; return NULL for failure. */ -void *pc_openbin(char *filename) +void *pc_openbin(const char *filename) { return fopen(filename,"wb"); } diff --git a/compiler/pawndisasm.c b/compiler/pawndisasm.c index 45beef3..397ac1b 100644 --- a/compiler/pawndisasm.c +++ b/compiler/pawndisasm.c @@ -14,7 +14,7 @@ * License for the specific language governing permissions and limitations * under the License. * - * Version: $Id: pawndisasm.c 6969 2023-07-26 12:26:41Z thiadmer $ + * Version: $Id: pawndisasm.c 6970 2023-07-28 20:12:00Z thiadmer $ */ #include #include diff --git a/compiler/sc.h b/compiler/sc.h index 29c9532..738dbb6 100644 --- a/compiler/sc.h +++ b/compiler/sc.h @@ -7,7 +7,7 @@ * * This version comes close to a complete rewrite. * - * Copyright CompuPhase, 1997-2020 + * Copyright CompuPhase, 1997-2024 * Copyright J.E. Hendrix, 1982, 1983 * Copyright R. Cain, 1980 * @@ -23,7 +23,7 @@ * License for the specific language governing permissions and limitations * under the License. * - * Version: $Id: sc.h 7108 2024-02-19 22:02:45Z thiadmer $ + * Version: $Id: sc.h 7152 2024-03-23 20:47:23Z thiadmer $ */ #ifndef SC_H_INCLUDED #define SC_H_INCLUDED @@ -545,14 +545,14 @@ void pc_resetsrc(void *handle,void *position); /* reset to a position marked int pc_eofsrc(void *handle); /* output to intermediate (.ASM) file */ -void *pc_openasm(char *filename); /* read/write */ +void *pc_openasm(const char *filename); /* read/write */ void pc_closeasm(void *handle,int deletefile); void pc_resetasm(void *handle); int pc_writeasm(void *handle,const char *str); char *pc_readasm(void *handle,char *target,int maxchars); /* output to binary (.AMX) file */ -void *pc_openbin(char *filename); +void *pc_openbin(const char *filename); void pc_closebin(void *handle,int deletefile); void pc_resetbin(void *handle,long offset); int pc_writebin(void *handle,const void *buffer,int size); @@ -577,13 +577,13 @@ long pc_lengthbin(void *handle); /* return the length of the file */ #endif /* function prototypes in SC1.C */ -SC_FUNC void set_extension(char *filename,char *extension,int force); +SC_FUNC void set_extension(char *filename,const char *extension,int force); SC_FUNC symbol *fetchfunc(const char *name,int tag); SC_FUNC char *operator_symname(char *symname,char *opername,int tag1,int tag2,int numtags,int resulttag); SC_FUNC char *funcdisplayname(char *dest,const char *funcname); SC_FUNC int constexpr(cell *val,int *tag,symbol **symptr); SC_FUNC constvalue *append_constval(constvalue *table,const char *name,cell val,int index); -SC_FUNC constvalue *find_constval(constvalue *table,char *name,int index); +SC_FUNC constvalue *find_constval(constvalue *table,const char *name,int index); SC_FUNC void delete_consttable(constvalue *table); SC_FUNC int compare_consttable(constvalue *table1, constvalue *table2); SC_FUNC symbol *add_constant(const char *name,cell val,int scope,int tag); @@ -598,17 +598,17 @@ SC_FUNC void sc_attachdocumentation(symbol *sym,int onlylastblock); SC_FUNC void pushstk(stkitem val); SC_FUNC stkitem popstk(void); SC_FUNC void clearstk(void); -SC_FUNC int plungequalifiedfile(char *name); /* explicit path included */ +SC_FUNC int plungequalifiedfile(const char *name); /* explicit path included */ SC_FUNC int plungefile(char *name,int try_currentpath,int try_includepaths); /* search through "include" paths */ SC_FUNC char *strdel(char *str,size_t len); -SC_FUNC char *strins(char *dest,char *src,size_t srclen); +SC_FUNC char *strins(char *dest,const char *src,size_t srclen); SC_FUNC void preprocess(void); SC_FUNC void lex_fetchindent(const unsigned char *string,const unsigned char *pos); SC_FUNC int lex_adjusttabsize(int matchindent); SC_FUNC int lexinit(int releaseall); SC_FUNC int lex(cell *lexvalue,char **lexsym); SC_FUNC void lexpush(void); -SC_FUNC int lexsettoken(int token,char *str); +SC_FUNC int lexsettoken(int token,const char *str); SC_FUNC void lexclr(int clreol); SC_FUNC int lexpeek(void); SC_FUNC int matchtoken(int token); @@ -650,7 +650,7 @@ SC_FUNC void writestatetables(symbol *root,int lbl_nostate,int lbl_ignorestate); SC_FUNC void begcseg(void); SC_FUNC void begdseg(void); SC_FUNC void setline(int chkbounds); -SC_FUNC void setfiledirect(char *name); +SC_FUNC void setfiledirect(const char *name); SC_FUNC void setlinedirect(int line); SC_FUNC void setlabel(int index); SC_FUNC void markexpr(optmark type,const char *name,cell offset); @@ -664,7 +664,7 @@ SC_FUNC void loadreg(cell address,regid reg); SC_FUNC void storereg(cell address,regid reg); SC_FUNC void memcopy(cell size); SC_FUNC void copyarray2d(int majordim,int minordim); -SC_FUNC void fillarray(symbol *sym,cell size,cell value); +SC_FUNC void fillarray(const symbol *sym,cell size,cell value); SC_FUNC void ldconst(cell val,regid reg); SC_FUNC void swapregs(void); SC_FUNC void pushreg(regid reg); @@ -833,7 +833,7 @@ SC_FUNC constvalue *state_add(const char *name,int fsa_id); SC_FUNC constvalue *state_find(const char *name,int fsa_id,char *closestmatch); SC_FUNC constvalue *state_findid(int id,int fsa_id); SC_FUNC void state_buildlist(int **list,int *listsize,int *count,int stateid); -SC_FUNC int state_addlist(int *list,int count,int fsa_id); +SC_FUNC int state_addlist(const int *list,int count,int fsa_id); SC_FUNC void state_deletetable(void); SC_FUNC int state_getfsa(int listid); SC_FUNC int state_count(int listid); @@ -850,7 +850,7 @@ SC_VDECL symbol loctab; /* local symbol table */ SC_VDECL symbol glbtab; /* global symbol table */ SC_VDECL cell *litq; /* the literal queue */ SC_VDECL unsigned char *srcline;/* the line read from the input file */ -SC_VDECL const unsigned char *lptr;/* points to the current position in "srcline" */ +SC_VDECL const unsigned char *lexptr;/* points to the current position in "srcline" */ SC_VDECL constvalue tagname_tab;/* tagname table */ SC_VDECL constvalue libname_tab;/* library table (#pragma library "..." syntax) */ SC_VDECL constvalue *curlibrary;/* current library */ diff --git a/compiler/sc1.c b/compiler/sc1.c index 63f90d9..e5a1968 100644 --- a/compiler/sc1.c +++ b/compiler/sc1.c @@ -23,7 +23,7 @@ * License for the specific language governing permissions and limitations * under the License. * - * Version: $Id: sc1.c 7113 2024-02-25 21:29:31Z thiadmer $ + * Version: $Id: sc1.c 7152 2024-03-23 20:47:23Z thiadmer $ */ #include #include @@ -87,10 +87,10 @@ static void resetglobals(void); static void initglobals(void); -static char *get_extension(char *filename); +static char *get_extension(const char *filename); static void setopt(int argc,char **argv,char *oname,char *ename,char *pname, char *rname,char *codepage); -static void setconfig(char *root); +static void setconfig(const char *root); static void setcaption(void); static void about(void); static void setconstants(void); @@ -99,7 +99,7 @@ static void parse(void); static void dumplits(void); static void dumpzero(int count); static void declfuncvar(int fpublic,int fstatic,int fstock,int fconst); -static void declglb(char *firstname,int firsttag,int fpublic,int fstatic, +static void declglb(const char *firstname,int firsttag,int fpublic,int fstatic, int stock,int fconst); static int declloc(int fstatic); static void decl_const(int table); @@ -116,9 +116,9 @@ static cell init(int ident,int usage,int *tag,int *errorfound,int *packcount,cel static int getstates(const char *funcname); static statelist *attachstatelist(symbol *sym,int state_id); static void funcstub(int fnative); -static int newfunc(char *firstname,int firsttag,int fpublic,int fstatic,int stock); +static int newfunc(const char *firstname,int firsttag,int fpublic,int fstatic,int stock); static int declargs(symbol *sym,int chkshadow); -static void doarg(char *name,int ident,int offset,int tags[],int numtags, +static void doarg(char *name,int ident,int offset,const int tags[],int numtags, int fpublic,int fconst,int chkshadow,arginfo *arg); static void make_report(symbol *root,FILE *log,const char *sourcefile,int *makestategraph); static void reduce_referrers(symbol *root); @@ -131,7 +131,7 @@ static int test_skippedundef(void); static void destructsymbols(symbol *root,int level); static constvalue *find_constval_byval(constvalue *table,cell val); static constvalue *clone_consttable(const constvalue *table); -static symbol *fetchlab(char *name); +static symbol *fetchlab(const char *name); static void statement(int *lastindent,int allow_decl); static void compound(int stmt_sameline); static int test(int label,int parens,int invert); @@ -166,8 +166,8 @@ static int sc_reparse =0; /* needs 3th parse because of changed prototypes static int sc_parsenum=0; /* number of the extra parses */ static int undefined_vars=FALSE;/* if TRUE, undefined symbols were found */ static int pc_enumsequence=0; /* sequence number of enumerated constant lists, for reporting these lists */ -static int wq[wqTABSZ]; /* "while queue", internal stack for nested loops */ -static int *wqptr; /* pointer to next entry */ +static int wq_glb[wqTABSZ]; /* "while queue", internal stack for nested loops */ +static int *wq_ptr; /* pointer to next entry */ #if !defined PAWN_LIGHT static char sc_rootpath[_MAX_PATH]; /* base path of the installation */ static char sc_binpath[_MAX_PATH]; /* path for the binaries, often sc_rootpath + /bin */ @@ -224,7 +224,7 @@ int pc_error(int number,const char *message,const char *filename,int firstline,i static char *prefix[3]={ "error", "fatal error", "warning" }; if (number!=0) { - char *pre; + const char *pre; pre=prefix[number/100]; if (firstline>=0) @@ -350,7 +350,7 @@ int pc_eofsrc(void *handle) /* should return a pointer, which is used as a "magic cookie" to all I/O * functions; return NULL for failure */ -void *pc_openasm(char *filename) +void *pc_openasm(const char *filename) { #if defined __MSDOS__ || defined PAWN_LIGHT return fopen(filename,"w+"); @@ -407,7 +407,7 @@ char *pc_readasm(void *handle, char *string, int maxchars) /* Should return a pointer, which is used as a "magic cookie" to all I/O * functions; return NULL for failure. */ -void *pc_openbin(char *filename) +void *pc_openbin(const char *filename) { return fopen(filename,"wb"); } @@ -688,7 +688,7 @@ int pc_compile(int argc, char *argv[]) spawnl(P_WAIT,pgmname,pgmname,reportname,dotname,NULL); #else snprintf(pgmname,sizearray(pgmname),"%s%cstategraph",sc_binpath,DIRSEP_CHAR); - posix_spawnl(pgmname,reportname,dotname,NULL); + posix_spawnl(pgmname,reportname,dotname,(void*)0); #endif } } /* if */ @@ -1037,11 +1037,11 @@ static void initglobals(void) libname_tab.next=NULL;/* library table (#pragma library "..." syntax) */ ntvindex_tab.next=NULL; - lptr=NULL; /* points to the current position in "srcline" */ + lexptr=NULL; /* points to the current position in "srcline" */ curlibrary=NULL; /* current library */ inpf_org=NULL; /* main source file */ - wqptr=wq; /* initialize while queue pointer */ + wq_ptr=wq_glb; /* initialize while queue pointer */ #if !defined PAWN_LIGHT pc_globaldoc=NULL; @@ -1051,7 +1051,7 @@ static void initglobals(void) #endif } -static char *get_extension(char *filename) +static char *get_extension(const char *filename) { char *ptr; @@ -1069,7 +1069,7 @@ static char *get_extension(char *filename) * Set the default extension, or force an extension. To erase the * extension of a filename, set "extension" to an empty string. */ -SC_FUNC void set_extension(char *filename,char *extension,int force) +SC_FUNC void set_extension(char *filename,const char *extension,int force) { char *ptr; @@ -1524,7 +1524,7 @@ static void setopt(int argc,char **argv,char *oname,char *ename,char *pname, #if defined __BORLANDC__ || defined __WATCOMC__ #pragma argsused #endif -static void setconfig(char *root) +static void setconfig(const char *root) { char path[_MAX_PATH]=""; char *ptr,*base; @@ -1747,11 +1747,12 @@ void sc_attachdocumentation(symbol *sym,int onlylastblock) * append it to the global documentation */ int wrap=0; - char *str,*end; + char *str; length=strlen(pc_recentdoc); if (onlylastblock) { assert(sym!=NULL); str=sym->documentation; + wrap=1; } else { str=pc_globaldoc; } /* if */ @@ -1760,6 +1761,7 @@ void sc_attachdocumentation(symbol *sym,int onlylastblock) length+=strlen(str)+1+4; /* plus 4 for "

" */ doc=(char*)malloc((length+1)*sizeof(char)); if (doc!=NULL) { + char *end; if (str!=NULL) { strcpy(doc,str); free(str); @@ -1852,7 +1854,7 @@ void sc_attachdocumentation(symbol *sym,int onlylastblock) static void insert_docstring_separator(void) { - char sep[2]={sDOCSEP,'\0'}; + const char sep[2]={sDOCSEP,'\0'}; insert_docstring(sep,1); } #else @@ -2171,7 +2173,7 @@ static void declfuncvar(int fpublic,int fstatic,int fstock,int fconst) * * global references: glb_declared (altered) */ -static void declglb(char *firstname,int firsttag,int fpublic,int fstatic,int fstock,int fconst) +static void declglb(const char *firstname,int firsttag,int fpublic,int fstatic,int fstock,int fconst) { int ident,tag,ispublic,usage; char name[sNAMEMAX+1]; @@ -2755,9 +2757,9 @@ static void initials(int ident,int usage,int tag,cell *size,int dim[],int numdim int curlit=litidx; if (!matchtoken('=')) { - cell tablesize; assert(ident!=iARRAY || numdim>0); if (ident==iARRAY) { + cell tablesize; int i; assert(numdim>0 && numdim<=sDIMEN_MAX); for (i=0; iid); for (idx=0; idxid,idx); - int fsa=state_getfsa(stlist->id); + int state_id_local=state_listitem(stlist->id,idx); + int fsa_local=state_getfsa(stlist->id); size_t len; char *doc; - constvalue *state=state_findid(state_id,fsa); + const constvalue *state=state_findid(state_id_local,fsa_local); assert(state!=NULL); len=strlen(state->name)+50; /* +50 for the fixed part of "defvalue.size.symname=duplicatestring(name)) == NULL) + tokeninfo(&val,&symname); + if ((arg->defvalue.size.symname=duplicatestring(symname)) == NULL) error(103); /* insufficient memory */ arg->defvalue.size.level=0; if (size_tag_token==uSIZEOF) { @@ -4619,7 +4621,7 @@ static void doarg(char *name,int ident,int offset,int tags[],int numtags, } /* if */ } -static int count_referrers(symbol *entry) +static int count_referrers(const symbol *entry) { int i,count; @@ -4631,13 +4633,14 @@ static int count_referrers(symbol *entry) } #if !defined PAWN_LIGHT -static int find_xmltag(char *source,char *xmltag,char *xmlparam,char *xmlvalue, +static int find_xmltag(char *source, + const char *xmltag,const char *xmlparam,const char *xmlvalue, char **outer_start,int *outer_length, char **inner_start,int *inner_length) { - char *ptr,*inner_end; + char *ptr; + const char *inner_end; size_t xmltag_len,xmlparam_len,xmlvalue_len; - int match; assert(source!=NULL); assert(xmltag!=NULL); @@ -4655,6 +4658,7 @@ static int find_xmltag(char *source,char *xmltag,char *xmlparam,char *xmlvalue, ptr=source; /* find an opening '<' */ while ((ptr=strchr(ptr,'<'))!=NULL) { + int match; *outer_start=ptr; /* be optimistic... */ match=FALSE; /* ...and pessimistic at the same time */ ptr++; /* skip '<' */ @@ -4764,9 +4768,6 @@ static char *xmlencode(char *dest,char *source) static void write_docstring(FILE *log,const char *string) { - int len; - const char *ptr; - if (string==NULL) return; while (*string<=' ' && *string!='\0') @@ -4777,7 +4778,8 @@ static void write_docstring(FILE *log,const char *string) assert(strchr(string,sDOCSEP)==NULL); /* optionally wrap in "

...", check whether this must happen */ if (*string!='<') { /* wrap in "summary" */ - len=0; + const char *ptr; + int len=0; for (ptr=string; *ptr!='\0' && *ptr!='<' && *ptr!='.'; ptr++) len++; if (*ptr=='.') @@ -4787,8 +4789,6 @@ static void write_docstring(FILE *log,const char *string) string+=len; while (*string<=' ' && *string!='\0') string++; /* skip white space */ - } else { - len=0; } /* if */ if (*string!='\0') @@ -4800,7 +4800,7 @@ static void make_report(symbol *root,FILE *log,const char *sourcefile,int *makes char symname[_MAX_PATH]; int i,arg,dim,count,tag; symbol *sym,*ref; - constvalue *tagsym; + const constvalue *tagsym; char *ptr; /* adapt the installation directory */ @@ -5028,7 +5028,7 @@ static void make_report(symbol *root,FILE *log,const char *sourcefile,int *makes // fprintf(log,"\t\t\t\n",(long)sym->codeaddr - sym->addr); if (sym->states!=NULL) { statelist *stlist=sym->states->next; - constvalue *fsa; + const constvalue *fsa; assert(stlist!=NULL); /* there should be at least one state item */ while (stlist!=NULL && stlist->id==FALLBACK) stlist=stlist->next; @@ -5196,11 +5196,10 @@ static void reduce_referrers(symbol *root) */ static void gen_ovlinfo(symbol *root) { - int idx=0; - symbol *sym; - int i; - if (pc_overlays>0) { + int idx=0; + symbol *sym; + int i; assert(pc_ovl0size[ovlEXIT][1]!=0); /* if this fails, writeleader() was not called */ for (i=0; inext; @@ -5906,7 +5905,7 @@ static void compound(int stmt_sameline) /* if there is more text on this line, we should adjust the statement indent */ if (stmt_sameline) { - const unsigned char *p=lptr-1; + const unsigned char *p=lexptr-1; /* go back to the opening brace */ while (*p!='{') { assert(p>srcline); @@ -6514,7 +6513,7 @@ static void dolabel(void) * Note: The "_usage" bit is set to zero. The routines that call "fetchlab()" * must set this bit accordingly. */ -static symbol *fetchlab(char *name) +static symbol *fetchlab(const char *name) { symbol *sym; @@ -6681,7 +6680,7 @@ static void doreturn(void) static void dobreak(void) { - int *ptr; + const int *ptr; endlessloop=0; /* if we were inside an endless loop, we just jumped out */ ptr=readwhile(); /* readwhile() gives an error if not in loop */ @@ -6695,7 +6694,7 @@ static void dobreak(void) static void docont(void) { - int *ptr; + const int *ptr; ptr=readwhile(); /* readwhile() gives an error if not in loop */ needtoken(tTERM); @@ -6913,7 +6912,6 @@ static void dostate(void) delete_autolisttable(); } - static void addwhile(int *ptr) { int k; @@ -6922,12 +6920,12 @@ static void addwhile(int *ptr) ptr[wqCONT]=(int)declared; /* for "continue", possibly adjusted later */ ptr[wqLOOP]=getlabel(); ptr[wqEXIT]=getlabel(); - if (wqptr>=(wq+wqTABSZ-wqSIZE)) + if (wq_ptr>=(wq_glb+wqTABSZ-wqSIZE)) error(102,"loop table"); /* loop table overflow (too many active loops)*/ k=0; while (kwq) - wqptr-=wqSIZE; + if (wq_ptr>wq_glb) + wq_ptr-=wqSIZE; } static int *readwhile(void) { - if (wqptr<=wq){ + if (wq_ptr<=wq_glb){ error(24); /* out of context */ return NULL; } else { - return (wqptr-wqSIZE); + return (wq_ptr-wqSIZE); } /* if */ } diff --git a/compiler/sc2.c b/compiler/sc2.c index 3ba8001..bfa724c 100644 --- a/compiler/sc2.c +++ b/compiler/sc2.c @@ -14,7 +14,7 @@ * License for the specific language governing permissions and limitations * under the License. * - * Version: $Id: sc2.c 7113 2024-02-25 21:29:31Z thiadmer $ + * Version: $Id: sc2.c 7152 2024-03-23 20:47:23Z thiadmer $ */ #include #include @@ -119,13 +119,14 @@ SC_FUNC void clearstk(void) assert(stktop==0); } -SC_FUNC int plungequalifiedfile(char *name) +SC_FUNC int plungequalifiedfile(const char *name) { -static char *extensions[] = { ".i", ".inc", ".p", ".pawn" }; +static const char *extensions[] = { ".i", ".inc", ".p", ".pawn" }; FILE *fp; char *ext; int ext_idx; + assert(name!=NULL); ext_idx=0; do { fp=(FILE*)pc_opensrc(name); @@ -178,7 +179,7 @@ SC_FUNC int plungefile(char *name,int try_currentpath,int try_includepaths) /* try to open the file in the same directory as the current file --but * first check whether there is a (relative) path for the current file */ - char *ptr; + const char *ptr; if ((ptr=strrchr(inpfname,DIRSEP_CHAR))!=0) { int len=(int)(ptr-inpfname)+1; if (len+strlen(name)<_MAX_PATH) { @@ -227,7 +228,7 @@ static void check_empty(const unsigned char *lptr) * * Global references: inpf (altered) * inpfname (altered) - * lptr (altered) + * lexptr (altered) */ static void doinclude(int silent) { @@ -237,31 +238,31 @@ static void doinclude(int silent) char c; int i, result; - while (*lptr<=' ' && *lptr!='\0') /* skip leading whitespace */ - lptr++; - if (*lptr=='<' || *lptr=='\"') { - c=(char)((*lptr=='\"') ? '\"' : '>'); /* termination character */ - lptr++; - while (*lptr<=' ' && *lptr!='\0') /* skip whitespace after quote */ - lptr++; + while (*lexptr<=' ' && *lexptr!='\0') /* skip leading whitespace */ + lexptr++; + if (*lexptr=='<' || *lexptr=='\"') { + c=(char)((*lexptr=='\"') ? '\"' : '>'); /* termination character */ + lexptr++; + while (*lexptr<=' ' && *lexptr!='\0') /* skip whitespace after quote */ + lexptr++; } else { c='\0'; } /* if */ i=0; - while (*lptr!=c && *lptr!='\0' && i0 && name[i-1]<=' ') i--; /* strip trailing whitespace */ assert(i>=0 && i=srcline && (lptr-srcline)<(int)strlen((char*)srcline)); /* lptr must point inside the string */ + assert(lexptr>=srcline && (lexptr-srcline)<(int)strlen((char*)srcline)); /* lexptr must point inside the string */ #if !defined NO_DEFINE /* preprocess the string */ substallpatterns(srcline,sLINEMAX); - assert(lptr>=srcline && (lptr-srcline)<(int)strlen((char*)srcline)); /* lptr must STILL point inside the string */ + assert(lexptr>=srcline && (lexptr-srcline)<(int)strlen((char*)srcline)); /* lexptr must STILL point inside the string */ #endif /* append a special symbol to the string, so the expression * analyzer won't try to read a next line when it encounters @@ -934,7 +935,7 @@ enum { * CMD_DIRECTIVE the line contains some other compiler directive * * Global variables: iflevel, ifstack (altered) - * lptr (altered) + * lexptr (altered) */ static int command(void) { @@ -944,11 +945,11 @@ static int command(void) int index; cell code_index; - while (*lptr<=' ' && *lptr!='\0') - lptr+=1; - if (*lptr=='\0') + while (*lexptr<=' ' && *lexptr!='\0') + lexptr+=1; + if (*lexptr=='\0') return CMD_EMPTYLINE; /* empty line */ - if (*lptr!='#') + if (*lexptr!='#') return SKIPPING ? CMD_CONDFALSE : CMD_NONE; /* it is not a compiler directive */ /* compiler directive found */ indent_nowarn=TRUE; /* allow loose indentation" */ @@ -957,7 +958,7 @@ static int command(void) * re-read the line */ if (!sc_needsemicolon && stgget(&index,&code_index)) { - lptr=term_expr; + lexptr=term_expr; return CMD_TERM; } /* if */ tok=lex(&val,&str); @@ -981,7 +982,7 @@ static int command(void) int symtok=lex(&val,&str); val=0; if (symtok==tSYMBOL) { - symbol *sym=findloc(str); + const symbol *sym=findloc(str); if (sym==NULL) sym=findglb(str,sGLOBAL); if (sym!=NULL @@ -999,7 +1000,7 @@ static int command(void) } ifstack[iflevel-1]=(char)(val ? PARSEMODE : SKIPMODE); } - check_empty(lptr); + check_empty(lexptr); break; case tpELSE: case tpELSEIF: @@ -1031,7 +1032,7 @@ static int command(void) if (skiplevel==iflevel) preproc_expr(&val,NULL); /* get, but ignore the expression */ else - lptr=(const unsigned char *)strchr((const char *)lptr,'\0'); + lexptr=(const unsigned char*)strchr((const char*)lexptr,'\0'); } /* if */ } else { /* previous conditions were all FALSE */ @@ -1042,7 +1043,7 @@ static int command(void) if (skiplevel==iflevel) { preproc_expr(&val,NULL); /* get value (or 0 on error) */ } else { - lptr=(const unsigned char *)strchr((const char *)lptr,'\0'); + lexptr=(const unsigned char*)strchr((const char *)lexptr,'\0'); val=0; } /* if */ ifstack[iflevel-1]=(char)(val ? PARSEMODE : SKIPMODE); @@ -1053,7 +1054,7 @@ static int command(void) } /* if */ } /* if */ } /* if */ - check_empty(lptr); + check_empty(lexptr); break; case tpENDIF: ret=CMD_IF; @@ -1065,7 +1066,7 @@ static int command(void) if (iflevel0) { free(inpfname); inpfname=duplicatestring(pathname); @@ -1092,7 +1093,7 @@ static int command(void) } /* if */ } /* if */ - check_empty(lptr); + check_empty(lexptr); break; case tpLINE: if (!SKIPPING) { @@ -1100,16 +1101,16 @@ static int command(void) error(8); /* invalid/non-constant expression */ pc_curline=(int)val; } /* if */ - check_empty(lptr); + check_empty(lexptr); break; case tpASSERT: if (!SKIPPING && (sc_debug & sCHKBOUNDS)!=0) { - for (str=(char*)lptr; *str<=' ' && *str!='\0'; str++) + for (str=(char*)lexptr; *str<=' ' && *str!='\0'; str++) /* nothing */; /* save start of expression */ preproc_expr(&val,NULL); /* get constant expression (or 0 on error) */ if (!val) error(110,str); /* assertion failed */ - check_empty(lptr); + check_empty(lexptr); } /* if */ break; case tpPRAGMA: @@ -1123,23 +1124,23 @@ static int command(void) #if !defined PAWN_NO_CODEPAGE } else if (strcmp(str,"codepage")==0) { char name[sNAMEMAX+1]; - while (*lptr<=' ' && *lptr!='\0') - lptr++; - if (*lptr=='"') { - lptr=getstring((unsigned char*)name,sizearray(name),lptr); + while (*lexptr<=' ' && *lexptr!='\0') + lexptr++; + if (*lexptr=='"') { + lexptr=getstring((unsigned char*)name,sizearray(name),lexptr); } else { int i; - for (i=0; i9) { error(68); /* invalid rational number precision */ digits=0; } /* if */ - if (*lptr==')') - lptr++; + if (*lexptr==')') + lexptr++; } /* if */ if (pc_cellsize<4) { error(68); /* rational numbers not supported on 16-bit cells */ @@ -1242,10 +1243,10 @@ static int command(void) do { symbol *sym; /* get the name */ - while (*lptr<=' ' && *lptr!='\0') - lptr++; - for (i=0; i' ' && *lptr!='[') { - litchar(&lptr,0); /* litchar() advances "lptr" and handles escape characters */ + while (*lexptr>' ' && *lexptr!='[') { + litchar(&lexptr,0); /* litchar() advances "lexptr" and handles escape characters */ count++; } /* while */ - end=lptr; + end=lexptr; /* check pattern to match */ if (!alpha(*start)) { error(74); /* pattern must start with an alphabetic character */ @@ -1328,72 +1329,72 @@ static int command(void) pattern=(char*)malloc(count+1); if (pattern==NULL) error(103); /* insufficient memory */ - lptr=start; + lexptr=start; count=0; - while (lptr!=end) { - assert(lptr=2 && isdigit(pattern[count-1]) && pattern[count-2]=='%') pattern[count-2]='\0'; /* find substitution string */ - while (*lptr<=' ' && *lptr!='\0') - lptr++; - matchbracket=(*lptr=='['); + while (*lexptr<=' ' && *lexptr!='\0') + lexptr++; + matchbracket=(*lexptr=='['); if (matchbracket) - lptr++; /* skip '[' */ + lexptr++; /* skip '[' */ nest=0; - start=lptr; /* save starting point of the match pattern */ + start=lexptr; /* save starting point of the match pattern */ count=0; end=NULL; if (matchbracket) { /* allow the substitution text to be split over multiple lines */ - while (*lptr!=']' || nest>0) { - if (*lptr=='\0') { + while (*lexptr!=']' || nest>0) { + if (*lexptr=='\0') { readline(srcline,TRUE); stripcom(srcline); - if (*lptr=='\0') + if (*lexptr=='\0') break; /* no next line */ - if (*lptr==']') + if (*lexptr==']') continue; } /* if */ - if (*lptr=='[') + if (*lexptr=='[') nest++; - else if (*lptr==']') + else if (*lexptr==']') nest--; count++; - lptr++; + lexptr++; } /* while */ - end=lptr; + end=lexptr; } else { /* the complete definition should appear on a single (logical) line */ - while (*lptr!='\0') { + while (*lexptr!='\0') { /* keep position of the start of trailing whitespace */ - if (*lptr<=' ') { + if (*lexptr<=' ') { if (end==NULL) - end=lptr; + end=lexptr; } else { end=NULL; } /* if */ count++; - lptr++; + lexptr++; } /* while */ if (end==NULL) - end=lptr; + end=lexptr; } /* if */ /* store matched substitution */ substitution=(char*)malloc(count+1); /* +1 for '\0' */ if (substitution==NULL) error(103); /* insufficient memory */ - lptr=start; + lexptr=start; count=0; - while (lptr!=end) { - assert(lptr32) @@ -1968,8 +1968,8 @@ SC_FUNC int lex_adjusttabsize(int matchindent) } /* if */ for (tabsize=2; tabsize<=8; tabsize++) { - mask=pc_indentmask; - indent=0; + int indent=0; + unsigned long mask=pc_indentmask; for (i=0; iident==iFUNCTN) { + arginfo *arg; + int idx; /* run through the argument list; "default array" arguments * must be freed explicitly; the tag list must also be freed */ diff --git a/compiler/sc3.c b/compiler/sc3.c index d6dd92c..0b3e624 100644 --- a/compiler/sc3.c +++ b/compiler/sc3.c @@ -14,7 +14,7 @@ * License for the specific language governing permissions and limitations * under the License. * - * Version: $Id: sc3.c 7115 2024-02-26 21:45:03Z thiadmer $ + * Version: $Id: sc3.c 7152 2024-03-23 20:47:23Z thiadmer $ */ #include #include @@ -29,7 +29,7 @@ static int skim(const int *opstr,void (*testfunc)(int),int dropval,int endval, int (*hier)(value*),value *lval); static void dropout(int lvalue,void (*testfunc)(int val),int exit1,value *lval); static int plnge(const int *opstr,int opoff,int (*hier)(value *lval),value *lval, - char *forcetag,int chkbitwise); + const char *forcetag,int chkbitwise); static int plnge1(int (*hier)(value *lval),value *lval); static void plnge2(void (*oper)(void),void (*arrayoper)(cell), int (*hier)(value *lval), @@ -53,7 +53,7 @@ static int primary(value *lval,int *symtok); static void clear_value(value *lval); static void callfunction(symbol *sym,value *lval_result,int matchparanthesis); static int skiptotoken(int token); -static int dbltest(const void (*oper)(),value *lval1,value *lval2); +static int dbltest(const void (*oper)(),const value *lval1,const value *lval2); static int commutative(const void (*oper)()); static int constant(value *lval); @@ -598,7 +598,7 @@ static void checkfunction(value *lval) * Plunge to a lower level */ static int plnge(const int *opstr,int opoff,int (*hier)(value *lval),value *lval, - char *forcetag,int chkbitwise) + const char *forcetag,int chkbitwise) { int lvalue,opidx; int count; @@ -890,7 +890,7 @@ SC_FUNC int expression(cell *val,int *tag,symbol **symptr,int chkfuncresult) static int inside_preproc(void) { /* a preprocessor expression has a special symbol at the end of the string */ - return (strchr((char *)lptr,PREPROC_TERM)!=NULL); + return (strchr((char*)lexptr,PREPROC_TERM)!=NULL); } SC_FUNC int sc_getstateid(constvalue **automaton,constvalue **state,char *statename) @@ -1014,7 +1014,7 @@ static int hier14(value *lval1) arrayidx1[i]=arrayidx2[i]=(cell)((ucell)~0UL << (pc_cellsize*8-1)); org_arrayidx=lval1->arrayidx; /* save current pointer, to reset later */ if (lval1->arrayidx==NULL) - lval1->arrayidx=arrayidx1; + lval1->arrayidx=arrayidx1; /* ok, because lval1->arrayidx is only used in deeper functions, not by the caller of hier14() */ lvalue=plnge1(hier13,lval1); if (lval1->ident!=iARRAYCELL && lval1->ident!=iARRAYCHAR) lval1->arrayidx=NULL; @@ -1175,7 +1175,7 @@ static int hier14(value *lval1) { memcopy(val*pc_cellsize); } else { - symbol *subsym=finddepend(lval3.sym); + const symbol *subsym=finddepend(lval3.sym); assert(subsym!=NULL); copyarray2d((int)lval3.sym->dim.array.length,(int)subsym->dim.array.length); #if sDIMEN_MAX > 3 @@ -1633,7 +1633,7 @@ static int hier2(value *lval) if (level>sym->dim.array.level+1) { error(28,sym->name); /* invalid subscript */ } else if (level==sym->dim.array.level+1 && namelist!=NULL) { - constvalue *item=find_constval(namelist,idxname,-1); + const constvalue *item=find_constval(namelist,idxname,-1); if (item==NULL) error_suggest_list(80,idxname,namelist); else if (item->index!=0) @@ -2135,7 +2135,7 @@ static void clear_value(value *lval) /* do not clear lval->arrayidx, it is preset in hier14() */ } -static void setdefarray(cell *string,cell size,cell array_sz,cell *dataaddr,int fconst) +static void setdefarray(const cell *string,cell size,cell array_sz,cell *dataaddr,int fconst) { /* The routine must copy the default array data onto the heap, as to avoid * that a function can change the default value. An optimization is that @@ -2202,7 +2202,7 @@ static int findnamedarg(const arginfo *arg,const char *name, char *closestarg) return -1; } -static int checktag(int tags[],int numtags,int exprtag) +static int checktag(const int tags[],int numtags,int exprtag) { int i; @@ -2636,7 +2636,7 @@ static int nesting=0; * the "sizeof" or "tagof" of other arguments */ for (argidx=0; arg[argidx].ident!=0 && arg[argidx].ident!=iVARARGS; argidx++) { - constvalue *asz; + const constvalue *asz; cell array_sz; if (arglist[argidx]==ARG_DONE) continue; /* already seen and handled this argument */ @@ -2752,7 +2752,7 @@ static int skiptotoken(int token) * byte offsets. In all other cases, the function returns 1. The result of this * function can therefore be used to multiple the array index. */ -static int dbltest(const void (*oper)(),value *lval1,value *lval2) +static int dbltest(const void (*oper)(),const value *lval1,const value *lval2) { if ((oper!=ob_add) && (oper!=ob_sub)) return 1; diff --git a/compiler/sc4.c b/compiler/sc4.c index 5fb04ef..c1c5d11 100644 --- a/compiler/sc4.c +++ b/compiler/sc4.c @@ -1,6 +1,6 @@ /* Pawn compiler - code generation (unoptimized "assembler" code) * - * Copyright (c) CompuPhase, 1997-2017 + * Copyright (c) CompuPhase, 1997-2024 * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy @@ -14,7 +14,7 @@ * License for the specific language governing permissions and limitations * under the License. * - * Version: $Id: sc4.c 6131 2020-04-29 19:47:15Z thiadmer $ + * Version: $Id: sc4.c 7152 2024-03-23 20:47:23Z thiadmer $ */ #include #include @@ -351,7 +351,7 @@ SC_FUNC void setline(int chkbounds) } /* if */ } -SC_FUNC void setfiledirect(char *name) +SC_FUNC void setfiledirect(const char *name) { if (sc_status==statBROWSE && sc_listing) { assert(name!=NULL); @@ -703,7 +703,7 @@ SC_FUNC void copyarray2d(int majordim,int minordim) code_idx+=opcodes(3)+opargs(1); } -SC_FUNC void fillarray(symbol *sym,cell size,cell value) +SC_FUNC void fillarray(const symbol *sym,cell size,cell value) { ldconst(value,sPRI); /* load value in PRI */ @@ -1426,9 +1426,7 @@ SC_FUNC void nooperation(void) */ SC_FUNC void inc(value *lval) { - symbol *sym; - - sym=lval->sym; + const symbol *sym=lval->sym; if (lval->ident==iARRAYCELL) { /* indirect increment, address already in PRI */ stgwrite("\tinc.i\n"); @@ -1476,9 +1474,7 @@ SC_FUNC void inc(value *lval) */ SC_FUNC void dec(value *lval) { - symbol *sym; - - sym=lval->sym; + const symbol *sym=lval->sym; if (lval->ident==iARRAYCELL) { /* indirect decrement, address already in PRI */ stgwrite("\tdec.i\n"); diff --git a/compiler/sc6.c b/compiler/sc6.c index f1abb44..6564dac 100644 --- a/compiler/sc6.c +++ b/compiler/sc6.c @@ -14,7 +14,7 @@ * License for the specific language governing permissions and limitations * under the License. * - * Version: $Id: sc6.c 6932 2023-04-03 13:56:19Z thiadmer $ + * Version: $Id: sc6.c 7152 2024-03-23 20:47:23Z thiadmer $ */ #include #include @@ -332,7 +332,7 @@ static cell do_call(FILE *fbin,const char *params,cell opcode,cell cip) { char name[sNAMEMAX+1]; int i; - symbol *sym; + const symbol *sym; ucell p; for (i=0; !isspace(*params); i++,params++) { @@ -619,7 +619,7 @@ static OPCODE opcodelist[] = { }; #define MAX_INSTR_LEN 30 -static int findopcode(char *instr,int maxlen) +static int findopcode(const char *instr,int maxlen) { int low,high; char str[MAX_INSTR_LEN]; diff --git a/compiler/sc7.c b/compiler/sc7.c index 81b2db0..f14cf91 100644 --- a/compiler/sc7.c +++ b/compiler/sc7.c @@ -41,7 +41,7 @@ * License for the specific language governing permissions and limitations * under the License. * - * Version: $Id: sc7.c 7113 2024-02-25 21:29:31Z thiadmer $ + * Version: $Id: sc7.c 7152 2024-03-23 20:47:23Z thiadmer $ */ #include #include @@ -717,7 +717,7 @@ static char *replacesequence(const char *pattern,char symbols[MAX_OPT_VARS+1][MA break; case '#': { ucell v=hex2ucell(pattern+1,NULL); - char *ptr=itoh(v); + const char *ptr=itoh(v); strcpy(sptr,ptr); sptr+=strlen(ptr); assert(alphanum(pattern[1]) || pattern[1]=='-'); @@ -752,7 +752,7 @@ static char *replacesequence(const char *pattern,char symbols[MAX_OPT_VARS+1][MA return buffer; } -static void strreplace(char *dest,char *replace,int sub_length,int repl_length,int dest_length) +static void strreplace(char *dest,const char *replace,int sub_length,int repl_length,int dest_length) { int offset=sub_length-repl_length; if (offset>0) { /* delete a section */ diff --git a/compiler/sc7.scp b/compiler/sc7.scp index 5e5dc46..54347de 100644 --- a/compiler/sc7.scp +++ b/compiler/sc7.scp @@ -15,7 +15,7 @@ * License for the specific language governing permissions and limitations * under the License. * - * Version: $Id: sc7.sch 7113 2024-02-25 21:29:31Z thiadmer $ + * Version: $Id: sc7.sch 7151 2024-03-23 16:08:18Z thiadmer $ */ /* Special characters in the strings of this file: @@ -44,13 +44,13 @@ SC_FUNC int strexpand(char *dest, const unsigned char *source, int maxlen, const /*-*SCPACK start of pair table, do not change or remove this line */ const unsigned char sequences_table[128][2] = { {105,32}, {114,128}, {112,129}, {46,130}, {49,33}, {37,132}, {32,37}, {97,100}, {115,104}, {117,136}, {112,137}, {46,115}, {32,133}, {108,111}, {141,135}, {97,108}, - {50,33}, {59,36}, {143,116}, {46,146}, {46,112}, {131,133}, {105,33}, {114,33}, {131,37}, {115,116}, {97,151}, {112,154}, {145,155}, {142,139}, {46,99}, {114,150}, - {148,159}, {48,33}, {152,144}, {110,153}, {111,163}, {99,164}, {135,100}, {147,33}, {134,144}, {112,111}, {169,112}, {138,114}, {112,33}, {120,172}, {101,173}, {145,174}, - {138,160}, {134,161}, {134,51}, {170,167}, {147,140}, {134,49}, {157,162}, {126,37}, {178,33}, {103,33}, {104,185}, {99,186}, {120,187}, {166,114}, {46,135}, {122,101}, - {190,114}, {191,114}, {101,113}, {156,138}, {165,149}, {46,150}, {110,100}, {105,110}, {52,33}, {32,35}, {199,99}, {101,99}, {100,203}, {157,149}, {156,171}, {140,175}, + {50,33}, {143,116}, {59,36}, {46,145}, {46,112}, {131,133}, {105,33}, {114,33}, {131,37}, {115,116}, {97,151}, {112,154}, {146,155}, {142,139}, {114,150}, {148,158}, + {46,99}, {110,153}, {111,161}, {99,162}, {152,144}, {48,33}, {135,100}, {147,33}, {134,144}, {112,111}, {169,112}, {138,114}, {112,33}, {120,172}, {101,173}, {146,174}, + {138,159}, {134,165}, {134,51}, {170,167}, {147,140}, {134,49}, {126,37}, {157,164}, {178,33}, {103,33}, {104,185}, {99,186}, {120,187}, {166,114}, {46,135}, {122,101}, + {190,114}, {191,114}, {101,113}, {163,149}, {156,138}, {46,150}, {110,100}, {105,110}, {52,33}, {32,35}, {199,99}, {101,99}, {100,203}, {157,149}, {156,171}, {140,175}, {114,101}, {208,102}, {53,33}, {166,33}, {108,209}, {142,149}, {189,149}, {194,33}, {136,108}, {138,109}, {134,200}, {134,50}, {106,193}, {105,100}, {115,103}, {115,108}, - {221,120}, {216,158}, {181,168}, {147,168}, {176,182}, {117,198}, {111,229}, {98,230}, {193,111}, {231,115}, {180,182}, {181,219}, {212,139}, {220,140}, {142,162}, {233,184}, - {179,211}, {139,140}, {158,140}, {171,109}, {198,33}, {170,160}, {152,161}, {153,111}, {247,114}, {97,244}, {183,50}, {235,178}, {183,51}, {134,48}, {139,177} + {221,120}, {216,160}, {181,168}, {147,168}, {176,183}, {117,198}, {111,229}, {98,230}, {193,111}, {231,115}, {180,183}, {181,219}, {212,139}, {220,140}, {142,164}, {233,184}, + {179,211}, {139,140}, {160,140}, {171,109}, {170,159}, {198,33}, {152,165}, {153,111}, {247,114}, {97,245}, {163,164}, {182,50}, {235,178}, {182,51}, {134,48} }; /*-*SCPACK end of pair table, do not change or remove this line */ @@ -89,7 +89,7 @@ static const SEQUENCE sequences_cmp[] = { "load.s.pri %2!load.s.alt %1!", #else "\315\344\263", - "\266\235\264", + "\267\235\264", #endif 4-2, 2-2 }, @@ -99,7 +99,7 @@ static const SEQUENCE sequences_cmp[] = { "load.s.pri %2!load.alt %1!", #else "\325\344\263", - "\266\216\264", + "\267\216\264", #endif 4-2, 2-2 }, @@ -154,8 +154,8 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!push.pri!load.s.pri %2!pop.alt!", "load.s.pri %2!const.alt %1!", #else - "\304\344\263", - "\266\245\264", + "\303\344\263", + "\267\243\264", #endif 4-2, 2-2 }, @@ -164,8 +164,8 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!push.pri!load.pri %2!pop.alt!", "load.pri %2!const.alt %1!", #else - "\304\260\356\263", - "\356\245\264", + "\303\260\356\263", + "\356\243\264", #endif 4-2, 2-2 }, @@ -174,8 +174,8 @@ static const SEQUENCE sequences_cmp[] = { "load.s.pri %1!push.pri!const.pri %2!pop.alt!", "const.pri %2!load.s.alt %1!", #else - "\315\260\245\242\263", - "\245\242\235\264", + "\315\260\372\263", + "\372\235\264", #endif 4-2, 2-2 }, @@ -184,8 +184,8 @@ static const SEQUENCE sequences_cmp[] = { "load.pri %1!push.pri!const.pri %2!pop.alt!", "const.pri %2!load.alt %1!", #else - "\325\260\245\242\263", - "\245\242\216\264", + "\325\260\372\263", + "\372\216\264", #endif 4-2, 2-2 }, @@ -198,8 +198,8 @@ static const SEQUENCE sequences_cmp[] = { "addr.pri %1!push.pri!const.pri %2!pop.alt!", "addr.alt %1!const.pri %2!", #else - "\326\260\245\242\263", - "\275\264\245\242", + "\326\260\372\263", + "\275\264\372", #endif 4-2, 2-2 }, @@ -208,8 +208,8 @@ static const SEQUENCE sequences_cmp[] = { "addr.pri %1!push.pri!zero.pri!pop.alt!", "addr.alt %1!zero.pri!", #else - "\326\260\350\240\263", - "\275\264\350\240", + "\326\260\350\237\263", + "\275\264\350\237", #endif 4-2, 1-1 }, @@ -221,8 +221,21 @@ static const SEQUENCE sequences_cmp[] = { "addr.pri %1!push.pri!addr.pri %2!pop.alt!", "addr.alt %1!addr.pri %2!", #else - "\326\260\275\242\263", - "\275\264\275\242", + "\326\260\275\244\263", + "\275\264\275\244", + #endif + 4-2, 2-2 + }, + /* The same as above when loading two constants (may happen when setting an + * array element to a constant. + */ + { + #ifdef SCPACK + "const.pri %1!push.pri!const.pri %2!pop.alt!", + "const.alt %1!const.pri %2!", + #else + "\303\260\372\263", + "\243\264\372", #endif 4-2, 2-2 }, @@ -232,7 +245,7 @@ static const SEQUENCE sequences_cmp[] = { * push.pri - * load.s.pri %1 - * pop.alt - - * The above also accurs for "load.pri" and for "const.pri", + * The above also occurs for "load.pri" and for "const.pri", * so add another two cases. */ { @@ -260,8 +273,8 @@ static const SEQUENCE sequences_cmp[] = { "xchg!push.pri!const.pri %1!pop.alt!", "const.pri %1!", #else - "\274\260\304\263", - "\304", + "\274\260\303\263", + "\303", #endif 4-1, 1-1 }, @@ -423,7 +436,7 @@ static const SEQUENCE sequences_cmp[] = { "load.s.pri %2!load.s.alt %1!", #else "\315\235\343\274", - "\266\235\264", + "\267\235\264", #endif 3-2, 2-2 }, @@ -442,8 +455,8 @@ static const SEQUENCE sequences_cmp[] = { "load.s.pri %1!const.alt %2!xchg!", "const.pri %2!load.s.alt %1!", #else - "\315\245\343\274", - "\245\242\235\264", + "\315\243\343\274", + "\372\235\264", #endif 3-2, 2-2 }, @@ -453,7 +466,7 @@ static const SEQUENCE sequences_cmp[] = { "load.s.pri %2!load.alt %1!", #else "\325\235\343\274", - "\266\216\264", + "\267\216\264", #endif 3-2, 2-2 }, @@ -472,8 +485,8 @@ static const SEQUENCE sequences_cmp[] = { "load.pri %1!const.alt %2!xchg!", "const.pri %2!load.alt %1!", #else - "\325\245\343\274", - "\245\242\216\264", + "\325\243\343\274", + "\372\216\264", #endif 3-2, 2-2 }, @@ -482,8 +495,8 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!load.s.alt %2!xchg!", "load.s.pri %2!const.alt %1!", #else - "\304\235\343\274", - "\266\245\264", + "\303\235\343\274", + "\267\243\264", #endif 3-2, 2-2 }, @@ -492,8 +505,8 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!load.alt %2!xchg!", "load.pri %2!const.alt %1!", #else - "\304\216\343\274", - "\356\245\264", + "\303\216\343\274", + "\356\243\264", #endif 3-2, 2-2 }, @@ -514,8 +527,8 @@ static const SEQUENCE sequences_cmp[] = { "xchg!const.pri %1!xchg!", "const.alt %1!", #else - "\274\304\274", - "\245\264", + "\274\303\274", + "\243\264", #endif 3-1, 1-1 }, @@ -555,7 +568,7 @@ static const SEQUENCE sequences_cmp[] = { "lref.pri %1!xchg!load.s.pri %2!", "lref.alt %1!load.s.pri %2!", #else - "\324\225\274\266", + "\324\225\274\267", "\324\352", #endif 3-2, 2-2 @@ -565,8 +578,8 @@ static const SEQUENCE sequences_cmp[] = { "lref.pri %1!xchg!const.pri %2!", "lref.alt %1!const.pri %2!", #else - "\324\225\274\245\242", - "\324\264\245\242", + "\324\225\274\372", + "\324\264\372", #endif 3-2, 2-2 }, @@ -585,7 +598,7 @@ static const SEQUENCE sequences_cmp[] = { "lref.s.pri %1!xchg!load.s.pri %2!", "lref.s.alt %1!load.s.pri %2!", #else - "\354\225\274\266", + "\354\225\274\267", "\354\352", #endif 3-2, 2-2 @@ -595,8 +608,8 @@ static const SEQUENCE sequences_cmp[] = { "lref.s.pri %1!xchg!const.pri %2!", "lref.s.alt %1!const.pri %2!", #else - "\354\225\274\245\242", - "\354\264\245\242", + "\354\225\274\372", + "\354\264\372", #endif 3-2, 2-2 }, @@ -605,8 +618,8 @@ static const SEQUENCE sequences_cmp[] = { "lref.s.pri %1!push.pri!lref.s.pri %2!pop.alt!", "lref.s.alt %1!lref.s.pri %2!", #else - "\354\225\260\354\242\263", - "\354\264\354\242", + "\354\225\260\354\244\263", + "\354\264\354\244", #endif 4-2, 2-2 }, @@ -649,7 +662,7 @@ static const SEQUENCE sequences_cmp[] = { "const.alt 0!add!", ";!", #else - "\245\223 \241\323", + "\243\223 \245\323", ";!", #endif 2-0, 1-0 @@ -659,7 +672,7 @@ static const SEQUENCE sequences_cmp[] = { "const.pri 0!load.s.alt %1!sub!", "load.s.pri %1!", #else - "\245\203\241\235\264sub!", + "\243\203\245\235\264sub!", "\315", #endif 3-1, 2-1 @@ -669,7 +682,7 @@ static const SEQUENCE sequences_cmp[] = { "const.pri 0!load.alt %1!sub!", "load.pri %1!", #else - "\245\203\241\216\264sub!", + "\243\203\245\216\264sub!", "\325", #endif 3-1, 2-1 @@ -679,7 +692,7 @@ static const SEQUENCE sequences_cmp[] = { "const.alt 1!smul!", ";!", #else - "\245\223 \204smul!", + "\243\223 \204smul!", ";!", #endif 2-0, 1-0 @@ -689,7 +702,7 @@ static const SEQUENCE sequences_cmp[] = { "const.pri 1!load.s.alt %1!sdiv!", "load.s.pri %1!", #else - "\245\203\204\235\264sdiv!", + "\243\203\204\235\264sdiv!", "\315", #endif 3-1, 2-1 @@ -699,7 +712,7 @@ static const SEQUENCE sequences_cmp[] = { "const.pri 1!load.alt %1!sdiv!", "load.pri %1!", #else - "\245\203\204\216\264sdiv!", + "\243\203\204\216\264sdiv!", "\325", #endif 3-1, 2-1 @@ -733,8 +746,8 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!push.pri!load.s.pri %2!bounds %3!pop.alt!", "const.alt %1!load.s.pri %2!bounds %3!", #else - "\304\344\357\263", - "\245\352\357", + "\303\344\357\263", + "\243\352\357", #endif 5-3, 3-3 }, @@ -744,7 +757,7 @@ static const SEQUENCE sequences_cmp[] = { * load.s.pri %1 load.s.pri %1 * pop.alt - * - * The above also accurs for "load.pri" and for "const.pri", + * The above also occurs for "load.pri" and for "const.pri", * so add another two cases. */ { @@ -772,8 +785,8 @@ static const SEQUENCE sequences_cmp[] = { "push.pri!const.pri %1!pop.alt!", "xchg!const.pri %1!", #else - "\260\304\263", - "\274\304", + "\260\303\263", + "\274\303", #endif 3-2, 1-1 }, @@ -782,8 +795,8 @@ static const SEQUENCE sequences_cmp[] = { "push.pri!zero.pri!pop.alt!", "xchg!zero.pri!", #else - "\260\350\240\263", - "\274\350\240", + "\260\350\237\263", + "\274\350\237", #endif 3-2, 0-0 }, @@ -846,8 +859,8 @@ static const SEQUENCE sequences_cmp[] = { "xchg!const.pri %1!add!", "const.alt %1!add!", #else - "\274\304\323", - "\245\264\323", + "\274\303\323", + "\243\264\323", #endif 3-2, 1-1 }, @@ -973,8 +986,8 @@ static const SEQUENCE sequences_cmp[] = { "push.pri!load.s.pri %1!inc.i!pop.pri!lref.s.pri %2!", "load.s.pri %1!inc.i!lref.s.pri %2!", #else - "\260\315\312\305\365\354\242", - "\315\312\305\354\242", + "\260\315\312\305\364\354\244", + "\315\312\305\354\244", #endif 5-3, 2-2 }, @@ -983,7 +996,7 @@ static const SEQUENCE sequences_cmp[] = { "push.pri!load.s.pri %1!inc.i!pop.pri!;$exp!", "load.s.pri %1!inc.i!;$exp!", #else - "\260\315\312\305\365\257", + "\260\315\312\305\364\257", "\315\312\305\257", #endif 4-2, 1-1 @@ -993,8 +1006,8 @@ static const SEQUENCE sequences_cmp[] = { "push.pri!addr.pri %1!inc.i!pop.pri!;load.s.pri %2!", "addr.pri %1!inc.i!;load.s.pri %2!", #else - "\260\326\312\305\365;\266", - "\326\312\305;\266", + "\260\326\312\305\364;\267", + "\326\312\305;\267", #endif 5-3, 1-1 }, @@ -1003,7 +1016,7 @@ static const SEQUENCE sequences_cmp[] = { "push.pri!addr.pri %1!inc.i!pop.pri!;$exp!", "addr.pri %1!inc.i!;$exp!", #else - "\260\326\312\305\365\257", + "\260\326\312\305\364\257", "\326\312\305\257", #endif 4-2, 1-1 @@ -1013,8 +1026,8 @@ static const SEQUENCE sequences_cmp[] = { "push.pri!const.pri %1!inc.i!pop.pri!;load.pri %2!", "const.pri %1!inc.i!;load.pri %2!", #else - "\260\304\312\305\365;\356", - "\304\312\305;\356", + "\260\303\312\305\364;\356", + "\303\312\305;\356", #endif 5-3, 1-1 }, @@ -1023,8 +1036,8 @@ static const SEQUENCE sequences_cmp[] = { "push.pri!const.pri %1!inc.i!pop.pri!;$exp!", "const.pri %1!inc.i!;$exp!", #else - "\260\304\312\305\365\257", - "\304\312\305\257", + "\260\303\312\305\364\257", + "\303\312\305\257", #endif 4-2, 1-1 }, @@ -1033,8 +1046,8 @@ static const SEQUENCE sequences_cmp[] = { "push.pri!load.s.pri %1!dec.i!pop.pri!lref.s.pri %2!", "load.s.pri %1!dec.i!lref.s.pri %2!", #else - "\260\315\314\305\365\354\242", - "\315\314\305\354\242", + "\260\315\314\305\364\354\244", + "\315\314\305\354\244", #endif 5-3, 2-2 }, @@ -1043,7 +1056,7 @@ static const SEQUENCE sequences_cmp[] = { "push.pri!load.s.pri %1!dec.i!pop.pri!;$exp!", "load.s.pri %1!dec.i!;$exp!", #else - "\260\315\314\305\365\257", + "\260\315\314\305\364\257", "\315\314\305\257", #endif 4-2, 1-1 @@ -1053,8 +1066,8 @@ static const SEQUENCE sequences_cmp[] = { "push.pri!addr.pri %1!dec.i!pop.pri!;load.s.pri %2!", "addr.pri %1!dec.i!;load.s.pri %2!", #else - "\260\326\314\305\365;\266", - "\326\314\305;\266", + "\260\326\314\305\364;\267", + "\326\314\305;\267", #endif 5-3, 1-1 }, @@ -1063,7 +1076,7 @@ static const SEQUENCE sequences_cmp[] = { "push.pri!addr.pri %1!dec.i!pop.pri!;$exp!", "addr.pri %1!dec.i!;$exp!", #else - "\260\326\314\305\365\257", + "\260\326\314\305\364\257", "\326\314\305\257", #endif 4-2, 1-1 @@ -1073,8 +1086,8 @@ static const SEQUENCE sequences_cmp[] = { "push.pri!const.pri %1!dec.i!pop.pri!;load.pri %2!", "const.pri %1!dec.i!;load.pri %2!", #else - "\260\304\314\305\365;\356", - "\304\314\305;\356", + "\260\303\314\305\364;\356", + "\303\314\305;\356", #endif 5-3, 1-1 }, @@ -1083,8 +1096,8 @@ static const SEQUENCE sequences_cmp[] = { "push.pri!const.pri %1!dec.i!pop.pri!;$exp!", "const.pri %1!dec.i!;$exp!", #else - "\260\304\314\305\365\257", - "\304\314\305\257", + "\260\303\314\305\364\257", + "\303\314\305\257", #endif 4-2, 1-1 }, @@ -1094,7 +1107,7 @@ static const SEQUENCE sequences_cmp[] = { "const.alt %1!shl!", "shl.c.pri %1!", #else - "\245\264\330!", + "\243\264\330!", "\341\225", #endif 2-1, 1-1 @@ -1163,8 +1176,8 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!push.pri!load.s.pri %2!bounds %3!shl.c.pri 2!pop.alt!add!load.i!", "const.alt %1!load.s.pri %2!bounds %3!lidx!", #else - "\304\344\357\341\203\220\360\216\305", - "\245\352\357l\340!", + "\303\344\357\341\203\220\360\216\305", + "\243\352\357l\340!", #endif 8-4, 4-3 }, @@ -1183,8 +1196,8 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!push.pri!load.s.pri %2!shl.c.pri 2!pop.alt!add!load.i!", "const.alt %1!load.s.pri %2!lidx!", #else - "\304\344\341\203\220\360\216\305", - "\245\352l\340!", + "\303\344\341\203\220\360\216\305", + "\243\352l\340!", #endif 7-3, 3-2 }, @@ -1205,8 +1218,8 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!push.pri!load.s.pri %2!bounds %3!shl.c.pri %4!pop.alt!add!load.i!", "const.alt %1!load.s.pri %2!bounds %3!lidx.b %4!", #else - "\304\344\357\341\230\310\360\216\305", - "\245\352\357l\340.b\332", + "\303\344\357\341\230\310\360\216\305", + "\243\352\357l\340.b\332", #endif 8-4, 4-4 }, @@ -1225,8 +1238,8 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!push.pri!load.s.pri %2!shl.c.pri %3!pop.alt!add!load.i!", "const.alt %1!load.s.pri %2!lidx.b %3!", #else - "\304\344\341\2303!\360\216\305", - "\245\352l\340.b\270", + "\303\344\341\2303!\360\216\305", + "\243\352l\340.b\270", #endif 7-3, 3-3 }, @@ -1247,8 +1260,8 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!push.pri!load.s.pri %2!bounds %3!shl.c.pri 2!pop.alt!add!", "const.alt %1!load.s.pri %2!bounds %3!idxaddr!", #else - "\304\344\357\341\203\220\360", - "\245\352\357\340\246\227", + "\303\344\357\341\203\220\360", + "\243\352\357\340\246\227", #endif 7-4, 4-3 }, @@ -1267,8 +1280,8 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!push.pri!load.s.pri %2!shl.c.pri 2!pop.alt!add!", "const.alt %1!load.s.pri %2!idxaddr!", #else - "\304\344\341\203\220\360", - "\245\352\340\246\227", + "\303\344\341\203\220\360", + "\243\352\340\246\227", #endif 6-3, 3-2 }, @@ -1289,8 +1302,8 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!push.pri!load.s.pri %2!bounds %3!shl.c.pri %4!pop.alt!add!", "const.alt %1!load.s.pri %2!bounds %3!idxaddr.b %4!", #else - "\304\344\357\341\230\310\360", - "\245\352\357\340\275.b\332", + "\303\344\357\341\230\310\360", + "\243\352\357\340\275.b\332", #endif 7-4, 4-4 }, @@ -1309,8 +1322,8 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!push.pri!load.s.pri %2!shl.c.pri %3!pop.alt!add!", "const.alt %1!load.s.pri %2!idxaddr.b %3!", #else - "\304\344\341\2303!\360", - "\245\352\340\275.b\270", + "\303\344\341\2303!\360", + "\243\352\340\275.b\270", #endif 6-3, 3-3 }, @@ -1369,8 +1382,8 @@ static const SEQUENCE sequences_cmp[] = { ";$lcl %1 %2!stack -4!const.pri %3!stor.s %2!;$exp!", ";$lcl %1 %2!push.c %3!;$exp!", #else - "\221lcl\342\231ack -\310\245\2303!\370\213\250\257", - "\221lcl\342\212\236\270\257", + "\222lcl\342\231ack -\310\243\2303!\370\213\250\257", + "\222lcl\342\212\240\270\257", #endif 3-1, 3-1 }, @@ -1379,8 +1392,8 @@ static const SEQUENCE sequences_cmp[] = { ";$lcl %1 %2!stack -4!zero.pri!stor.s %2!;$exp!", ";$lcl %1 %2!push.c #0!;$exp!", #else - "\221lcl\342\231ack -\310\350\240\370\213\250\257", - "\221lcl\342\212\236\311\241\257", + "\222lcl\342\231ack -\310\350\237\370\213\250\257", + "\222lcl\342\212\240\311\245\257", #endif 3-1, 2-1 }, @@ -1397,8 +1410,8 @@ static const SEQUENCE sequences_cmp[] = { ";$lcl %1 %2!stack -4!load.pri %3!stor.s %2!;$exp!", ";$lcl %1 %2!stack #-4!load.pri %3!stor.i!;$exp!", #else - "\221lcl\342\231ack -\310\216\2303!\370\213\250\257", - "\221lcl\342\231ack\311-\310\216\2303!\370\305\257", + "\222lcl\342\231ack -\310\216\2303!\370\213\250\257", + "\222lcl\342\231ack\311-\310\216\2303!\370\305\257", #endif 3-3, 3-2 }, @@ -1407,8 +1420,8 @@ static const SEQUENCE sequences_cmp[] = { ";$lcl %1 %2!stack -4!load.s.pri %3!stor.s %2!;$exp!", ";$lcl %1 %2!stack #-4!load.s.pri %3!stor.i!;$exp!", #else - "\221lcl\342\231ack -\310\235\2303!\370\213\250\257", - "\221lcl\342\231ack\311-\310\235\2303!\370\305\257", + "\222lcl\342\231ack -\310\235\2303!\370\213\250\257", + "\222lcl\342\231ack\311-\310\235\2303!\370\305\257", #endif 3-3, 3-2 }, @@ -1439,8 +1452,8 @@ static const SEQUENCE sequences_cmp[] = { "xchg!const.pri %1!sub!", "const.alt %1!sub.inv!", #else - "\274\304sub!", - "\245\264sub.\307v!", + "\274\303sub!", + "\243\264sub.\307v!", #endif 3-2, 1-1 }, @@ -1484,8 +1497,8 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!const.alt %2!push.pri!push.alt!", "push.c %1!push.c %2!", #else - "\304\245\343\260\212\247", - "\212\362\212\236\250", + "\303\243\343\260\212\247", + "\212\362\212\240\250", #endif 4-2, 2-2 }, @@ -1494,8 +1507,8 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!const.alt %2!push.alt!push.pri!", "push.c %2!push.c %1!", #else - "\304\245\343\212\247\260", - "\212\236\250\212\362", + "\303\243\343\212\247\260", + "\212\240\250\212\362", #endif 4-2, 2-2 }, @@ -1504,7 +1517,7 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!load.alt %2!push.pri!push.alt!", "push.c %1!push %2!", #else - "\304\216\343\260\212\247", + "\303\216\343\260\212\247", "\212\362\212\250", #endif 4-2, 2-2 @@ -1514,7 +1527,7 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!load.alt %2!push.alt!push.pri!", "push %2!push.c %1!", #else - "\304\216\343\212\247\260", + "\303\216\343\212\247\260", "\212\250\212\362", #endif 4-2, 2-2 @@ -1524,8 +1537,8 @@ static const SEQUENCE sequences_cmp[] = { "load.pri %1!const.alt %2!push.pri!push.alt!", "push %1!push.c %2!", #else - "\325\245\343\260\212\247", - "\212\214\212\236\250", + "\325\243\343\260\212\247", + "\212\214\212\240\250", #endif 4-2, 2-2 }, @@ -1534,8 +1547,8 @@ static const SEQUENCE sequences_cmp[] = { "load.pri %1!const.alt %2!push.alt!push.pri!", "push.c %2!push %1!", #else - "\325\245\343\212\247\260", - "\212\236\250\212\214", + "\325\243\343\212\247\260", + "\212\240\250\212\214", #endif 4-2, 2-2 }, @@ -1603,7 +1616,7 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!push.pri!;$par!", "push.c %1!;$par!", #else - "\304\260\234", + "\303\260\234", "\212\362\234", #endif 2-1, 1-1 @@ -1613,8 +1626,8 @@ static const SEQUENCE sequences_cmp[] = { "zero.pri!push.pri!;$par!", "push.c #0!;$par!", #else - "\350\240\260\234", - "\212\236\311\241\234", + "\350\237\260\234", + "\212\240\311\245\234", #endif 2-1, 0-1 }, @@ -1653,7 +1666,7 @@ static const SEQUENCE sequences_cmp[] = { "load.s.pri %1!pushr.pri!;$par!", "pushr.s %1!;$par!", #else - "\315\253\240\234", + "\315\253\237\234", "\253\361\234", #endif 2-1, 1-1 @@ -1663,7 +1676,7 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!pushr.pri!;$par!", "pushr.c %1!;$par!", #else - "\304\253\240\234", + "\303\253\237\234", "\253\362\234", #endif 2-1, 1-1 @@ -1673,8 +1686,8 @@ static const SEQUENCE sequences_cmp[] = { "zero.pri!pushr.pri!;$par!", "pushr.c #0!;$par!", #else - "\350\240\253\240\234", - "\253\236\311\241\234", + "\350\237\253\237\234", + "\253\240\311\245\234", #endif 2-1, 0-1 }, @@ -1683,7 +1696,7 @@ static const SEQUENCE sequences_cmp[] = { "addr.pri %1!pushr.pri!;$par!", "pushr.adr %1!;$par!", #else - "\326\253\240\234", + "\326\253\237\234", "\253\300\214\234", #endif 2-1, 1-1 @@ -1704,7 +1717,7 @@ static const SEQUENCE sequences_cmp[] = { "const.alt %1!add!", "add.c %1!", #else - "\245\264\323", + "\243\264\323", "\246\362", #endif 2-1, 1-1 @@ -1714,7 +1727,7 @@ static const SEQUENCE sequences_cmp[] = { "const.alt %1!smul!", "smul.c %1!", #else - "\245\264smul!", + "\243\264smul!", "smul\362", #endif 2-1, 1-1 @@ -1724,8 +1737,8 @@ static const SEQUENCE sequences_cmp[] = { "const.alt %1!eq!", "eq.c.pri %1!", #else - "\245\264\327", - "\302\236\225", + "\243\264\327", + "\302\240\225", #endif 2-1, 1-1 }, @@ -1744,8 +1757,8 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!load.s.alt %2!sub!", "load.s.pri %2!add.c -%1!", #else - "\304\235\343sub!", - "\266\246\236 -\205", + "\303\235\343sub!", + "\267\246\240 -\205", #endif 3-2, 2-2 }, @@ -1754,8 +1767,8 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!load.alt %2!sub!", "load.pri %2!add.c -%1!", #else - "\304\216\343sub!", - "\356\246\236 -\205", + "\303\216\343sub!", + "\356\246\240 -\205", #endif 3-2, 2-2 }, @@ -1769,8 +1782,8 @@ static const SEQUENCE sequences_cmp[] = { "add.c %1!add.c %2!", "add.c %1+%2!", #else - "\246\362\246\236\250", - "\246\236\265+%\220", + "\246\362\246\240\250", + "\246\240\265+%\220", #endif 2-1, 2-1 }, @@ -2009,7 +2022,7 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!inc.i!", "inc %1!", #else - "\304\312\305", + "\303\312\305", "\312\214", #endif 2-1, 1-1 @@ -2029,7 +2042,7 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!dec.i!", "dec %1!", #else - "\304\314\305", + "\303\314\305", "\314\214", #endif 2-1, 1-1 @@ -2050,7 +2063,7 @@ static const SEQUENCE sequences_cmp[] = { "push.pri %1!inc.s %1!pop.pri!", "inc.s %1!", #else - "\212\225\312\361\365", + "\212\225\312\361\364", "\312\361", #endif 3-1, 1-1 @@ -2060,7 +2073,7 @@ static const SEQUENCE sequences_cmp[] = { "push.pri %1!inc %1!pop.pri!", "inc %1!", #else - "\212\225\312\214\365", + "\212\225\312\214\364", "\312\214", #endif 3-1, 1-1 @@ -2070,7 +2083,7 @@ static const SEQUENCE sequences_cmp[] = { "push.pri %1!dec.s %1!pop.pri!", "dec.s %1!", #else - "\212\225\314\361\365", + "\212\225\314\361\364", "\314\361", #endif 3-1, 1-1 @@ -2080,7 +2093,7 @@ static const SEQUENCE sequences_cmp[] = { "push.pri %1!dec %1!pop.pri!", "dec %1!", #else - "\212\225\314\214\365", + "\212\225\314\214\364", "\314\214", #endif 3-1, 1-1 @@ -2207,7 +2220,7 @@ static const SEQUENCE sequences_cmp[] = { "const.pri 0!stor %1!;$exp!", "zero %1!;$exp!", #else - "\245\203\241\370\317", + "\243\203\245\370\317", "\350\317", #endif 2-1, 2-1 @@ -2217,7 +2230,7 @@ static const SEQUENCE sequences_cmp[] = { "const.pri 0!stor.s %1!;$exp!", "zero.s %1!;$exp!", #else - "\245\203\241\370\213\317", + "\243\203\245\370\213\317", "\350\213\317", #endif 2-1, 2-1 @@ -2227,7 +2240,7 @@ static const SEQUENCE sequences_cmp[] = { "zero.pri!stor %1!;$exp!", "zero %1!;$exp!", #else - "\350\240\370\317", + "\350\237\370\317", "\350\317", #endif 2-1, 1-1 @@ -2237,7 +2250,7 @@ static const SEQUENCE sequences_cmp[] = { "zero.pri!stor.s %1!;$exp!", "zero.s %1!;$exp!", #else - "\350\240\370\213\317", + "\350\237\370\213\317", "\350\213\317", #endif 2-1, 1-1 @@ -2247,8 +2260,8 @@ static const SEQUENCE sequences_cmp[] = { "const.pri +0!", "zero.pri!", #else - "\245\203+\241", - "\350\240", + "\243\203+\245", + "\350\237", #endif 1-1, 1-0 }, @@ -2257,7 +2270,7 @@ static const SEQUENCE sequences_cmp[] = { "const.alt +0!", "zero.alt!", #else - "\245\223 +\241", + "\243\223 +\245", "\350\247", #endif 1-1, 1-0 @@ -2280,8 +2293,8 @@ static const SEQUENCE sequences_cmp[] = { "push.c %1!;$par!push.c %2!;$par!push.c %3!;$par!push.c %4!;$par!push.c %5!;$par!", "pushm.c #5 %1 %2 %3 %4 %5!", #else - "\212\362\303\236\250\303\236\270\303\236\332\303\236\206\322\234", - "\331\236\3115\373\2064\206\322", + "\212\362\304\240\250\304\240\270\304\240\332\304\240\206\322\234", + "\331\240\3115\374\2064\206\322", #endif 5-1, 5-6 }, @@ -2290,8 +2303,8 @@ static const SEQUENCE sequences_cmp[] = { "push.c %1!;$par!push.c %2!;$par!push.c %3!;$par!push.c %4!;$par!", "pushm.c #4 %1 %2 %3 %4!", #else - "\212\362\303\236\250\303\236\270\303\236\332\234", - "\331\236\3114\373\332", + "\212\362\304\240\250\304\240\270\304\240\332\234", + "\331\240\3114\374\332", #endif 4-1, 4-5 }, @@ -2300,8 +2313,8 @@ static const SEQUENCE sequences_cmp[] = { "push.c %1!;$par!push.c %2!;$par!push.c %3!;$par!", "pushm.c #3 %1 %2 %3!", #else - "\212\362\303\236\250\303\236\270\234", - "\331\236\3113\353\270", + "\212\362\304\240\250\304\240\270\234", + "\331\240\3113\353\270", #endif 3-1, 3-4 }, @@ -2310,8 +2323,8 @@ static const SEQUENCE sequences_cmp[] = { "push.c %1!;$par!push.c %2!;$par!", "pushm.c #2 %1 %2!", #else - "\212\362\303\236\250\234", - "\331\236\3112\342", + "\212\362\304\240\250\234", + "\331\240\3112\342", #endif 2-1, 2-3 }, @@ -2321,8 +2334,8 @@ static const SEQUENCE sequences_cmp[] = { "push %1!;$par!push %2!;$par!push %3!;$par!push %4!;$par!push %5!;$par!", "pushm #5 %1 %2 %3 %4 %5!", #else - "\212\214\303\250\303\270\303\332\303\206\322\234", - "\331\3115\373\2064\206\322", + "\212\214\304\250\304\270\304\332\304\206\322\234", + "\331\3115\374\2064\206\322", #endif 5-1, 5-6 }, @@ -2331,8 +2344,8 @@ static const SEQUENCE sequences_cmp[] = { "push %1!;$par!push %2!;$par!push %3!;$par!push %4!;$par!", "pushm #4 %1 %2 %3 %4!", #else - "\212\214\303\250\303\270\303\332\234", - "\331\3114\373\332", + "\212\214\304\250\304\270\304\332\234", + "\331\3114\374\332", #endif 4-1, 4-5 }, @@ -2341,7 +2354,7 @@ static const SEQUENCE sequences_cmp[] = { "push %1!;$par!push %2!;$par!push %3!;$par!", "pushm #3 %1 %2 %3!", #else - "\212\214\303\250\303\270\234", + "\212\214\304\250\304\270\234", "\331\3113\353\270", #endif 3-1, 3-4 @@ -2351,7 +2364,7 @@ static const SEQUENCE sequences_cmp[] = { "push %1!;$par!push %2!;$par!", "pushm #2 %1 %2!", #else - "\212\214\303\250\234", + "\212\214\304\250\234", "\331\3112\342", #endif 2-1, 2-3 @@ -2362,8 +2375,8 @@ static const SEQUENCE sequences_cmp[] = { "push.s %1!;$par!push.s %2!;$par!push.s %3!;$par!push.s %4!;$par!push.s %5!;$par!", "pushm.s #5 %1 %2 %3 %4 %5!", #else - "\212\361\303\213\250\303\213\270\303\213\332\303\213\206\322\234", - "\331\213\3115\373\2064\206\322", + "\212\361\304\213\250\304\213\270\304\213\332\304\213\206\322\234", + "\331\213\3115\374\2064\206\322", #endif 5-1, 5-6 }, @@ -2372,8 +2385,8 @@ static const SEQUENCE sequences_cmp[] = { "push.s %1!;$par!push.s %2!;$par!push.s %3!;$par!push.s %4!;$par!", "pushm.s #4 %1 %2 %3 %4!", #else - "\212\361\303\213\250\303\213\270\303\213\332\234", - "\331\213\3114\373\332", + "\212\361\304\213\250\304\213\270\304\213\332\234", + "\331\213\3114\374\332", #endif 4-1, 4-5 }, @@ -2382,7 +2395,7 @@ static const SEQUENCE sequences_cmp[] = { "push.s %1!;$par!push.s %2!;$par!push.s %3!;$par!", "pushm.s #3 %1 %2 %3!", #else - "\212\361\303\213\250\303\213\270\234", + "\212\361\304\213\250\304\213\270\234", "\331\213\3113\353\270", #endif 3-1, 3-4 @@ -2392,7 +2405,7 @@ static const SEQUENCE sequences_cmp[] = { "push.s %1!;$par!push.s %2!;$par!", "pushm.s #2 %1 %2!", #else - "\212\361\303\213\250\234", + "\212\361\304\213\250\234", "\331\213\3112\342", #endif 2-1, 2-3 @@ -2403,8 +2416,8 @@ static const SEQUENCE sequences_cmp[] = { "push.adr %1!;$par!push.adr %2!;$par!push.adr %3!;$par!push.adr %4!;$par!push.adr %5!;$par!", "pushm.adr #5 %1 %2 %3 %4 %5!", #else - "\212\300\214\303\300\250\303\300\270\303\300\332\303\300\206\322\234", - "\331\300\3115\373\2064\206\322", + "\212\300\214\304\300\250\304\300\270\304\300\332\304\300\206\322\234", + "\331\300\3115\374\2064\206\322", #endif 5-1, 5-6 }, @@ -2413,8 +2426,8 @@ static const SEQUENCE sequences_cmp[] = { "push.adr %1!;$par!push.adr %2!;$par!push.adr %3!;$par!push.adr %4!;$par!", "pushm.adr #4 %1 %2 %3 %4!", #else - "\212\300\214\303\300\250\303\300\270\303\300\332\234", - "\331\300\3114\373\332", + "\212\300\214\304\300\250\304\300\270\304\300\332\234", + "\331\300\3114\374\332", #endif 4-1, 4-5 }, @@ -2423,7 +2436,7 @@ static const SEQUENCE sequences_cmp[] = { "push.adr %1!;$par!push.adr %2!;$par!push.adr %3!;$par!", "pushm.adr #3 %1 %2 %3!", #else - "\212\300\214\303\300\250\303\300\270\234", + "\212\300\214\304\300\250\304\300\270\234", "\331\300\3113\353\270", #endif 3-1, 3-4 @@ -2433,7 +2446,7 @@ static const SEQUENCE sequences_cmp[] = { "push.adr %1!;$par!push.adr %2!;$par!", "pushm.adr #2 %1 %2!", #else - "\212\300\214\303\300\250\234", + "\212\300\214\304\300\250\234", "\331\300\3112\342", #endif 2-1, 2-3 @@ -2444,8 +2457,8 @@ static const SEQUENCE sequences_cmp[] = { "pushr.c %1!;$par!pushr.c %2!;$par!pushr.c %3!;$par!pushr.c %4!;$par!pushr.c %5!;$par!", "pushrm.c #5 %1 %2 %3 %4 %5!", #else - "\253\362\316\236\250\316\236\270\316\236\332\316\236\206\322\234", - "\363\236\3115\373\2064\206\322", + "\253\362\316\240\250\316\240\270\316\240\332\316\240\206\322\234", + "\363\240\3115\374\2064\206\322", #endif 5-1, 5-6 }, @@ -2454,8 +2467,8 @@ static const SEQUENCE sequences_cmp[] = { "pushr.c %1!;$par!pushr.c %2!;$par!pushr.c %3!;$par!pushr.c %4!;$par!", "pushrm.c #4 %1 %2 %3 %4!", #else - "\253\362\316\236\250\316\236\270\316\236\332\234", - "\363\236\3114\373\332", + "\253\362\316\240\250\316\240\270\316\240\332\234", + "\363\240\3114\374\332", #endif 4-1, 4-5 }, @@ -2464,8 +2477,8 @@ static const SEQUENCE sequences_cmp[] = { "pushr.c %1!;$par!pushr.c %2!;$par!pushr.c %3!;$par!", "pushrm.c #3 %1 %2 %3!", #else - "\253\362\316\236\250\316\236\270\234", - "\363\236\3113\353\270", + "\253\362\316\240\250\316\240\270\234", + "\363\240\3113\353\270", #endif 3-1, 3-4 }, @@ -2474,8 +2487,8 @@ static const SEQUENCE sequences_cmp[] = { "pushr.c %1!;$par!pushr.c %2!;$par!", "pushrm.c #2 %1 %2!", #else - "\253\362\316\236\250\234", - "\363\236\3112\342", + "\253\362\316\240\250\234", + "\363\240\3112\342", #endif 2-1, 2-3 }, @@ -2486,7 +2499,7 @@ static const SEQUENCE sequences_cmp[] = { "pushrm.s #5 %1 %2 %3 %4 %5!", #else "\253\361\316\213\250\316\213\270\316\213\332\316\213\206\322\234", - "\363\213\3115\373\2064\206\322", + "\363\213\3115\374\2064\206\322", #endif 5-1, 5-6 }, @@ -2496,7 +2509,7 @@ static const SEQUENCE sequences_cmp[] = { "pushrm.s #4 %1 %2 %3 %4!", #else "\253\361\316\213\250\316\213\270\316\213\332\234", - "\363\213\3114\373\332", + "\363\213\3114\374\332", #endif 4-1, 4-5 }, @@ -2527,7 +2540,7 @@ static const SEQUENCE sequences_cmp[] = { "pushrm.adr #5 %1 %2 %3 %4 %5!", #else "\253\300\214\316\300\250\316\300\270\316\300\332\316\300\206\322\234", - "\363\300\3115\373\2064\206\322", + "\363\300\3115\374\2064\206\322", #endif 5-1, 5-6 }, @@ -2537,7 +2550,7 @@ static const SEQUENCE sequences_cmp[] = { "pushrm.adr #4 %1 %2 %3 %4!", #else "\253\300\214\316\300\250\316\300\270\316\300\332\234", - "\363\300\3114\373\332", + "\363\300\3114\374\332", #endif 4-1, 4-5 }, @@ -2657,8 +2670,8 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!stor %2!;$exp!", "const %2 %1!;$exp!", #else - "\304\370\250\257", - "\245\333\317", + "\303\370\250\257", + "\243\333\317", #endif 2-1, 2-2 }, @@ -2667,8 +2680,8 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %1!stor.s %2!;$exp!", "const.s %2 %1!;$exp!", #else - "\304\370\213\250\257", - "\245\213\333\317", + "\303\370\213\250\257", + "\243\213\333\317", #endif 2-1, 2-2 }, @@ -2754,8 +2767,8 @@ static const SEQUENCE sequences_cmp[] = { "lodb.i %0!", "lodb.p.i %0!", #else - "\215db.\200%\241", - "\215db\224.\200%\241", + "\215db.\200%\245", + "\215db\224.\200%\245", #endif 1-1, 1-0 }, @@ -2764,8 +2777,8 @@ static const SEQUENCE sequences_cmp[] = { "const.pri %0!", "const.p.pri %0!", #else - "\245\366", - "\245\224\366", + "\243\366", + "\243\224\366", #endif 1-1, 1-0 }, @@ -2774,8 +2787,8 @@ static const SEQUENCE sequences_cmp[] = { "const.alt %0!", "const.p.alt %0!", #else - "\245\223\261", - "\245\224\223\261", + "\243\223\261", + "\243\224\223\261", #endif 1-1, 1-0 }, @@ -2814,8 +2827,8 @@ static const SEQUENCE sequences_cmp[] = { "stor.s %0!", "stor.p.s %0!", #else - "\370\376", - "\370\224\376", + "\370\213\261", + "\370\224\213\261", #endif 1-1, 1-0 }, @@ -2824,8 +2837,8 @@ static const SEQUENCE sequences_cmp[] = { "sref.s %0!", "sref.p.s %0!", #else - "s\321\376", - "s\321\224\376", + "s\321\213\261", + "s\321\224\213\261", #endif 1-1, 1-0 }, @@ -2834,8 +2847,8 @@ static const SEQUENCE sequences_cmp[] = { "strb.i %0!", "strb.p.i %0!", #else - "\231rb.\200%\241", - "\231rb\224.\200%\241", + "\231rb.\200%\245", + "\231rb\224.\200%\245", #endif 1-1, 1-0 }, @@ -2874,8 +2887,8 @@ static const SEQUENCE sequences_cmp[] = { "push.c %0!", "push.p.c %0!", #else - "\212\236\261", - "\212\224\236\261", + "\212\240\261", + "\212\224\240\261", #endif 1-1, 1-0 }, @@ -2894,8 +2907,8 @@ static const SEQUENCE sequences_cmp[] = { "push.s %0!", "push.p.s %0!", #else - "\212\376", - "\212\224\376", + "\212\213\261", + "\212\224\213\261", #endif 1-1, 1-0 }, @@ -2914,8 +2927,8 @@ static const SEQUENCE sequences_cmp[] = { "pushr.c %0!", "pushr.p.c %0!", #else - "\253\236\261", - "\253\224\236\261", + "\253\240\261", + "\253\224\240\261", #endif 1-1, 1-0 }, @@ -2924,8 +2937,8 @@ static const SEQUENCE sequences_cmp[] = { "pushr.s %0!", "pushr.p.s %0!", #else - "\253\376", - "\253\224\376", + "\253\213\261", + "\253\224\213\261", #endif 1-1, 1-0 }, @@ -2944,8 +2957,8 @@ static const SEQUENCE sequences_cmp[] = { "pushm.c %0 %1~%2~%3~%4~%5!", "pushm.p.c %0 %1~%2~%3~%4~%5!", #else - "\331\236\375\265\372\374\2674\267\322", - "\331\224\236\375\265\372\374\2674\267\322", + "\331\240\376\265\373\375\2664\266\322", + "\331\224\240\376\265\373\375\2664\266\322", #endif 1-1, 1-0 }, @@ -2954,8 +2967,8 @@ static const SEQUENCE sequences_cmp[] = { "pushm %0 %1~%2~%3~%4~%5!", "pushm.p %0 %1~%2~%3~%4~%5!", #else - "\331\375\265\372\374\2674\267\322", - "\331\224\375\265\372\374\2674\267\322", + "\331\376\265\373\375\2664\266\322", + "\331\224\376\265\373\375\2664\266\322", #endif 1-1, 1-0 }, @@ -2964,8 +2977,8 @@ static const SEQUENCE sequences_cmp[] = { "pushm.s %0 %1~%2~%3~%4~%5!", "pushm.p.s %0 %1~%2~%3~%4~%5!", #else - "\331\213\375\265\372\374\2674\267\322", - "\331\224\213\375\265\372\374\2674\267\322", + "\331\213\376\265\373\375\2664\266\322", + "\331\224\213\376\265\373\375\2664\266\322", #endif 1-1, 1-0 }, @@ -2974,8 +2987,8 @@ static const SEQUENCE sequences_cmp[] = { "pushm.adr %0 %1~%2~%3~%4~%5!", "pushm.p.adr %0 %1~%2~%3~%4~%5!", #else - "\331\300\375\265\372\374\2674\267\322", - "\331\224\300\375\265\372\374\2674\267\322", + "\331\300\376\265\373\375\2664\266\322", + "\331\224\300\376\265\373\375\2664\266\322", #endif 1-1, 1-0 }, @@ -2984,8 +2997,8 @@ static const SEQUENCE sequences_cmp[] = { "pushrm.c %0 %1~%2~%3~%4~%5!", "pushrm.p.c %0 %1~%2~%3~%4~%5!", #else - "\363\236\375\265\372\374\2674\267\322", - "\363\224\236\375\265\372\374\2674\267\322", + "\363\240\376\265\373\375\2664\266\322", + "\363\224\240\376\265\373\375\2664\266\322", #endif 1-1, 1-0 }, @@ -2994,8 +3007,8 @@ static const SEQUENCE sequences_cmp[] = { "pushrm.s %0 %1~%2~%3~%4~%5!", "pushrm.p.s %0 %1~%2~%3~%4~%5!", #else - "\363\213\375\265\372\374\2674\267\322", - "\363\224\213\375\265\372\374\2674\267\322", + "\363\213\376\265\373\375\2664\266\322", + "\363\224\213\376\265\373\375\2664\266\322", #endif 1-1, 1-0 }, @@ -3004,8 +3017,8 @@ static const SEQUENCE sequences_cmp[] = { "pushrm.adr %0 %1~%2~%3~%4~%5!", "pushrm.p.adr %0 %1~%2~%3~%4~%5!", #else - "\363\300\375\265\372\374\2674\267\322", - "\363\224\300\375\265\372\374\2674\267\322", + "\363\300\376\265\373\375\2664\266\322", + "\363\224\300\376\265\373\375\2664\266\322", #endif 1-1, 1-0 }, @@ -3035,7 +3048,7 @@ static const SEQUENCE sequences_cmp[] = { "shl.p.c.pri %0!", #else "\341\366", - "\330\224\236\366", + "\330\224\240\366", #endif 1-1, 1-0 }, @@ -3045,7 +3058,7 @@ static const SEQUENCE sequences_cmp[] = { "shl.p.c.alt %0!", #else "\341\223\261", - "\330\224\236\223\261", + "\330\224\240\223\261", #endif 1-1, 1-0 }, @@ -3054,8 +3067,8 @@ static const SEQUENCE sequences_cmp[] = { "add.c %0!", "add.p.c %0!", #else - "\246\236\261", - "\246\224\236\261", + "\246\240\261", + "\246\224\240\261", #endif 1-1, 1-0 }, @@ -3064,8 +3077,8 @@ static const SEQUENCE sequences_cmp[] = { "smul.c %0!", "smul.p.c %0!", #else - "smul\236\261", - "smul\224\236\261", + "smul\240\261", + "smul\224\240\261", #endif 1-1, 1-0 }, @@ -3084,8 +3097,8 @@ static const SEQUENCE sequences_cmp[] = { "zero.s %0!", "zero.p.s %0!", #else - "\350\376", - "\350\224\376", + "\350\213\261", + "\350\224\213\261", #endif 1-1, 1-0 }, @@ -3094,8 +3107,8 @@ static const SEQUENCE sequences_cmp[] = { "eq.c.pri %0!", "eq.p.c.pri %0!", #else - "\302\236\366", - "\302\224\236\366", + "\302\240\366", + "\302\224\240\366", #endif 1-1, 1-0 }, @@ -3104,8 +3117,8 @@ static const SEQUENCE sequences_cmp[] = { "eq.c.alt %0!", "eq.p.c.alt %0!", #else - "\302\236\223\261", - "\302\224\236\223\261", + "\302\240\223\261", + "\302\224\240\223\261", #endif 1-1, 1-0 }, @@ -3124,8 +3137,8 @@ static const SEQUENCE sequences_cmp[] = { "inc.s %0!", "inc.p.s %0!", #else - "\312\376", - "\312\224\376", + "\312\213\261", + "\312\224\213\261", #endif 1-1, 1-0 }, @@ -3144,8 +3157,8 @@ static const SEQUENCE sequences_cmp[] = { "dec.s %0!", "dec.p.s %0!", #else - "\314\376", - "\314\224\376", + "\314\213\261", + "\314\224\213\261", #endif 1-1, 1-0 }, @@ -3184,8 +3197,8 @@ static const SEQUENCE sequences_cmp[] = { "halt %0!", "halt.p %0!", #else - "h\222\261", - "h\222\224\261", + "h\221\261", + "h\221\224\261", #endif 1-1, 1-0 }, diff --git a/compiler/scstate.c b/compiler/scstate.c index 02fd5a6..a8e8c5f 100644 --- a/compiler/scstate.c +++ b/compiler/scstate.c @@ -39,7 +39,7 @@ * License for the specific language governing permissions and limitations * under the License. * - * Version: $Id: scstate.c 6932 2023-04-03 13:56:19Z thiadmer $ + * Version: $Id: scstate.c 7152 2024-03-23 20:47:23Z thiadmer $ */ #include #include @@ -243,7 +243,7 @@ static statepool *state_getlist_ptr(int listid) return ptr; } -SC_FUNC int state_addlist(int *list,int count,int fsa) +SC_FUNC int state_addlist(const int *list,int count,int fsa) { statepool *ptr; int last; @@ -298,7 +298,7 @@ SC_FUNC int state_getfsa(int listid) SC_FUNC int state_count(int listid) { - statepool *ptr=state_getlist_ptr(listid); + const statepool *ptr=state_getlist_ptr(listid); if (ptr==NULL) return 0; /* unknown list, no states in it */ return ptr->numstates; @@ -306,7 +306,7 @@ SC_FUNC int state_count(int listid) SC_FUNC int state_inlist(int listid,int state) { - statepool *ptr; + const statepool *ptr; int i; ptr=state_getlist_ptr(listid); @@ -328,7 +328,7 @@ SC_FUNC int state_listitem(int listid,int index) return ptr->states[index]; } -static int checkconflict(statepool *psrc,statepool *ptgt) +static int checkconflict(const statepool *psrc,const statepool *ptgt) { int s,t; diff --git a/compiler/scvars.c b/compiler/scvars.c index bf60016..9e055ba 100644 --- a/compiler/scvars.c +++ b/compiler/scvars.c @@ -16,7 +16,7 @@ * License for the specific language governing permissions and limitations * under the License. * - * Version: $Id: scvars.c 6131 2020-04-29 19:47:15Z thiadmer $ + * Version: $Id: scvars.c 7151 2024-03-23 16:08:18Z thiadmer $ */ #include #include /* for _MAX_PATH */ @@ -31,7 +31,7 @@ SC_VDEFINE symbol loctab; /* local symbol table */ SC_VDEFINE symbol glbtab; /* global symbol table */ SC_VDEFINE cell *litq; /* the literal queue */ SC_VDEFINE unsigned char *srcline=NULL; /* the line read from the input file */ -SC_VDEFINE const unsigned char *lptr; /* points to the current position in "srcline" */ +SC_VDEFINE const unsigned char *lexptr; /* points to the current position in "srcline" */ SC_VDEFINE constvalue tagname_tab = { NULL, "", 0, 0}; /* tagname table */ SC_VDEFINE constvalue libname_tab = { NULL, "", 0, 0}; /* library table (#pragma library "..." syntax) */ SC_VDEFINE constvalue *curlibrary = NULL; /* current library */ diff --git a/compiler/stategraph.c b/compiler/stategraph.c index 8fab892..6bebd52 100644 --- a/compiler/stategraph.c +++ b/compiler/stategraph.c @@ -16,7 +16,7 @@ * License for the specific language governing permissions and limitations * under the License. * - * Version: $Id: stategraph.c 6131 2020-04-29 19:47:15Z thiadmer $ + * Version: $Id: stategraph.c 6970 2023-07-28 20:12:00Z thiadmer $ */ #include #include diff --git a/compiler/svnrev.h b/compiler/svnrev.h index d395900..8bd10cd 100644 --- a/compiler/svnrev.h +++ b/compiler/svnrev.h @@ -2,18 +2,18 @@ * (https://www.compuphase.com/svnrev.htm). * You should not modify it manually, as it may be re-generated. * - * $Revision: 7113M$ - * $Date: 2024-02-25$ + * $Revision: 7152$ + * $Date: 2024-03-23$ */ #ifndef _SVNREV_H_ #define _SVNREV_H_ -#define SVNREV_NUM 7113 -#define SVNREV_STR "7113M" -#define SVNREV_RCS "$Revision: 7113M $" -#define SVNREV_DATE "2024-02-25" -#define SVNREV_STAMP 20240225L -#define SVNREV_MODIFIED 1 +#define SVNREV_NUM 7152 +#define SVNREV_STR "7152" +#define SVNREV_RCS "$Revision: 7152 $" +#define SVNREV_DATE "2024-03-23" +#define SVNREV_STAMP 20240323L +#define SVNREV_MODIFIED 0 #endif /* _SVNREV_H_ */ diff --git a/doc/Pawn_Implementer_Guide.aux b/doc/Pawn_Implementer_Guide.aux index 33957e1..55e76a8 100644 --- a/doc/Pawn_Implementer_Guide.aux +++ b/doc/Pawn_Implementer_Guide.aux @@ -330,21 +330,22 @@ \@definepageanchor{107} \@definelabel{mb.22}{107}{marginbox}{111} \@definepageanchor{107} -\@definelabel{p.A microcontroller project}{109}{page}{113} \@definepageanchor{109} +\@definelabel{p.A microcontroller project}{110}{page}{113} \@definepageanchor{110} -\@definepageanchor{112} +\@definepageanchor{111} \@definepageanchor{113} -\@definelabel{p.Running scripts with overlays}{114}{page}{118} -\@definelabel{Running scripts with overlays}{74}{Appendix}{118} -\@definelabel{p.app.overlays}{114}{page}{118} \@definepageanchor{114} -\@definelabel{p.Configuring the compiler}{114}{page}{118} -\@definelabel{p.Initializing the abstract machine}{115}{page}{119} -\@definelabel{p.The overlay callback function}{116}{page}{119} -\@definelabel{mb.23}{116}{marginbox}{120} -\@definelabel{p.Loading scripts with and without overlays}{117}{page}{120} -\@definelabel{p.License}{118}{page}{122} -\@definelabel{License}{75}{Appendix}{122} -\@definepageanchor{118} +\@definelabel{p.Running scripts with overlays}{115}{page}{119} +\@definelabel{Running scripts with overlays}{74}{Appendix}{119} +\@definelabel{p.app.overlays}{115}{page}{119} +\@definepageanchor{115} +\@definelabel{p.Configuring the compiler}{115}{page}{119} +\@definelabel{p.Initializing the abstract machine}{116}{page}{120} +\@definelabel{p.The overlay callback function}{117}{page}{120} +\@definelabel{mb.23}{117}{marginbox}{121} +\@definelabel{p.Loading scripts with and without overlays}{118}{page}{121} +\@definelabel{p.License}{119}{page}{123} +\@definelabel{License}{75}{Appendix}{123} +\@definepageanchor{119} \@definelabel{p.Index}{123}{page}{127} diff --git a/doc/Pawn_Implementer_Guide.pdf b/doc/Pawn_Implementer_Guide.pdf index ce5d257..cb9a3c7 100644 Binary files a/doc/Pawn_Implementer_Guide.pdf and b/doc/Pawn_Implementer_Guide.pdf differ diff --git a/doc/Pawn_Language_Guide.pdf b/doc/Pawn_Language_Guide.pdf index 3575b0e..0673673 100644 Binary files a/doc/Pawn_Language_Guide.pdf and b/doc/Pawn_Language_Guide.pdf differ diff --git a/test/test.rexx b/test/test.rexx index a12e833..7bf6cc9 100644 --- a/test/test.rexx +++ b/test/test.rexx @@ -1163,7 +1163,7 @@ test87: test88: say '88. The following test should issue error 001 (followed by more errors).' say '' - say ' A multi-dimensional array in initialized with {...} syntax for the major' + say ' A multi-dimensional array is initialized with {...} syntax for the major' say ' dimension.' say '-----' pawncc ' -p ARRAY_VARDIM_WRONGBRACKETS= test1' @@ -1337,7 +1337,7 @@ test102: test103: say '103. The following test should compile successfully (NO warnings 213).' say '' - say ' Symbolic array indices with tag overrides.' + say ' Symbolic array indices with tag overrides.' say '-----' pawncc ' TAGGED_SYMBOLIC_INDEX= rational' return @@ -1750,7 +1750,7 @@ test136: return test137: - say '137. The following test should issue error 010 (followed by others).' + say '137. The following test should issue error 008.' say '' say ' A global variable initialized by a function call.' say '' diff --git a/test/test1.p b/test/test1.p index af40834..3a216e2 100644 --- a/test/test1.p +++ b/test/test1.p @@ -206,7 +206,8 @@ new Filenames[6]{} = #endif #if defined INVALID_GLOBAL_DECL - new port = readcfgvalue(.key = "proxy-port", .filename = config_network) + #include file + new port = readcfgvalue(.key = "proxy-port", .filename = "abc") #endif #if defined ZERO_ARRAY_TWO_DIMS @@ -338,16 +339,16 @@ main() #endif #if defined SELF_ASSIGNMENT - new var = 0 - var = var + new test = 0 + test = test new array[4] = [ 1, 2, ... ] array[2] = array[2] #endif #if defined NO_SELF_ASSIGNMENT - new var = 0 - var = !var + new test = 0 + test = !test #endif #if defined USELESS_DECLARE1 @@ -575,6 +576,10 @@ main() #if defined ZERO_ARRAY_TWO_DIMS array[0][0]=0 #endif + + #if defined INVALID_GLOBAL_DECL + port = port + 1 /* to avoid global variable being optimized out */ + #endif } #if defined LOCAL_SHADOWS diff --git a/test/test13.p b/test/test13.p index b44b97d..9462c04 100644 --- a/test/test13.p +++ b/test/test13.p @@ -1,12 +1,12 @@ proccall_func(dummy) { - new var = 0 - return var + dummy + new test = 0 + return test + dummy } main() { - proccall_func var + proccall_func test }