updated compiler to 3.2.3636
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%4067
This commit is contained in:
parent
b8d6dddea5
commit
d792a19e4a
@ -18,7 +18,7 @@
|
|||||||
* misrepresented as being the original software.
|
* misrepresented as being the original software.
|
||||||
* 3. This notice may not be removed or altered from any source distribution.
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
*
|
*
|
||||||
* Version: $Id: amx.h 3579 2006-06-06 13:35:29Z thiadmer $
|
* Version: $Id: amx.h 3633 2006-08-11 16:20:18Z thiadmer $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef AMX_H_INCLUDED
|
#ifndef AMX_H_INCLUDED
|
||||||
@ -266,6 +266,7 @@ typedef struct tagAMX {
|
|||||||
cell alt ;
|
cell alt ;
|
||||||
cell reset_stk ;
|
cell reset_stk ;
|
||||||
cell reset_hea ;
|
cell reset_hea ;
|
||||||
|
/* extra fields for increased performance */
|
||||||
cell sysreq_d ; /* relocated address/value for the SYSREQ.D opcode */
|
cell sysreq_d ; /* relocated address/value for the SYSREQ.D opcode */
|
||||||
#if defined JIT
|
#if defined JIT
|
||||||
/* support variables for the JIT */
|
/* support variables for the JIT */
|
||||||
@ -341,6 +342,7 @@ enum {
|
|||||||
#define AMX_FLAG_COMPACT 0x04 /* compact encoding */
|
#define AMX_FLAG_COMPACT 0x04 /* compact encoding */
|
||||||
#define AMX_FLAG_SLEEP 0x08 /* script uses the sleep instruction (possible re-entry or power-down mode) */
|
#define AMX_FLAG_SLEEP 0x08 /* script uses the sleep instruction (possible re-entry or power-down mode) */
|
||||||
#define AMX_FLAG_NOCHECKS 0x10 /* no array bounds checking; no BREAK opcodes */
|
#define AMX_FLAG_NOCHECKS 0x10 /* no array bounds checking; no BREAK opcodes */
|
||||||
|
#define AMX_FLAG_SYSREQN 0x800 /* script new (optimized) version of SYSREQ opcode */
|
||||||
#define AMX_FLAG_NTVREG 0x1000 /* all native functions are registered */
|
#define AMX_FLAG_NTVREG 0x1000 /* all native functions are registered */
|
||||||
#define AMX_FLAG_JITC 0x2000 /* abstract machine is JIT compiled */
|
#define AMX_FLAG_JITC 0x2000 /* abstract machine is JIT compiled */
|
||||||
#define AMX_FLAG_BROWSE 0x4000 /* busy browsing */
|
#define AMX_FLAG_BROWSE 0x4000 /* busy browsing */
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
* misrepresented as being the original software.
|
* misrepresented as being the original software.
|
||||||
* 3. This notice may not be removed or altered from any source distribution.
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
*
|
*
|
||||||
* Version: $Id: amxdbg.h 3519 2006-02-17 17:57:04Z thiadmer $
|
* Version: $Id: amxdbg.h 3612 2006-07-22 09:59:46Z thiadmer $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef AMXDBG_H_INCLUDED
|
#ifndef AMXDBG_H_INCLUDED
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
* misrepresented as being the original software.
|
* misrepresented as being the original software.
|
||||||
* 3. This notice may not be removed or altered from any source distribution.
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
*
|
*
|
||||||
* Version: $Id: libsc.c 3114 2005-03-17 14:48:29Z thiadmer $
|
* Version: $Id: libpawnc.c 3612 2006-07-22 09:59:46Z thiadmer $
|
||||||
*/
|
*/
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -139,7 +139,7 @@ int main(int argc, char *argv[])
|
|||||||
cod.flags = 0;
|
cod.flags = 0;
|
||||||
if (hdr->flags & AMX_FLAG_DEBUG)
|
if (hdr->flags & AMX_FLAG_DEBUG)
|
||||||
{
|
{
|
||||||
cod.flags |= SP_FILE_DEBUG;
|
cod.flags |= SP_FLAG_DEBUG;
|
||||||
}
|
}
|
||||||
cod.code = sizeof(cod);
|
cod.code = sizeof(cod);
|
||||||
cod.main = hdr->cip;
|
cod.main = hdr->cip;
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
* misrepresented as being the original software.
|
* misrepresented as being the original software.
|
||||||
* 3. This notice may not be removed or altered from any source distribution.
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
*
|
*
|
||||||
* Version: $Id: sc.h 3590 2006-06-24 14:16:39Z thiadmer $
|
* Version: $Id: sc.h 3636 2006-08-14 15:42:05Z thiadmer $
|
||||||
*/
|
*/
|
||||||
#ifndef SC_H_INCLUDED
|
#ifndef SC_H_INCLUDED
|
||||||
#define SC_H_INCLUDED
|
#define SC_H_INCLUDED
|
||||||
@ -279,11 +279,11 @@ typedef struct s_stringpair {
|
|||||||
#define opargs(n) ((n)*sizeof(cell)) /* size of typical argument */
|
#define opargs(n) ((n)*sizeof(cell)) /* size of typical argument */
|
||||||
|
|
||||||
/* Tokens recognized by lex()
|
/* Tokens recognized by lex()
|
||||||
* Some of these constants are assigned as well to the variable "lastst"
|
* Some of these constants are assigned as well to the variable "lastst" (see SC1.C)
|
||||||
*/
|
*/
|
||||||
#define tFIRST 256 /* value of first multi-character operator */
|
#define tFIRST 256 /* value of first multi-character operator */
|
||||||
#define tMIDDLE 280 /* value of last multi-character operator */
|
#define tMIDDLE 280 /* value of last multi-character operator */
|
||||||
#define tLAST 326 /* value of last multi-character match-able token */
|
#define tLAST 329 /* value of last multi-character match-able token */
|
||||||
/* multi-character operators */
|
/* multi-character operators */
|
||||||
#define taMULT 256 /* *= */
|
#define taMULT 256 /* *= */
|
||||||
#define taDIV 257 /* /= */
|
#define taDIV 257 /* /= */
|
||||||
@ -312,62 +312,66 @@ typedef struct s_stringpair {
|
|||||||
#define tDBLCOLON 280 /* :: */
|
#define tDBLCOLON 280 /* :: */
|
||||||
/* reserved words (statements) */
|
/* reserved words (statements) */
|
||||||
#define tASSERT 281
|
#define tASSERT 281
|
||||||
#define tBREAK 282
|
#define tBEGIN 282
|
||||||
#define tCASE 283
|
#define tBREAK 283
|
||||||
#define tCHAR 284
|
#define tCASE 284
|
||||||
#define tCONST 285
|
#define tCHAR 285
|
||||||
#define tCONTINUE 286
|
#define tCONST 286
|
||||||
#define tDEFAULT 287
|
#define tCONTINUE 287
|
||||||
#define tDEFINED 288
|
#define tDEFAULT 288
|
||||||
#define tDO 289
|
#define tDEFINED 289
|
||||||
#define tELSE 290
|
#define tDO 290
|
||||||
#define tENUM 291
|
#define tELSE 291
|
||||||
#define tEXIT 292
|
#define tEND 292
|
||||||
#define tFOR 293
|
#define tENUM 293
|
||||||
#define tFORWARD 294
|
#define tEXIT 294
|
||||||
#define tGOTO 295
|
#define tFOR 295
|
||||||
#define tIF 296
|
#define tFORWARD 296
|
||||||
#define tNATIVE 297
|
#define tGOTO 297
|
||||||
#define tNEW 298
|
#define tIF 298
|
||||||
#define tDECL 299
|
#define tNATIVE 299
|
||||||
#define tOPERATOR 300
|
#define tNEW 300
|
||||||
#define tPUBLIC 301
|
#define tDECL 301
|
||||||
#define tRETURN 302
|
#define tOPERATOR 302
|
||||||
#define tSIZEOF 303
|
#define tPUBLIC 303
|
||||||
#define tSLEEP 304
|
#define tRETURN 304
|
||||||
#define tSTATE 305
|
#define tSIZEOF 305
|
||||||
#define tSTATIC 306
|
#define tSLEEP 306
|
||||||
#define tSTOCK 307
|
#define tSTATE 307
|
||||||
#define tSWITCH 308
|
#define tSTATIC 308
|
||||||
#define tTAGOF 309
|
#define tSTOCK 309
|
||||||
#define tWHILE 310
|
#define tSWITCH 310
|
||||||
|
#define tTAGOF 311
|
||||||
|
#define tTHEN 312
|
||||||
|
#define tWHILE 313
|
||||||
/* compiler directives */
|
/* compiler directives */
|
||||||
#define tpASSERT 311 /* #assert */
|
#define tpASSERT 314 /* #assert */
|
||||||
#define tpDEFINE 312
|
#define tpDEFINE 315
|
||||||
#define tpELSE 313 /* #else */
|
#define tpELSE 316 /* #else */
|
||||||
#define tpELSEIF 314 /* #elseif */
|
#define tpELSEIF 317 /* #elseif */
|
||||||
#define tpEMIT 315
|
#define tpEMIT 318
|
||||||
#define tpENDIF 316
|
#define tpENDIF 319
|
||||||
#define tpENDINPUT 317
|
#define tpENDINPUT 320
|
||||||
#define tpENDSCRPT 318
|
#define tpENDSCRPT 321
|
||||||
#define tpERROR 319
|
#define tpERROR 322
|
||||||
#define tpFILE 320
|
#define tpFILE 323
|
||||||
#define tpIF 321 /* #if */
|
#define tpIF 324 /* #if */
|
||||||
#define tINCLUDE 322
|
#define tINCLUDE 325
|
||||||
#define tpLINE 323
|
#define tpLINE 326
|
||||||
#define tpPRAGMA 324
|
#define tpPRAGMA 327
|
||||||
#define tpTRYINCLUDE 325
|
#define tpTRYINCLUDE 328
|
||||||
#define tpUNDEF 326
|
#define tpUNDEF 329
|
||||||
/* semicolon is a special case, because it can be optional */
|
/* semicolon is a special case, because it can be optional */
|
||||||
#define tTERM 327 /* semicolon or newline */
|
#define tTERM 330 /* semicolon or newline */
|
||||||
#define tENDEXPR 328 /* forced end of expression */
|
#define tENDEXPR 331 /* forced end of expression */
|
||||||
/* other recognized tokens */
|
/* other recognized tokens */
|
||||||
#define tNUMBER 329 /* integer number */
|
#define tNUMBER 332 /* integer number */
|
||||||
#define tRATIONAL 330 /* rational number */
|
#define tRATIONAL 333 /* rational number */
|
||||||
#define tSYMBOL 331
|
#define tSYMBOL 334
|
||||||
#define tLABEL 332
|
#define tLABEL 335
|
||||||
#define tSTRING 333
|
#define tSTRING 336
|
||||||
#define tEXPR 334 /* for assigment to "lastst" only */
|
#define tEXPR 337 /* for assigment to "lastst" only (see SC1.C) */
|
||||||
|
#define tENDLESS 338 /* endless loop, for assigment to "lastst" only */
|
||||||
|
|
||||||
/* (reversed) evaluation of staging buffer */
|
/* (reversed) evaluation of staging buffer */
|
||||||
#define sSTARTREORDER 0x01
|
#define sSTARTREORDER 0x01
|
||||||
@ -698,15 +702,15 @@ SC_FUNC void delete_dbgstringtable(void);
|
|||||||
typedef unsigned char MEMFILE;
|
typedef unsigned char MEMFILE;
|
||||||
#define tMEMFILE 1
|
#define tMEMFILE 1
|
||||||
#endif
|
#endif
|
||||||
MEMFILE *mfcreate(char *filename);
|
MEMFILE *mfcreate(const char *filename);
|
||||||
void mfclose(MEMFILE *mf);
|
void mfclose(MEMFILE *mf);
|
||||||
int mfdump(MEMFILE *mf);
|
int mfdump(MEMFILE *mf);
|
||||||
long mflength(MEMFILE *mf);
|
long mflength(const MEMFILE *mf);
|
||||||
long mfseek(MEMFILE *mf,long offset,int whence);
|
long mfseek(MEMFILE *mf,long offset,int whence);
|
||||||
unsigned int mfwrite(MEMFILE *mf,unsigned char *buffer,unsigned int size);
|
unsigned int mfwrite(MEMFILE *mf,const unsigned char *buffer,unsigned int size);
|
||||||
unsigned int mfread(MEMFILE *mf,unsigned char *buffer,unsigned int size);
|
unsigned int mfread(MEMFILE *mf,unsigned char *buffer,unsigned int size);
|
||||||
char *mfgets(MEMFILE *mf,char *string,unsigned int size);
|
char *mfgets(MEMFILE *mf,char *string,unsigned int size);
|
||||||
int mfputs(MEMFILE *mf,char *string);
|
int mfputs(MEMFILE *mf,const char *string);
|
||||||
|
|
||||||
/* function prototypes in SCI18N.C */
|
/* function prototypes in SCI18N.C */
|
||||||
#define MAXCODEPAGE 12
|
#define MAXCODEPAGE 12
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
* misrepresented as being the original software.
|
* misrepresented as being the original software.
|
||||||
* 3. This notice may not be removed or altered from any source distribution.
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
*
|
*
|
||||||
* Version: $Id: sc1.c 3591 2006-06-25 14:30:07Z thiadmer $
|
* Version: $Id: sc1.c 3636 2006-08-14 15:42:05Z thiadmer $
|
||||||
*/
|
*/
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@ -109,21 +109,21 @@ static long max_stacksize(symbol *root,int *recursion);
|
|||||||
static int testsymbols(symbol *root,int level,int testlabs,int testconst);
|
static int testsymbols(symbol *root,int level,int testlabs,int testconst);
|
||||||
static void destructsymbols(symbol *root,int level);
|
static void destructsymbols(symbol *root,int level);
|
||||||
static constvalue *find_constval_byval(constvalue *table,cell val);
|
static constvalue *find_constval_byval(constvalue *table,cell val);
|
||||||
|
static symbol *fetchlab(char *name);
|
||||||
static void statement(int *lastindent,int allow_decl);
|
static void statement(int *lastindent,int allow_decl);
|
||||||
static void compound(int stmt_sameline);
|
static void compound(int stmt_sameline,int starttok);
|
||||||
|
static int test(int label,int parens,int invert);
|
||||||
static int doexpr(int comma,int chkeffect,int allowarray,int mark_endexpr,
|
static int doexpr(int comma,int chkeffect,int allowarray,int mark_endexpr,
|
||||||
int *tag,symbol **symptr,int chkfuncresult);
|
int *tag,symbol **symptr,int chkfuncresult);
|
||||||
static void doassert(void);
|
static void doassert(void);
|
||||||
static void doexit(void);
|
static void doexit(void);
|
||||||
static void test(int label,int parens,int invert);
|
static int doif(void);
|
||||||
static void doif(void);
|
static int dowhile(void);
|
||||||
static void dowhile(void);
|
static int dodo(void);
|
||||||
static void dodo(void);
|
static int dofor(void);
|
||||||
static void dofor(void);
|
|
||||||
static void doswitch(void);
|
static void doswitch(void);
|
||||||
static void dogoto(void);
|
static void dogoto(void);
|
||||||
static void dolabel(void);
|
static void dolabel(void);
|
||||||
static symbol *fetchlab(char *name);
|
|
||||||
static void doreturn(void);
|
static void doreturn(void);
|
||||||
static void dobreak(void);
|
static void dobreak(void);
|
||||||
static void docont(void);
|
static void docont(void);
|
||||||
@ -134,10 +134,17 @@ static void delwhile(void);
|
|||||||
static int *readwhile(void);
|
static int *readwhile(void);
|
||||||
static void inst_datetime_defines(void);
|
static void inst_datetime_defines(void);
|
||||||
|
|
||||||
|
enum {
|
||||||
|
TEST_PLAIN, /* no parentheses */
|
||||||
|
TEST_THEN, /* '(' <expr> ')' or <expr> 'then' */
|
||||||
|
TEST_DO, /* '(' <expr> ')' or <expr> 'do' */
|
||||||
|
TEST_OPT, /* '(' <expr> ')' or <expr> */
|
||||||
|
};
|
||||||
static int norun = 0; /* the compiler never ran */
|
static int norun = 0; /* the compiler never ran */
|
||||||
static int autozero = 1; /* if 1 will zero out the variable, if 0 omit the zeroing */
|
static int autozero = 1; /* if 1 will zero out the variable, if 0 omit the zeroing */
|
||||||
static int lastst = 0; /* last executed statement type */
|
static int lastst = 0; /* last executed statement type */
|
||||||
static int nestlevel = 0; /* number of active (open) compound statements */
|
static int nestlevel = 0; /* number of active (open) compound statements */
|
||||||
|
static int endlessloop= 0; /* nesting level of endless loop */
|
||||||
static int rettype = 0; /* the type that a "return" expression should have */
|
static int rettype = 0; /* the type that a "return" expression should have */
|
||||||
static int skipinput = 0; /* number of lines to skip from the first input file */
|
static int skipinput = 0; /* number of lines to skip from the first input file */
|
||||||
static int optproccall = TRUE; /* support "procedure call" */
|
static int optproccall = TRUE; /* support "procedure call" */
|
||||||
@ -449,9 +456,9 @@ cleanup:
|
|||||||
pc_printf("Stack/heap size: %8ld bytes; ", (long)pc_stksize*sizeof(cell));
|
pc_printf("Stack/heap size: %8ld bytes; ", (long)pc_stksize*sizeof(cell));
|
||||||
pc_printf("estimated max. usage");
|
pc_printf("estimated max. usage");
|
||||||
if (recursion)
|
if (recursion)
|
||||||
pc_printf(" is unknown, due to recursion\n");
|
pc_printf(": unknown, due to recursion\n");
|
||||||
else if ((pc_memflags & suSLEEP_INSTR)!=0)
|
else if ((pc_memflags & suSLEEP_INSTR)!=0)
|
||||||
pc_printf(" is unknown, due to the \"sleep\" instruction\n");
|
pc_printf(": unknown, due to the \"sleep\" instruction\n");
|
||||||
else
|
else
|
||||||
pc_printf("=%ld cells (%ld bytes)\n",stacksize,stacksize*sizeof(cell));
|
pc_printf("=%ld cells (%ld bytes)\n",stacksize,stacksize*sizeof(cell));
|
||||||
pc_printf("Total requirements:%8ld bytes\n", (long)hdrsize+(long)code_idx+(long)glb_declared*sizeof(cell)+(long)pc_stksize*sizeof(cell));
|
pc_printf("Total requirements:%8ld bytes\n", (long)hdrsize+(long)code_idx+(long)glb_declared*sizeof(cell)+(long)pc_stksize*sizeof(cell));
|
||||||
@ -1415,6 +1422,9 @@ static void dumplits(void)
|
|||||||
{
|
{
|
||||||
int j,k;
|
int j,k;
|
||||||
|
|
||||||
|
if (sc_status==statSKIP)
|
||||||
|
return;
|
||||||
|
|
||||||
k=0;
|
k=0;
|
||||||
while (k<litidx){
|
while (k<litidx){
|
||||||
/* should be in the data segment */
|
/* should be in the data segment */
|
||||||
@ -1444,7 +1454,7 @@ static void dumpzero(int count)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (count<=0)
|
if (sc_status==statSKIP || count<=0)
|
||||||
return;
|
return;
|
||||||
assert(curseg==2);
|
assert(curseg==2);
|
||||||
defstorage();
|
defstorage();
|
||||||
@ -2196,6 +2206,24 @@ static void initials(int ident,int tag,cell *size,int dim[],int numdim,
|
|||||||
err++;
|
err++;
|
||||||
} /* if */
|
} /* if */
|
||||||
} /* for */
|
} /* for */
|
||||||
|
if (numdim>1 && dim[numdim-1]==0) {
|
||||||
|
/* also look whether, by any chance, all "counted" final dimensions are
|
||||||
|
* the same value; if so, we can store this
|
||||||
|
*/
|
||||||
|
constvalue *ld=lastdim.next;
|
||||||
|
int d,match;
|
||||||
|
for (d=0; d<dim[numdim-2]; d++) {
|
||||||
|
assert(ld!=NULL);
|
||||||
|
assert(strtol(ld->name,NULL,16)==d);
|
||||||
|
if (d==0)
|
||||||
|
match=ld->value;
|
||||||
|
else if (match!=ld->value)
|
||||||
|
break;
|
||||||
|
ld=ld->next;
|
||||||
|
} /* for */
|
||||||
|
if (d==dim[numdim-2])
|
||||||
|
dim[numdim-1]=match;
|
||||||
|
} /* if */
|
||||||
/* after all arrays have been initalized, we know the (major) dimensions
|
/* after all arrays have been initalized, we know the (major) dimensions
|
||||||
* of the array and we can properly adjust the indirection vectors
|
* of the array and we can properly adjust the indirection vectors
|
||||||
*/
|
*/
|
||||||
@ -2447,6 +2475,7 @@ static void decl_const(int vclass)
|
|||||||
symbol *sym;
|
symbol *sym;
|
||||||
|
|
||||||
insert_docstring_separator(); /* see comment in newfunc() */
|
insert_docstring_separator(); /* see comment in newfunc() */
|
||||||
|
do {
|
||||||
tag=pc_addtag(NULL);
|
tag=pc_addtag(NULL);
|
||||||
if (lex(&val,&str)!=tSYMBOL) /* read in (new) token */
|
if (lex(&val,&str)!=tSYMBOL) /* read in (new) token */
|
||||||
error(20,str); /* invalid symbol name */
|
error(20,str); /* invalid symbol name */
|
||||||
@ -2454,7 +2483,6 @@ static void decl_const(int vclass)
|
|||||||
strcpy(constname,str); /* save symbol name */
|
strcpy(constname,str); /* save symbol name */
|
||||||
needtoken('=');
|
needtoken('=');
|
||||||
constexpr(&val,&exprtag,NULL); /* get value */
|
constexpr(&val,&exprtag,NULL); /* get value */
|
||||||
needtoken(tTERM);
|
|
||||||
/* add_constant() checks for duplicate definitions */
|
/* add_constant() checks for duplicate definitions */
|
||||||
if (!matchtag(tag,exprtag,FALSE)) {
|
if (!matchtag(tag,exprtag,FALSE)) {
|
||||||
/* temporarily reset the line number to where the symbol was defined */
|
/* temporarily reset the line number to where the symbol was defined */
|
||||||
@ -2465,7 +2493,9 @@ static void decl_const(int vclass)
|
|||||||
} /* if */
|
} /* if */
|
||||||
sym=add_constant(constname,val,vclass,tag);
|
sym=add_constant(constname,val,vclass,tag);
|
||||||
if (sym!=NULL)
|
if (sym!=NULL)
|
||||||
sc_attachdocumentation(sym);/* attach any documenation to the function */
|
sc_attachdocumentation(sym);/* attach any documenation to the constant */
|
||||||
|
} while (matchtoken(',')); /* enddo */ /* more? */
|
||||||
|
needtoken(tTERM);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* decl_enum - declare enumerated constants
|
/* decl_enum - declare enumerated constants
|
||||||
@ -4597,7 +4627,7 @@ redef_enumfield:
|
|||||||
*/
|
*/
|
||||||
static void statement(int *lastindent,int allow_decl)
|
static void statement(int *lastindent,int allow_decl)
|
||||||
{
|
{
|
||||||
int tok;
|
int tok,save;
|
||||||
cell val;
|
cell val;
|
||||||
char *st;
|
char *st;
|
||||||
|
|
||||||
@ -4650,29 +4680,26 @@ static void statement(int *lastindent,int allow_decl)
|
|||||||
} /* if */
|
} /* if */
|
||||||
break;
|
break;
|
||||||
case '{':
|
case '{':
|
||||||
tok=fline;
|
case tBEGIN:
|
||||||
|
save=fline;
|
||||||
if (!matchtoken('}')) /* {} is the empty statement */
|
if (!matchtoken('}')) /* {} is the empty statement */
|
||||||
compound(tok==fline);
|
compound(save==fline,tok);
|
||||||
/* lastst (for "last statement") does not change */
|
/* lastst (for "last statement") does not change */
|
||||||
break;
|
break;
|
||||||
case ';':
|
case ';':
|
||||||
error(36); /* empty statement */
|
error(36); /* empty statement */
|
||||||
break;
|
break;
|
||||||
case tIF:
|
case tIF:
|
||||||
doif();
|
lastst=doif();
|
||||||
lastst=tIF;
|
|
||||||
break;
|
break;
|
||||||
case tWHILE:
|
case tWHILE:
|
||||||
dowhile();
|
lastst=dowhile();
|
||||||
lastst=tWHILE;
|
|
||||||
break;
|
break;
|
||||||
case tDO:
|
case tDO:
|
||||||
dodo();
|
lastst=dodo();
|
||||||
lastst=tDO;
|
|
||||||
break;
|
break;
|
||||||
case tFOR:
|
case tFOR:
|
||||||
dofor();
|
lastst=dofor();
|
||||||
lastst=tFOR;
|
|
||||||
break;
|
break;
|
||||||
case tSWITCH:
|
case tSWITCH:
|
||||||
doswitch();
|
doswitch();
|
||||||
@ -4734,23 +4761,24 @@ static void statement(int *lastindent,int allow_decl)
|
|||||||
} /* switch */
|
} /* switch */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void compound(int stmt_sameline)
|
static void compound(int stmt_sameline,int starttok)
|
||||||
{
|
{
|
||||||
int indent=-1;
|
int indent=-1;
|
||||||
cell save_decl=declared;
|
cell save_decl=declared;
|
||||||
int count_stmt=0;
|
int count_stmt=0;
|
||||||
int block_start=fline; /* save line where the compound block started */
|
int block_start=fline; /* save line where the compound block started */
|
||||||
|
int endtok;
|
||||||
|
|
||||||
/* if there is more text on this line, we should adjust the statement indent */
|
/* if there is more text on this line, we should adjust the statement indent */
|
||||||
if (stmt_sameline) {
|
if (stmt_sameline) {
|
||||||
int i;
|
int i;
|
||||||
const unsigned char *p=lptr;
|
const unsigned char *p=lptr;
|
||||||
/* go back to the opening brace */
|
/* go back to the opening brace */
|
||||||
while (*p!='{') {
|
while (*p!=starttok) {
|
||||||
assert(p>pline);
|
assert(p>pline);
|
||||||
p--;
|
p--;
|
||||||
} /* while */
|
} /* while */
|
||||||
assert(*p=='{'); /* it should be found */
|
assert(*p==starttok); /* it should be found */
|
||||||
/* go forward, skipping white-space */
|
/* go forward, skipping white-space */
|
||||||
p++;
|
p++;
|
||||||
while (*p<=' ' && *p!='\0')
|
while (*p<=' ' && *p!='\0')
|
||||||
@ -4764,13 +4792,14 @@ static void compound(int stmt_sameline)
|
|||||||
stmtindent++;
|
stmtindent++;
|
||||||
} /* if */
|
} /* if */
|
||||||
|
|
||||||
|
endtok=(starttok=='{') ? '}' : tEND;
|
||||||
nestlevel+=1; /* increase compound statement level */
|
nestlevel+=1; /* increase compound statement level */
|
||||||
while (matchtoken('}')==0){ /* repeat until compound statement is closed */
|
while (matchtoken(endtok)==0){/* repeat until compound statement is closed */
|
||||||
if (!freading){
|
if (!freading){
|
||||||
error(30,block_start); /* compound block not closed at end of file */
|
error(30,block_start); /* compound block not closed at end of file */
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
if (count_stmt>0 && (lastst==tRETURN || lastst==tBREAK || lastst==tCONTINUE))
|
if (count_stmt>0 && (lastst==tRETURN || lastst==tBREAK || lastst==tCONTINUE || lastst==tENDLESS))
|
||||||
error(225); /* unreachable code */
|
error(225); /* unreachable code */
|
||||||
statement(&indent,TRUE); /* do a statement */
|
statement(&indent,TRUE); /* do a statement */
|
||||||
count_stmt++;
|
count_stmt++;
|
||||||
@ -4864,11 +4893,12 @@ SC_FUNC int constexpr(cell *val,int *tag,symbol **symptr)
|
|||||||
*
|
*
|
||||||
* Global references: sc_intest (altered, but restored upon termination)
|
* Global references: sc_intest (altered, but restored upon termination)
|
||||||
*/
|
*/
|
||||||
static void test(int label,int parens,int invert)
|
static int test(int label,int parens,int invert)
|
||||||
{
|
{
|
||||||
int index,tok;
|
int index,tok;
|
||||||
cell cidx;
|
cell cidx;
|
||||||
int ident,tag;
|
int ident,tag;
|
||||||
|
int endtok;
|
||||||
cell constval;
|
cell constval;
|
||||||
symbol *sym;
|
symbol *sym;
|
||||||
int localstaging=FALSE;
|
int localstaging=FALSE;
|
||||||
@ -4884,8 +4914,15 @@ static void test(int label,int parens,int invert)
|
|||||||
|
|
||||||
PUSHSTK_I(sc_intest);
|
PUSHSTK_I(sc_intest);
|
||||||
sc_intest=TRUE;
|
sc_intest=TRUE;
|
||||||
if (parens)
|
endtok=0;
|
||||||
needtoken('(');
|
if (parens!=TEST_PLAIN) {
|
||||||
|
if (matchtoken('('))
|
||||||
|
endtok=')';
|
||||||
|
else if (parens==TEST_THEN)
|
||||||
|
endtok=tTHEN;
|
||||||
|
else if (parens==TEST_DO)
|
||||||
|
endtok=tDO;
|
||||||
|
} /* if */
|
||||||
do {
|
do {
|
||||||
stgget(&index,&cidx); /* mark position (of last expression) in
|
stgget(&index,&cidx); /* mark position (of last expression) in
|
||||||
* code generator */
|
* code generator */
|
||||||
@ -4894,17 +4931,19 @@ static void test(int label,int parens,int invert)
|
|||||||
if (tok)
|
if (tok)
|
||||||
markexpr(sEXPR,NULL,0);
|
markexpr(sEXPR,NULL,0);
|
||||||
} while (tok); /* do */
|
} while (tok); /* do */
|
||||||
if (parens)
|
if (endtok!=0)
|
||||||
needtoken(')');
|
needtoken(endtok);
|
||||||
if (ident==iARRAY || ident==iREFARRAY) {
|
if (ident==iARRAY || ident==iREFARRAY) {
|
||||||
char *ptr=(sym->name!=NULL) ? sym->name : "-unknown-";
|
char *ptr=(sym->name!=NULL) ? sym->name : "-unknown-";
|
||||||
error(33,ptr); /* array must be indexed */
|
error(33,ptr); /* array must be indexed */
|
||||||
} /* if */
|
} /* if */
|
||||||
if (ident==iCONSTEXPR) { /* constant expression */
|
if (ident==iCONSTEXPR) { /* constant expression */
|
||||||
|
int testtype=0;
|
||||||
sc_intest=(short)POPSTK_I();/* restore stack */
|
sc_intest=(short)POPSTK_I();/* restore stack */
|
||||||
stgdel(index,cidx);
|
stgdel(index,cidx);
|
||||||
if (constval) { /* code always executed */
|
if (constval) { /* code always executed */
|
||||||
error(206); /* redundant test: always non-zero */
|
error(206); /* redundant test: always non-zero */
|
||||||
|
testtype=tENDLESS;
|
||||||
} else {
|
} else {
|
||||||
error(205); /* redundant code: never executed */
|
error(205); /* redundant code: never executed */
|
||||||
jumplabel(label);
|
jumplabel(label);
|
||||||
@ -4913,7 +4952,7 @@ static void test(int label,int parens,int invert)
|
|||||||
stgout(0); /* write "jumplabel" code */
|
stgout(0); /* write "jumplabel" code */
|
||||||
stgset(FALSE); /* stop staging */
|
stgset(FALSE); /* stop staging */
|
||||||
} /* if */
|
} /* if */
|
||||||
return;
|
return testtype;
|
||||||
} /* if */
|
} /* if */
|
||||||
if (tag!=0 && tag!=pc_addtag("bool"))
|
if (tag!=0 && tag!=pc_addtag("bool"))
|
||||||
if (check_userop(lneg,tag,0,1,NULL,&tag))
|
if (check_userop(lneg,tag,0,1,NULL,&tag))
|
||||||
@ -4929,37 +4968,49 @@ static void test(int label,int parens,int invert)
|
|||||||
* assert() when localstaging is set to TRUE) */
|
* assert() when localstaging is set to TRUE) */
|
||||||
stgset(FALSE); /* stop staging */
|
stgset(FALSE); /* stop staging */
|
||||||
} /* if */
|
} /* if */
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void doif(void)
|
static int doif(void)
|
||||||
{
|
{
|
||||||
int flab1,flab2;
|
int flab1,flab2;
|
||||||
int ifindent;
|
int ifindent;
|
||||||
|
int lastst_true;
|
||||||
|
|
||||||
ifindent=stmtindent; /* save the indent of the "if" instruction */
|
ifindent=stmtindent; /* save the indent of the "if" instruction */
|
||||||
flab1=getlabel(); /* get label number for false branch */
|
flab1=getlabel(); /* get label number for false branch */
|
||||||
test(flab1,TRUE,FALSE); /* get expression, branch to flab1 if false */
|
test(flab1,TEST_THEN,FALSE); /* get expression, branch to flab1 if false */
|
||||||
statement(NULL,FALSE); /* if true, do a statement */
|
statement(NULL,FALSE); /* if true, do a statement */
|
||||||
if (matchtoken(tELSE)==0){ /* if...else ? */
|
if (!matchtoken(tELSE)) { /* if...else ? */
|
||||||
setlabel(flab1); /* no, simple if..., print false label */
|
setlabel(flab1); /* no, simple if..., print false label */
|
||||||
} else {
|
} else {
|
||||||
|
lastst_true=lastst; /* save last statement of the "true" branch */
|
||||||
/* to avoid the "dangling else" error, we want a warning if the "else"
|
/* to avoid the "dangling else" error, we want a warning if the "else"
|
||||||
* has a lower indent than the matching "if" */
|
* has a lower indent than the matching "if" */
|
||||||
if (stmtindent<ifindent && sc_tabsize>0)
|
if (stmtindent<ifindent && sc_tabsize>0)
|
||||||
error(217); /* loose indentation */
|
error(217); /* loose indentation */
|
||||||
flab2=getlabel();
|
flab2=getlabel();
|
||||||
if ((lastst!=tRETURN) && (lastst!=tGOTO))
|
if ((lastst!=tRETURN) && (lastst!=tGOTO))
|
||||||
jumplabel(flab2);
|
jumplabel(flab2); /* "true" branch jumps around "else" clause, unless the "true" branch statement already jumped */
|
||||||
setlabel(flab1); /* print false label */
|
setlabel(flab1); /* print false label */
|
||||||
statement(NULL,FALSE); /* do "else" clause */
|
statement(NULL,FALSE); /* do "else" clause */
|
||||||
setlabel(flab2); /* print true label */
|
setlabel(flab2); /* print true label */
|
||||||
} /* endif */
|
/* if both the "true" branch and the "false" branch ended with the same
|
||||||
|
* kind of statement, set the last statement id to that kind, rather than
|
||||||
|
* to the generic tIF; this allows for better "unreachable code" checking
|
||||||
|
*/
|
||||||
|
if (lastst==lastst_true)
|
||||||
|
return lastst;
|
||||||
|
} /* if */
|
||||||
|
return tIF;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dowhile(void)
|
static int dowhile(void)
|
||||||
{
|
{
|
||||||
int wq[wqSIZE]; /* allocate local queue */
|
int wq[wqSIZE]; /* allocate local queue */
|
||||||
|
int save_endlessloop,retcode;
|
||||||
|
|
||||||
|
save_endlessloop=endlessloop;
|
||||||
addwhile(wq); /* add entry to queue for "break" */
|
addwhile(wq); /* add entry to queue for "break" */
|
||||||
setlabel(wq[wqLOOP]); /* loop label */
|
setlabel(wq[wqLOOP]); /* loop label */
|
||||||
/* The debugger uses the "break" opcode to be able to "break" out of
|
/* The debugger uses the "break" opcode to be able to "break" out of
|
||||||
@ -4967,21 +5018,27 @@ static void dowhile(void)
|
|||||||
* tiniest loop, set it below the top of the loop
|
* tiniest loop, set it below the top of the loop
|
||||||
*/
|
*/
|
||||||
setline(TRUE);
|
setline(TRUE);
|
||||||
test(wq[wqEXIT],TRUE,FALSE); /* branch to wq[wqEXIT] if false */
|
endlessloop=test(wq[wqEXIT],TEST_DO,FALSE);/* branch to wq[wqEXIT] if false */
|
||||||
statement(NULL,FALSE); /* if so, do a statement */
|
statement(NULL,FALSE); /* if so, do a statement */
|
||||||
jumplabel(wq[wqLOOP]); /* and loop to "while" start */
|
jumplabel(wq[wqLOOP]); /* and loop to "while" start */
|
||||||
setlabel(wq[wqEXIT]); /* exit label */
|
setlabel(wq[wqEXIT]); /* exit label */
|
||||||
delwhile(); /* delete queue entry */
|
delwhile(); /* delete queue entry */
|
||||||
|
|
||||||
|
retcode=endlessloop ? tENDLESS : tWHILE;
|
||||||
|
endlessloop=save_endlessloop;
|
||||||
|
return retcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Note that "continue" will in this case not jump to the top of the loop, but
|
* Note that "continue" will in this case not jump to the top of the loop, but
|
||||||
* to the end: just before the TRUE-or-FALSE testing code.
|
* to the end: just before the TRUE-or-FALSE testing code.
|
||||||
*/
|
*/
|
||||||
static void dodo(void)
|
static int dodo(void)
|
||||||
{
|
{
|
||||||
int wq[wqSIZE],top;
|
int wq[wqSIZE],top;
|
||||||
|
int save_endlessloop,retcode;
|
||||||
|
|
||||||
|
save_endlessloop=endlessloop;
|
||||||
addwhile(wq); /* see "dowhile" for more info */
|
addwhile(wq); /* see "dowhile" for more info */
|
||||||
top=getlabel(); /* make a label first */
|
top=getlabel(); /* make a label first */
|
||||||
setlabel(top); /* loop label */
|
setlabel(top); /* loop label */
|
||||||
@ -4989,26 +5046,32 @@ static void dodo(void)
|
|||||||
needtoken(tWHILE);
|
needtoken(tWHILE);
|
||||||
setlabel(wq[wqLOOP]); /* "continue" always jumps to WQLOOP. */
|
setlabel(wq[wqLOOP]); /* "continue" always jumps to WQLOOP. */
|
||||||
setline(TRUE);
|
setline(TRUE);
|
||||||
test(wq[wqEXIT],TRUE,FALSE);
|
endlessloop=test(wq[wqEXIT],TEST_OPT,FALSE);
|
||||||
jumplabel(top);
|
jumplabel(top);
|
||||||
setlabel(wq[wqEXIT]);
|
setlabel(wq[wqEXIT]);
|
||||||
delwhile();
|
delwhile();
|
||||||
needtoken(tTERM);
|
needtoken(tTERM);
|
||||||
|
|
||||||
|
retcode=endlessloop ? tENDLESS : tDO;
|
||||||
|
endlessloop=save_endlessloop;
|
||||||
|
return retcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dofor(void)
|
static int dofor(void)
|
||||||
{
|
{
|
||||||
int wq[wqSIZE],skiplab;
|
int wq[wqSIZE],skiplab;
|
||||||
cell save_decl;
|
cell save_decl;
|
||||||
int save_nestlevel,index;
|
int save_nestlevel,save_endlessloop;
|
||||||
|
int index,endtok;
|
||||||
int *ptr;
|
int *ptr;
|
||||||
|
|
||||||
save_decl=declared;
|
save_decl=declared;
|
||||||
save_nestlevel=nestlevel;
|
save_nestlevel=nestlevel;
|
||||||
|
save_endlessloop=endlessloop;
|
||||||
|
|
||||||
addwhile(wq);
|
addwhile(wq);
|
||||||
skiplab=getlabel();
|
skiplab=getlabel();
|
||||||
needtoken('(');
|
endtok= matchtoken('(') ? ')' : tDO;
|
||||||
if (matchtoken(';')==0) {
|
if (matchtoken(';')==0) {
|
||||||
/* new variable declarations are allowed here */
|
/* new variable declarations are allowed here */
|
||||||
if (matchtoken(tNEW)) {
|
if (matchtoken(tNEW)) {
|
||||||
@ -5046,14 +5109,16 @@ static void dofor(void)
|
|||||||
stgmark(sSTARTREORDER);
|
stgmark(sSTARTREORDER);
|
||||||
stgmark((char)(sEXPRSTART+0)); /* mark start of 2nd expression in stage */
|
stgmark((char)(sEXPRSTART+0)); /* mark start of 2nd expression in stage */
|
||||||
setlabel(skiplab); /* jump to this point after 1st expression */
|
setlabel(skiplab); /* jump to this point after 1st expression */
|
||||||
if (matchtoken(';')==0) {
|
if (matchtoken(';')) {
|
||||||
test(wq[wqEXIT],FALSE,FALSE); /* expression 2 (jump to wq[wqEXIT] if false) */
|
endlessloop=1;
|
||||||
|
} else {
|
||||||
|
endlessloop=test(wq[wqEXIT],TEST_PLAIN,FALSE);/* expression 2 (jump to wq[wqEXIT] if false) */
|
||||||
needtoken(';');
|
needtoken(';');
|
||||||
} /* if */
|
} /* if */
|
||||||
stgmark((char)(sEXPRSTART+1)); /* mark start of 3th expression in stage */
|
stgmark((char)(sEXPRSTART+1)); /* mark start of 3th expression in stage */
|
||||||
if (matchtoken(')')==0) {
|
if (!matchtoken(endtok)) {
|
||||||
doexpr(TRUE,TRUE,TRUE,TRUE,NULL,NULL,FALSE); /* expression 3 */
|
doexpr(TRUE,TRUE,TRUE,TRUE,NULL,NULL,FALSE); /* expression 3 */
|
||||||
needtoken(')');
|
needtoken(endtok);
|
||||||
} /* if */
|
} /* if */
|
||||||
stgmark(sENDREORDER); /* mark end of reversed evaluation */
|
stgmark(sENDREORDER); /* mark end of reversed evaluation */
|
||||||
stgout(index);
|
stgout(index);
|
||||||
@ -5075,6 +5140,10 @@ static void dofor(void)
|
|||||||
delete_symbols(&loctab,nestlevel,FALSE,TRUE);
|
delete_symbols(&loctab,nestlevel,FALSE,TRUE);
|
||||||
nestlevel=save_nestlevel; /* reset 'compound statement' nesting level */
|
nestlevel=save_nestlevel; /* reset 'compound statement' nesting level */
|
||||||
} /* if */
|
} /* if */
|
||||||
|
|
||||||
|
index=endlessloop ? tENDLESS : tFOR;
|
||||||
|
endlessloop=save_endlessloop;
|
||||||
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The switch statement is incompatible with its C sibling:
|
/* The switch statement is incompatible with its C sibling:
|
||||||
@ -5092,16 +5161,17 @@ static void dofor(void)
|
|||||||
static void doswitch(void)
|
static void doswitch(void)
|
||||||
{
|
{
|
||||||
int lbl_table,lbl_exit,lbl_case;
|
int lbl_table,lbl_exit,lbl_case;
|
||||||
int tok,swdefault,casecount;
|
int swdefault,casecount;
|
||||||
|
int tok,endtok;
|
||||||
cell val;
|
cell val;
|
||||||
char *str;
|
char *str;
|
||||||
constvalue caselist = { NULL, "", 0, 0}; /* case list starts empty */
|
constvalue caselist = { NULL, "", 0, 0}; /* case list starts empty */
|
||||||
constvalue *cse,*csp;
|
constvalue *cse,*csp;
|
||||||
char labelname[sNAMEMAX+1];
|
char labelname[sNAMEMAX+1];
|
||||||
|
|
||||||
needtoken('(');
|
endtok= matchtoken('(') ? ')' : tDO;
|
||||||
doexpr(TRUE,FALSE,FALSE,FALSE,NULL,NULL,TRUE);/* evaluate switch expression */
|
doexpr(TRUE,FALSE,FALSE,FALSE,NULL,NULL,TRUE);/* evaluate switch expression */
|
||||||
needtoken(')');
|
needtoken(endtok);
|
||||||
/* generate the code for the switch statement, the label is the address
|
/* generate the code for the switch statement, the label is the address
|
||||||
* of the case table (to be generated later).
|
* of the case table (to be generated later).
|
||||||
*/
|
*/
|
||||||
@ -5109,7 +5179,12 @@ static void doswitch(void)
|
|||||||
lbl_case=0; /* just to avoid a compiler warning */
|
lbl_case=0; /* just to avoid a compiler warning */
|
||||||
ffswitch(lbl_table);
|
ffswitch(lbl_table);
|
||||||
|
|
||||||
|
if (matchtoken(tBEGIN)) {
|
||||||
|
endtok=tEND;
|
||||||
|
} else {
|
||||||
|
endtok='}';
|
||||||
needtoken('{');
|
needtoken('{');
|
||||||
|
} /* if */
|
||||||
lbl_exit=getlabel(); /* get label number for jumping out of switch */
|
lbl_exit=getlabel(); /* get label number for jumping out of switch */
|
||||||
swdefault=FALSE;
|
swdefault=FALSE;
|
||||||
casecount=0;
|
casecount=0;
|
||||||
@ -5195,15 +5270,14 @@ static void doswitch(void)
|
|||||||
*/
|
*/
|
||||||
jumplabel(lbl_exit);
|
jumplabel(lbl_exit);
|
||||||
break;
|
break;
|
||||||
case '}':
|
|
||||||
/* nothing, but avoid dropping into "default" */
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
|
if (tok!=endtok) {
|
||||||
error(2);
|
error(2);
|
||||||
indent_nowarn=TRUE; /* disable this check */
|
indent_nowarn=TRUE; /* disable this check */
|
||||||
tok='}'; /* break out of the loop after an error */
|
tok=endtok; /* break out of the loop after an error */
|
||||||
|
} /* if */
|
||||||
} /* switch */
|
} /* switch */
|
||||||
} while (tok!='}');
|
} while (tok!=endtok);
|
||||||
|
|
||||||
#if !defined NDEBUG
|
#if !defined NDEBUG
|
||||||
/* verify that the case table is sorted (unfortunatly, duplicates can
|
/* verify that the case table is sorted (unfortunatly, duplicates can
|
||||||
@ -5238,7 +5312,7 @@ static void doassert(void)
|
|||||||
|
|
||||||
if ((sc_debug & sCHKBOUNDS)!=0) {
|
if ((sc_debug & sCHKBOUNDS)!=0) {
|
||||||
flab1=getlabel(); /* get label number for "OK" branch */
|
flab1=getlabel(); /* get label number for "OK" branch */
|
||||||
test(flab1,FALSE,TRUE); /* get expression and branch to flab1 if true */
|
test(flab1,TEST_PLAIN,TRUE);/* get expression and branch to flab1 if true */
|
||||||
insert_dbgline(fline); /* make sure we can find the correct line number */
|
insert_dbgline(fline); /* make sure we can find the correct line number */
|
||||||
ffabort(xASSERTION);
|
ffabort(xASSERTION);
|
||||||
setlabel(flab1);
|
setlabel(flab1);
|
||||||
@ -5260,6 +5334,9 @@ static void dogoto(void)
|
|||||||
cell val;
|
cell val;
|
||||||
symbol *sym;
|
symbol *sym;
|
||||||
|
|
||||||
|
/* if we were inside an endless loop, assume that we jump out of it */
|
||||||
|
endlessloop=0;
|
||||||
|
|
||||||
if (lex(&val,&st)==tSYMBOL) {
|
if (lex(&val,&st)==tSYMBOL) {
|
||||||
sym=fetchlab(st);
|
sym=fetchlab(st);
|
||||||
jumplabel((int)sym->addr);
|
jumplabel((int)sym->addr);
|
||||||
@ -5443,6 +5520,7 @@ static void dobreak(void)
|
|||||||
{
|
{
|
||||||
int *ptr;
|
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 */
|
ptr=readwhile(); /* readwhile() gives an error if not in loop */
|
||||||
needtoken(tTERM);
|
needtoken(tTERM);
|
||||||
if (ptr==NULL)
|
if (ptr==NULL)
|
||||||
@ -5530,7 +5608,7 @@ static void dostate(void)
|
|||||||
if (matchtoken('(')) {
|
if (matchtoken('(')) {
|
||||||
flabel=getlabel(); /* get label number for "false" branch */
|
flabel=getlabel(); /* get label number for "false" branch */
|
||||||
pc_docexpr=TRUE; /* attach expression as a documentation string */
|
pc_docexpr=TRUE; /* attach expression as a documentation string */
|
||||||
test(flabel,FALSE,FALSE); /* get expression, branch to flabel if false */
|
test(flabel,TEST_PLAIN,FALSE);/* get expression, branch to flabel if false */
|
||||||
pc_docexpr=FALSE;
|
pc_docexpr=FALSE;
|
||||||
needtoken(')');
|
needtoken(')');
|
||||||
} else {
|
} else {
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
* misrepresented as being the original software.
|
* misrepresented as being the original software.
|
||||||
* 3. This notice may not be removed or altered from any source distribution.
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
*
|
*
|
||||||
* Version: $Id: sc2.c 3590 2006-06-24 14:16:39Z thiadmer $
|
* Version: $Id: sc2.c 3636 2006-08-14 15:42:05Z thiadmer $
|
||||||
*/
|
*/
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -947,11 +947,27 @@ static int command(void)
|
|||||||
if ((ifstack[iflevel-1] & PARSEMODE)==PARSEMODE) {
|
if ((ifstack[iflevel-1] & PARSEMODE)==PARSEMODE) {
|
||||||
/* there has been a parse mode already on this level, so skip the rest */
|
/* there has been a parse mode already on this level, so skip the rest */
|
||||||
ifstack[iflevel-1] |= (char)SKIPMODE;
|
ifstack[iflevel-1] |= (char)SKIPMODE;
|
||||||
|
/* if we were already skipping this section, allow expressions with
|
||||||
|
* undefined symbols; otherwise check the expression to catch errors
|
||||||
|
*/
|
||||||
|
if (tok==tpELSEIF) {
|
||||||
|
if (skiplevel==iflevel)
|
||||||
|
preproc_expr(&val,NULL); /* get, but ignore the expression */
|
||||||
|
else
|
||||||
|
lptr=strchr(lptr,'\0');
|
||||||
|
} /* if */
|
||||||
} else {
|
} else {
|
||||||
/* previous conditions were all FALSE */
|
/* previous conditions were all FALSE */
|
||||||
if (tok==tpELSEIF) {
|
if (tok==tpELSEIF) {
|
||||||
/* get new expression */
|
/* if we were already skipping this section, allow expressions with
|
||||||
|
* undefined symbols; otherwise check the expression to catch errors
|
||||||
|
*/
|
||||||
|
if (skiplevel==iflevel) {
|
||||||
preproc_expr(&val,NULL); /* get value (or 0 on error) */
|
preproc_expr(&val,NULL); /* get value (or 0 on error) */
|
||||||
|
} else {
|
||||||
|
lptr=strchr(lptr,'\0');
|
||||||
|
val=0;
|
||||||
|
} /* if */
|
||||||
ifstack[iflevel-1]=(char)(val ? PARSEMODE : SKIPMODE);
|
ifstack[iflevel-1]=(char)(val ? PARSEMODE : SKIPMODE);
|
||||||
} else {
|
} else {
|
||||||
/* a simple #else, clear skip mode */
|
/* a simple #else, clear skip mode */
|
||||||
@ -1816,10 +1832,10 @@ char *sc_tokens[] = {
|
|||||||
"*=", "/=", "%=", "+=", "-=", "<<=", ">>>=", ">>=", "&=", "^=", "|=",
|
"*=", "/=", "%=", "+=", "-=", "<<=", ">>>=", ">>=", "&=", "^=", "|=",
|
||||||
"||", "&&", "==", "!=", "<=", ">=", "<<", ">>>", ">>", "++", "--",
|
"||", "&&", "==", "!=", "<=", ">=", "<<", ">>>", ">>", "++", "--",
|
||||||
"...", "..", "::",
|
"...", "..", "::",
|
||||||
"assert", "break", "case", "char", "const", "continue", "default",
|
"assert", "*begin", "break", "case", "char", "const", "continue", "default",
|
||||||
"defined", "do", "else", "enum", "exit", "for", "forward", "goto",
|
"defined", "do", "else", "*end", "enum", "exit", "for", "forward", "goto",
|
||||||
"if", "native", "new", "decl", "operator", "public", "return", "sizeof",
|
"if", "native", "new", "decl", "operator", "public", "return", "sizeof",
|
||||||
"sleep", "state", "static", "stock", "switch", "tagof", "while",
|
"sleep", "state", "static", "stock", "switch", "tagof", "*then", "while",
|
||||||
"#assert", "#define", "#else", "#elseif", "#emit", "#endif", "#endinput",
|
"#assert", "#define", "#else", "#elseif", "#emit", "#endif", "#endinput",
|
||||||
"#endscript", "#error", "#file", "#if", "#include", "#line", "#pragma",
|
"#endscript", "#error", "#file", "#if", "#include", "#line", "#pragma",
|
||||||
"#tryinclude", "#undef",
|
"#tryinclude", "#undef",
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
* misrepresented as being the original software.
|
* misrepresented as being the original software.
|
||||||
* 3. This notice may not be removed or altered from any source distribution.
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
*
|
*
|
||||||
* Version: $Id: sc3.c 3598 2006-07-04 13:44:04Z thiadmer $
|
* Version: $Id: sc3.c 3635 2006-08-13 12:19:41Z thiadmer $
|
||||||
*/
|
*/
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -619,9 +619,26 @@ static void plnge2(void (*oper)(void),
|
|||||||
} /* if */
|
} /* if */
|
||||||
}
|
}
|
||||||
|
|
||||||
static cell truemodulus(cell a,cell b)
|
static cell flooreddiv(cell a,cell b,int return_remainder)
|
||||||
{
|
{
|
||||||
return (a % b + b) % b;
|
cell q,r;
|
||||||
|
|
||||||
|
if (b==0) {
|
||||||
|
error(29);
|
||||||
|
return 0;
|
||||||
|
} /* if */
|
||||||
|
/* first implement truncated division in a portable way */
|
||||||
|
#define IABS(a) ((a)>=0 ? (a) : (-a))
|
||||||
|
q=IABS(a)/IABS(b);
|
||||||
|
if ((cell)(a ^ b)<0)
|
||||||
|
q=-q; /* swap sign if either "a" or "b" is negative (but not both) */
|
||||||
|
r=a-q*b; /* calculate the matching remainder */
|
||||||
|
/* now "fiddle" with the values to get floored division */
|
||||||
|
if (r!=0 && (cell)(r ^ b)<0) {
|
||||||
|
q--;
|
||||||
|
r+=b;
|
||||||
|
} /* if */
|
||||||
|
return return_remainder ? r : q;
|
||||||
}
|
}
|
||||||
|
|
||||||
static cell calc(cell left,void (*oper)(),cell right,char *boolresult)
|
static cell calc(cell left,void (*oper)(),cell right,char *boolresult)
|
||||||
@ -657,9 +674,9 @@ static cell calc(cell left,void (*oper)(),cell right,char *boolresult)
|
|||||||
else if (oper==os_mult)
|
else if (oper==os_mult)
|
||||||
return (left * right);
|
return (left * right);
|
||||||
else if (oper==os_div)
|
else if (oper==os_div)
|
||||||
return (left - truemodulus(left,right)) / right;
|
return flooreddiv(left,right,0);
|
||||||
else if (oper==os_mod)
|
else if (oper==os_mod)
|
||||||
return truemodulus(left,right);
|
return flooreddiv(left,right,1);
|
||||||
else
|
else
|
||||||
error(29); /* invalid expression, assumed 0 (this should never occur) */
|
error(29); /* invalid expression, assumed 0 (this should never occur) */
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
* misrepresented as being the original software.
|
* misrepresented as being the original software.
|
||||||
* 3. This notice may not be removed or altered from any source distribution.
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
*
|
*
|
||||||
* Version: $Id: sc4.c 3579 2006-06-06 13:35:29Z thiadmer $
|
* Version: $Id: sc4.c 3633 2006-08-11 16:20:18Z thiadmer $
|
||||||
*/
|
*/
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@ -214,7 +214,7 @@ SC_FUNC void writetrailer(void)
|
|||||||
*/
|
*/
|
||||||
SC_FUNC void begcseg(void)
|
SC_FUNC void begcseg(void)
|
||||||
{
|
{
|
||||||
if (curseg!=sIN_CSEG || fcurrent!=fcurseg) {
|
if (sc_status!=statSKIP && (curseg!=sIN_CSEG || fcurrent!=fcurseg)) {
|
||||||
stgwrite("\n");
|
stgwrite("\n");
|
||||||
stgwrite("CODE ");
|
stgwrite("CODE ");
|
||||||
outval(fcurrent,FALSE);
|
outval(fcurrent,FALSE);
|
||||||
@ -232,7 +232,7 @@ SC_FUNC void begcseg(void)
|
|||||||
*/
|
*/
|
||||||
SC_FUNC void begdseg(void)
|
SC_FUNC void begdseg(void)
|
||||||
{
|
{
|
||||||
if (curseg!=sIN_DSEG || fcurrent!=fcurseg) {
|
if (sc_status!=statSKIP && (curseg!=sIN_DSEG || fcurrent!=fcurseg)) {
|
||||||
stgwrite("\n");
|
stgwrite("\n");
|
||||||
stgwrite("DATA ");
|
stgwrite("DATA ");
|
||||||
outval(fcurrent,FALSE);
|
outval(fcurrent,FALSE);
|
||||||
@ -245,6 +245,10 @@ SC_FUNC void begdseg(void)
|
|||||||
|
|
||||||
SC_FUNC void setline(int chkbounds)
|
SC_FUNC void setline(int chkbounds)
|
||||||
{
|
{
|
||||||
|
if (sc_asmfile) {
|
||||||
|
stgwrite("\t; line ");
|
||||||
|
outval(fline,TRUE);
|
||||||
|
} /* if */
|
||||||
if ((sc_debug & sSYMBOLIC)!=0 || chkbounds && (sc_debug & sCHKBOUNDS)!=0) {
|
if ((sc_debug & sSYMBOLIC)!=0 || chkbounds && (sc_debug & sCHKBOUNDS)!=0) {
|
||||||
/* generate a "break" (start statement) opcode rather than a "line" opcode
|
/* generate a "break" (start statement) opcode rather than a "line" opcode
|
||||||
* because earlier versions of Small/Pawn have an incompatible version of the
|
* because earlier versions of Small/Pawn have an incompatible version of the
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
* misrepresented as being the original software.
|
* misrepresented as being the original software.
|
||||||
* 3. This notice may not be removed or altered from any source distribution.
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
*
|
*
|
||||||
* Version: $Id: sc5.sch 3590 2006-06-24 14:16:39Z thiadmer $
|
* Version: $Id: sc5.sch 3633 2006-08-11 16:20:18Z thiadmer $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
SC_FUNC int strexpand(char *dest, unsigned char *source, int maxlen, unsigned char pairtable[128][2]);
|
SC_FUNC int strexpand(char *dest, unsigned char *source, int maxlen, unsigned char pairtable[128][2]);
|
||||||
@ -27,13 +27,13 @@ SC_FUNC int strexpand(char *dest, unsigned char *source, int maxlen, unsigned ch
|
|||||||
/*-*SCPACK start of pair table, do not change or remove this line */
|
/*-*SCPACK start of pair table, do not change or remove this line */
|
||||||
unsigned char errstr_table[][2] = {
|
unsigned char errstr_table[][2] = {
|
||||||
{101,32}, {111,110}, {116,32}, {105,110}, {97,114}, {116,105}, {100,32}, {115,32}, {101,114}, {97,108}, {101,110}, {37,115}, {133,129}, {34,139}, {141,34}, {117,110},
|
{101,32}, {111,110}, {116,32}, {105,110}, {97,114}, {116,105}, {100,32}, {115,32}, {101,114}, {97,108}, {101,110}, {37,115}, {133,129}, {34,139}, {141,34}, {117,110},
|
||||||
{110,111}, {114,101}, {115,105}, {121,32}, {97,116}, {111,114}, {97,110}, {32,142}, {109,98}, {115,116}, {41,10}, {100,101}, {109,138}, {101,134}, {98,108}, {140,32},
|
{114,101}, {110,111}, {115,105}, {121,32}, {97,116}, {111,114}, {97,110}, {32,142}, {109,98}, {115,116}, {41,10}, {100,101}, {109,138}, {101,134}, {98,108}, {140,32},
|
||||||
{111,108}, {114,97}, {144,130}, {118,137}, {143,99}, {102,164}, {115,121}, {166,152}, {167,160}, {117,115}, {97,32}, {115,146}, {97,158}, {149,32}, {132,161}, {105,134},
|
{111,108}, {114,97}, {145,130}, {118,137}, {143,99}, {102,164}, {115,121}, {166,152}, {167,160}, {117,115}, {97,32}, {115,146}, {97,158}, {149,32}, {132,161}, {105,134},
|
||||||
{103,32}, {163,175}, {103,117}, {178,156}, {136,32}, {132,179}, {131,177}, {111,102}, {116,104}, {101,120}, {105,135}, {165,159}, {101,100}, {99,104}, {118,132}, {168,151},
|
{103,32}, {163,175}, {103,117}, {178,156}, {136,32}, {132,179}, {131,177}, {111,102}, {116,104}, {101,120}, {105,135}, {165,159}, {101,100}, {99,104}, {118,132}, {168,151},
|
||||||
{105,172}, {190,192}, {155,102}, {174,147}, {183,32}, {109,97}, {116,111}, {99,129}, {101,135}, {181,130}, {98,128}, {115,10}, {112,145}, {153,148}, {44,32}, {40,191},
|
{105,172}, {190,192}, {155,102}, {174,147}, {183,32}, {109,97}, {116,111}, {99,129}, {101,135}, {112,144}, {181,130}, {98,128}, {115,10}, {153,148}, {44,32}, {40,191},
|
||||||
{169,130}, {151,10}, {101,10}, {207,154}, {109,208}, {116,97}, {105,99}, {194,131}, {193,128}, {34,32}, {129,32}, {132,97}, {100,105}, {146,122}, {110,32}, {137,32},
|
{169,130}, {151,10}, {101,10}, {207,154}, {109,208}, {116,97}, {194,131}, {193,128}, {34,32}, {129,32}, {105,99}, {132,97}, {100,105}, {146,122}, {110,32}, {137,32},
|
||||||
{104,97}, {101,108}, {117,108}, {99,111}, {108,111}, {109,148}, {199,153}, {58,209}, {111,112}, {97,115}, {108,128}, {232,136}, {230,150}, {150,32}, {204,171}, {131,176},
|
{104,97}, {101,108}, {117,108}, {99,111}, {108,111}, {109,148}, {199,153}, {58,209}, {111,112}, {97,115}, {108,128}, {232,136}, {230,150}, {150,32}, {201,171}, {131,176},
|
||||||
{212,202}, {102,105}, {119,105}, {185,238}, {109,112}, {116,136}, {165,140}, {197,147}, {102,149}, {111,32}, {131,32}, {213,176}, {110,117}, {115,117}, {118,128}
|
{212,203}, {102,105}, {119,105}, {185,238}, {109,112}, {116,136}, {165,140}, {197,147}, {102,149}, {111,32}, {131,32}, {213,176}, {110,117}, {115,117}, {118,128}
|
||||||
};
|
};
|
||||||
/*-*SCPACK end of pair table, do not change or remove this line */
|
/*-*SCPACK end of pair table, do not change or remove this line */
|
||||||
|
|
||||||
@ -134,96 +134,96 @@ static char *errmsg[] = {
|
|||||||
#else
|
#else
|
||||||
"\271pect\235\306k\212:\227\316bu\202fo\217\206\216\012",
|
"\271pect\235\306k\212:\227\316bu\202fo\217\206\216\012",
|
||||||
"\201l\223\252s\203g\352\315e\234\202(\255\363\201) c\355f\240\344w ea\275 \042c\351e\042\012",
|
"\201l\223\252s\203g\352\315e\234\202(\255\363\201) c\355f\240\344w ea\275 \042c\351e\042\012",
|
||||||
"\233cl\333\237\304\252\344c\337\330\324appe\204 \372\252\343\364o\217\206\236ock\012",
|
"\233cl\333\237\304\252\344c\337\327\324appe\204 \372\252\343\364o\217\206\236ock\012",
|
||||||
"\366\227 \272\242i\364le\234t\274\012",
|
"\366\227 \272\242i\364le\234t\274\012",
|
||||||
"\273\367\242\340\376\265t\313",
|
"\273\367\242\340\376\265t\314",
|
||||||
"\360a\253gn\235\306 \355\256y\012",
|
"\360a\253gn\235\306 \355\256y\012",
|
||||||
"\353\224\255c\226\242\312\221\327\274\012",
|
"\353\224\255c\226\242\313\220\326\274\012",
|
||||||
"\360\252\354\202\363\201; \351\375m\235z\210o\012",
|
"\360\252\354\202\363\201; \351\375m\235z\210o\012",
|
||||||
"\266\303\335\200(nega\205ve\316z\210\371\255ou\202\304bo\217ds\232",
|
"\266\303\335\200(nega\205ve\316z\210\371\255ou\202\304bo\217ds\232",
|
||||||
"\266\273\255\233cl\333\214\012",
|
"\266\273\255\233cl\333\214\012",
|
||||||
"\266out\222d\200\366\313",
|
"\266out\222d\200\366\314",
|
||||||
"\266\273c\211l\316\242\252\261add\221s\313",
|
"\266\273c\211l\316\242\252\261add\220s\314",
|
||||||
"\220 \212tr\223po\203\202(\220 pu\236\326 \366s\232",
|
"\221 \212tr\223po\203\202(\221 pu\236\332 \366s\232",
|
||||||
"\266\315e\234t; \242\372s\362t\275\012",
|
"\266\315e\234t; \242\372s\362t\275\012",
|
||||||
"\042\302a\342t\331c\351\200\360\270\200l\351\202c\351\200\372s\362t\275 \315e\234t\012",
|
"\042\302a\342t\330c\351\200\360\270\200l\351\202c\351\200\372s\362t\275 \315e\234t\012",
|
||||||
"m\342\205p\352\302a\342t\207\372\042s\362t\275\042\012",
|
"m\342\205p\352\302a\342t\207\372\042s\362t\275\042\012",
|
||||||
"\217\327\235\277\012",
|
"\217\326\235\277\012",
|
||||||
"\203i\205\211iza\237d\224\252\271ce\274\207\233cl\204\235\335\322",
|
"\203i\205\211iza\237d\224\252\271ce\274\207\233cl\204\235\335\322",
|
||||||
"\242\252lab\341\347",
|
"\242\252lab\341\347",
|
||||||
"\266\250 nam\200\216\012",
|
"\266\250 nam\200\216\012",
|
||||||
"\250 \211\221ad\223\327\274\347",
|
"\250 \211\220ad\223\326\274\347",
|
||||||
"\360l\243u\200(n\201-\354t\232",
|
"\360l\243u\200(n\201-\354t\232",
|
||||||
"\303a\253gn\234\202\360\222\364\352a\253gn\234t\012",
|
"\303a\253gn\234\202\360\222\364\352a\253gn\234t\012",
|
||||||
"\042b\221ak\331\255\042\307t\203ue\331\272ou\202\304\307t\271t\012",
|
"\042b\220ak\330\255\042\307t\203ue\330\272ou\202\304\307t\271t\012",
|
||||||
"\273head\357\334ff\210\207from pro\306typ\322",
|
"\273head\357\334ff\210\207from pro\306typ\322",
|
||||||
"\220 \345\275\357\042#if...\042\012",
|
"\221 \345\275\357\042#if...\042\012",
|
||||||
"\266\275\333ct\264\354t\012",
|
"\266\275\333ct\264\354t\012",
|
||||||
"\266\375bscrip\202(\242\355\303\255\306\371m\226\223\375bscripts)\347",
|
"\266\375bscrip\202(\242\355\303\255\306\371m\226\223\375bscripts)\347",
|
||||||
"\266\363\201\316\351\375m\235z\210o\012",
|
"\266\363\201\316\351\375m\235z\210o\012",
|
||||||
"\343\364o\217\206\315e\234\202\242c\344s\235a\202\270\200\212\206\304\361\352(\231\204t\235a\202l\203\200%d\232",
|
"\343\364o\217\206\315e\234\202\242c\344s\235a\202\270\200\212\206\304\361\352(\231\204t\235a\202l\203\200%d\232",
|
||||||
"\217k\220w\336\334\221c\205v\322",
|
"\217k\221w\336\334\220c\205v\322",
|
||||||
"\303\203\233x ou\202\304bo\217d\207(\330\216\232",
|
"\303\203\233x ou\202\304bo\217d\207(\327\216\232",
|
||||||
"\303\360\203\233x\235(\330\216\232",
|
"\303\360\203\233x\235(\327\216\232",
|
||||||
"\311do\310\242\340\376\252\302a\342\202\243u\200(\311%d\232",
|
"\312do\310\242\340\376\252\302a\342\202\243u\200(\312%d\232",
|
||||||
"\311typ\200mis\345\275 (\311%d\232",
|
"\312typ\200mis\345\275 (\312%d\232",
|
||||||
"e\364t\223\315e\234t\012",
|
"e\364t\223\315e\234t\012",
|
||||||
"\266\231r\357(po\253\236\223n\201-\365m\203\224\235\231r\203g\232",
|
"\266\231r\357(po\253\236\223n\201-\365m\203\224\235\231r\203g\232",
|
||||||
"\271t\241 \275\333c\365\207\332l\203\322",
|
"\271t\241 \275\333c\365\207\331l\203\322",
|
||||||
"\354\202\250 \340\207\220 \335\322",
|
"\354\202\250 \340\207\221 \335\322",
|
||||||
"dupl\326\224\200\042c\351e\331lab\341 (\243u\200%d\232",
|
"dupl\332\224\200\042c\351e\330lab\341 (\243u\200%d\232",
|
||||||
"\266\341lip\222s\316\303\335\200\272\242k\220wn\012",
|
"\266\341lip\222s\316\303\335\200\272\242k\221wn\012",
|
||||||
"\266\343\230\203a\237\304cl\351\207speci\361\210\313",
|
"\266\343\230\203a\237\304cl\351\207speci\361\210\314",
|
||||||
"\275\333ct\264\354\202\271ce\274\207r\226g\200f\255pack\235\231r\203g\012",
|
"\275\333ct\264\354\202\271ce\274\207r\226g\200f\255pack\235\231r\203g\012",
|
||||||
"po\222\214\337p\333me\365\207\324\314c\274\200\211l nam\235p\333me\365\313",
|
"po\222\214\337p\333me\365\207\324\311c\274\200\211l nam\235p\333me\365\314",
|
||||||
"\306\371m\226\223\273\265t\313",
|
"\306\371m\226\223\273\265t\314",
|
||||||
"\217k\220w\336\303\335\200(\330\216\232",
|
"\217k\221w\336\303\335\200(\327\216\232",
|
||||||
"\303\335\310d\371\242\345\275\316\255\233\231\203a\237\303\272\306\371sm\211l\012",
|
"\303\335\310d\371\242\345\275\316\255\233\231\203a\237\303\272\306\371sm\211l\012",
|
||||||
"\303\334\234\222\201\207d\371\242\345\275\012",
|
"\303\334\234\222\201\207d\371\242\345\275\012",
|
||||||
"\266l\203\200\307t\203ua\214\012",
|
"\266l\203\200\307t\203ua\214\012",
|
||||||
"\266r\226g\322",
|
"\266r\226g\322",
|
||||||
"\266\375bscript\316\251\200\042[ ]\331\353\224\225\207\332\305j\255\334\234\222\201\313",
|
"\266\375bscript\316\251\200\042[ ]\330\353\224\225\207\331\305j\255\334\234\222\201\314",
|
||||||
"m\342\205-\334\234\222\201\337\256y\207\360f\342l\223\203i\205\211iz\274\012",
|
"m\342\205-\334\234\222\201\337\256y\207\360f\342l\223\203i\205\211iz\274\012",
|
||||||
"\271ce\274\357\305ximum \374\230\264\304\334\234\222\201\313",
|
"\271ce\274\357\305ximum \374\230\264\304\334\234\222\201\314",
|
||||||
"\217\345\275\235c\344s\357b\241c\200(\042}\042\232",
|
"\217\345\275\235c\344s\357b\241c\200(\042}\042\232",
|
||||||
"\231\204\202\304\273bod\223\362\270ou\202\273head\210\012",
|
"\231\204\202\304\273bod\223\362\270ou\202\273head\210\012",
|
||||||
"\256ys\316\344c\337\301\310\226\206\273\265t\207c\226\242\312pu\236\326 (\330\216\232",
|
"\256ys\316\344c\337\301\310\226\206\273\265t\207c\226\242\313pu\236\332 (\327\216\232",
|
||||||
"\217f\203ish\235\363\332be\370\200\343\364il\264\334\221c\205v\322",
|
"\217f\203ish\235\363\331be\370\200\343\364il\264\334\220c\205v\322",
|
||||||
"dupl\326\224\200\265t; sam\200\311\272p\351s\235tw\326\322",
|
"dupl\332\224\200\265t; sam\200\312\272p\351s\235tw\332\322",
|
||||||
"\273\311\367\242\340\376\252\302a\342\202\243u\200(\330\216\232",
|
"\273\312\367\242\340\376\252\302a\342\202\243u\200(\327\216\232",
|
||||||
"m\342\205p\352\042#\341se\331\334\221c\205v\310betwe\212 \042#if ... #\212\334f\042\012",
|
"m\342\205p\352\042#\341se\330\334\220c\205v\310betwe\212 \042#if ... #\212\334f\042\012",
|
||||||
"\042#\341seif\331\334\221c\205\376f\240\344w\207\355\042#\341se\331\334\221c\205v\322",
|
"\042#\341seif\330\334\220c\205\376f\240\344w\207\355\042#\341se\330\334\220c\205v\322",
|
||||||
"\374\230\264\304\353\226d\207do\310\242\361\202\270\200\353\224\225\012",
|
"\374\230\264\304\353\226d\207do\310\242\361\202\270\200\353\224\225\012",
|
||||||
"\273\221s\342\202\373\304\353\224\225\227 \360\216\012",
|
"\273\220s\342\202\373\304\353\224\225\227 \360\216\012",
|
||||||
"c\226\242\275\226g\200\314\327\235\353\224\225\313",
|
"c\226\242\275\226g\200\311\326\235\353\224\225\314",
|
||||||
"\273\311\367\201l\223\340\376\252s\203g\352\373(\311%d\232",
|
"\273\312\367\201l\223\340\376\252s\203g\352\373(\312%d\232",
|
||||||
"\273\311\367\242\312\252\221f\210\212c\200\311\255\355\303(\311\216\232",
|
"\273\312\367\242\313\252\220f\210\212c\200\312\255\355\303(\312\216\232",
|
||||||
"\330c\226\242\312bo\270 \252\221f\210\212c\200\226\206\355\303(\330\216\232",
|
"\327c\226\242\313bo\270 \252\220f\210\212c\200\226\206\355\303(\327\216\232",
|
||||||
"\266\241\214\337\374\230\264\314ci\222\332\372#p\241g\305\012",
|
"\266\241\214\337\374\230\264\311ci\222\331\372#p\241g\305\012",
|
||||||
"\241\214\337\374\230\264\370\305\202\211\221ad\223\327\274\012",
|
"\241\214\337\374\230\264\370\305\202\211\220ad\223\326\274\012",
|
||||||
"\241\214\337\374\230\264\375pp\225\202wa\207\242\212\254\274\012",
|
"\241\214\337\374\230\264\375pp\225\202wa\207\242\212\254\274\012",
|
||||||
"\251\210-\327\235\353\224\255\360\233cl\204\235be\370\200\251\200(\366\227\232",
|
"\251\210-\326\235\353\224\255\360\233cl\204\235be\370\200\251\200(\366\227\232",
|
||||||
"\042\335e\267\331\353\224\255\272\266\332\042\366\331\250\313",
|
"\042\335e\267\330\353\224\255\272\266\331\042\366\330\250\314",
|
||||||
"\273\311\360\355\303(\311\216\232",
|
"\273\312\360\355\303(\312\216\232",
|
||||||
"#\327\200p\224\365\336\324\231\204\202\362\270 \355\211p\340be\205c \275\333c\365\012",
|
"#\326\200p\224\365\336\324\231\204\202\362\270 \355\211p\340be\205c \275\333c\365\012",
|
||||||
"\203pu\202l\203\200\306\371l\201\260(aft\264\375bs\205tu\214s\232",
|
"\203pu\202l\203\200\306\371l\201\260(aft\264\375bs\205tu\214s\232",
|
||||||
"\246n\325x \210r\255\372\270\200\363\201\316\255\266\273c\211l\012",
|
"\246n\325x \210r\255\372\270\200\363\201\316\255\266\273c\211l\012",
|
||||||
"m\211\370m\235UTF-8 \212\343d\203g\316\255c\225rupt\235\361le: \213\012",
|
"m\211\370m\235UTF-8 \212\343d\203g\316\255c\225rupt\235\361le: \213\012",
|
||||||
"\273\251\310bo\270 \042\221turn\331\226\206\042\221tur\336<\243ue>\042\012",
|
"\273\251\310bo\270 \042\220turn\330\226\206\042\220tur\336<\243ue>\042\012",
|
||||||
"\203\307\222\231\212\202\221tur\336typ\310(\303& n\201-\256y\232",
|
"\203\307\222\231\212\202\220tur\336typ\310(\303& n\201-\256y\232",
|
||||||
"\217k\220w\336\250\316\255\242\252\354\202\250 \323",
|
"\217k\221w\336\250\316\255\242\252\354\202\250 \323",
|
||||||
"c\226\242\325k\200\252\373a\207\252\302a\342\202\243u\200f\255\355\203\233x\235\303p\333met\264\323",
|
"c\226\242\325k\200\252\373a\207\252\302a\342\202\243u\200f\255\355\203\233x\235\303p\333met\264\323",
|
||||||
"\251\210-\327\235\353\224\225\207\226\206na\205\376\366\207\367\242\340\376\315e\313",
|
"\251\210-\326\235\353\224\225\207\226\206na\205\376\366\207\367\242\340\376\315e\314",
|
||||||
"\252\273\255\330\367\201l\223b\341\201\260\306 \252s\203g\352au\306\345\332\323",
|
"\252\273\255\327\367\201l\223b\341\201\260\306 \252s\203g\352au\306\345\331\323",
|
||||||
"\315\200\307fl\326t: \201\200\304\270\200\315\310\272\211\221ad\223a\253gn\235\306 a\220\270\264i\364le\234\325\237\323",
|
"\315\200\307fl\332t: \201\200\304\270\200\315\310\272\211\220ad\223a\253gn\235\306 a\221\270\264i\364le\234\325\237\323",
|
||||||
"\220 \315\310\204\200\327\235f\255\277\012",
|
"\221 \315\310\204\200\326\235f\255\277\012",
|
||||||
"\217k\220w\336au\306\345\201\321",
|
"\217k\221w\336au\306\345\201\321",
|
||||||
"\217k\220w\336\315\200\216 f\255au\306\345\201\321",
|
"\217k\221w\336\315\200\216 f\255au\306\345\201\321",
|
||||||
"pu\236\326 \301\310\226\206\344c\337\301\310\367\242\340\376\315\310\323",
|
"pu\236\332 \301\310\226\206\344c\337\301\310\367\242\340\376\315\310\323",
|
||||||
"\315\200\301\310\367\242\312\203i\205\211iz\235\323",
|
"\315\200\301\310\367\242\313\203i\205\211iz\235\323",
|
||||||
"pu\236\326 \366\207\367\242\221tur\336\256y\207\323",
|
"pu\236\332 \366\207\367\242\220tur\336\256y\207\323",
|
||||||
"a\230i\262ou\207\354t; \373ov\210rid\200\272\221qui\221\206\323",
|
"a\230i\262ou\207\354t; \373ov\210rid\200\272\220qui\220\206\323",
|
||||||
"\374\230\264\304\265t\207do\310\242\345\275 \327i\214\012",
|
"\374\230\264\304\265t\207do\310\242\345\275 \326i\214\012"
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -248,14 +248,14 @@ static char *fatalmsg[] = {
|
|||||||
/*110*/ "assertion failed: %s\n",
|
/*110*/ "assertion failed: %s\n",
|
||||||
/*111*/ "user error: %s\n",
|
/*111*/ "user error: %s\n",
|
||||||
#else
|
#else
|
||||||
"c\226\242\221a\206from \361le\347",
|
"c\226\242\220a\206from \361le\347",
|
||||||
"c\226\242writ\200\306 \361le\347",
|
"c\226\242writ\200\306 \361le\347",
|
||||||
"t\254\200ov\210f\344w\347",
|
"t\254\200ov\210f\344w\347",
|
||||||
"\203\375ff\326i\212\202mem\225y\012",
|
"\203\375ff\332i\212\202mem\225y\012",
|
||||||
"\266\351se\230l\264\203\231ruc\214\321",
|
"\266\351se\230l\264\203\231ruc\214\321",
|
||||||
"\374m\210\326 ov\210f\344w\316\271ce\274\357capacity\012",
|
"\374m\210\332 ov\210f\344w\316\271ce\274\357capacity\012",
|
||||||
"\343\364il\235scrip\202\271ce\274\207\270\200\305ximum mem\225\223\335\200(%l\206bytes\232",
|
"\343\364il\235scrip\202\271ce\274\207\270\200\305ximum mem\225\223\335\200(%l\206bytes\232",
|
||||||
"\306\371m\226\223\210r\255messag\310\332\201\200l\203\322",
|
"\306\371m\226\223\210r\255messag\310\331\201\200l\203\322",
|
||||||
"\343\233pag\200\305pp\357\361\352\242fo\217d\012",
|
"\343\233pag\200\305pp\357\361\352\242fo\217d\012",
|
||||||
"\266p\224h\347",
|
"\266p\224h\347",
|
||||||
"\351s\210\237fail\274: \213\012",
|
"\351s\210\237fail\274: \213\012",
|
||||||
@ -303,42 +303,42 @@ static char *warnmsg[] = {
|
|||||||
/*235*/ "public function lacks forward declaration (symbol \"%s\")\n",
|
/*235*/ "public function lacks forward declaration (symbol \"%s\")\n",
|
||||||
/*236*/ "unknown parameter in substitution (incorrect #define pattern)\n"
|
/*236*/ "unknown parameter in substitution (incorrect #define pattern)\n"
|
||||||
#else
|
#else
|
||||||
"\277 \272tr\244\224\235\306 %\206\275\333c\365\313",
|
"\277 \272tr\244\224\235\306 %\206\275\333c\365\314",
|
||||||
"\221\327i\237\304\354t/\305cr\371\323",
|
"\220\326i\237\304\354t/\305cr\371\323",
|
||||||
"\374\230\264\304\265t\207do\310\242\345\275 \327i\214\012",
|
"\374\230\264\304\265t\207do\310\242\345\275 \326i\214\012",
|
||||||
"\250 \272nev\264\251\274\347",
|
"\250 \272nev\264\251\274\347",
|
||||||
"\250 \272a\253gn\235\252\243u\200\270a\202\272nev\264\251\274\347",
|
"\250 \272a\253gn\235\252\243u\200\270a\202\272nev\264\251\274\347",
|
||||||
"\221d\217d\226\202\343\233: \354\202\363\332\272z\210o\012",
|
"\220d\217d\226\202\343\233: \354\202\363\331\272z\210o\012",
|
||||||
"\221d\217d\226\202te\231: \354\202\363\332\272n\201-z\210o\012",
|
"\220d\217d\226\202te\231: \354\202\363\331\272n\201-z\210o\012",
|
||||||
"\217k\220w\336#p\241g\305\012",
|
"\217k\221w\336#p\241g\305\012",
|
||||||
"\273\362\270 \373\221s\342\202\251\235be\370\200\327i\214\316\370c\357\221p\204s\322",
|
"\273\362\270 \373\220s\342\202\251\235be\370\200\326i\214\316\370c\357\220p\204s\322",
|
||||||
"\366\227 sho\342\206\221tur\336\252\243u\322",
|
"\366\227 sho\342\206\220tur\336\252\243u\322",
|
||||||
"po\253\236\200\251\200\304\250 be\370\200\203i\205\211iza\214\347",
|
"po\253\236\200\251\200\304\250 be\370\200\203i\205\211iza\214\347",
|
||||||
"po\253\236\223\217\203t\212\233\206a\253gn\234t\012",
|
"po\253\236\223\217\203t\212\233\206a\253gn\234t\012",
|
||||||
"po\253\236\223\217\203t\212\233\206bit\362s\200\353a\214\012",
|
"po\253\236\223\217\203t\212\233\206bit\362s\200\353a\214\012",
|
||||||
"\373mis\345\275\012",
|
"\373mis\345\275\012",
|
||||||
"po\253\236\223\252\042\346\331\303\311wa\207\203t\212\233d\347",
|
"po\253\236\223\252\042\346\330\303\312wa\207\203t\212\233d\347",
|
||||||
"\363\332\340\207\220 effect\012",
|
"\363\331\340\207\221 effect\012",
|
||||||
"ne\231\235\343m\234t\012",
|
"ne\231\235\343m\234t\012",
|
||||||
"\344os\200\203d\212\325\214\012",
|
"\344os\200\203d\212\325\214\012",
|
||||||
"\240\206\231y\352pro\306typ\310\251\235\362\270 \350\214\337sem\326\240umn\313",
|
"\240\206\231y\352pro\306typ\310\251\235\362\270 \350\214\337sem\332\240umn\314",
|
||||||
"\344c\337\330\216 s\340dow\207\252\330a\202\252\314c\274\357lev\341\012",
|
"\344c\337\327\216 s\340dow\207\252\327a\202\252\311c\274\357lev\341\012",
|
||||||
"\363\332\362\270 \373ov\210rid\200\324appe\204 betwe\212 p\204\212\270ese\313",
|
"\363\331\362\270 \373ov\210rid\200\324appe\204 betwe\212 p\204\212\270ese\314",
|
||||||
"lab\341 nam\200\216 s\340dow\207\373nam\322",
|
"lab\341 nam\200\216 s\340dow\207\373nam\322",
|
||||||
"\374\230\264\304\334git\207\271ce\274\207\241\214\337\374\230\264\314ci\222\201\012",
|
"\374\230\264\304\334git\207\271ce\274\207\241\214\337\374\230\264\311ci\222\201\012",
|
||||||
"\221d\217d\226\202\042\335e\267\042: \311\335\200\272\211way\2071 \323",
|
"\220d\217d\226\202\042\335e\267\042: \312\335\200\272\211way\2071 \323",
|
||||||
"\203\233\365m\203\224\200\303\335\200\372\042\335e\267\331\363\332\323",
|
"\203\233\365m\203\224\200\303\335\200\372\042\335e\267\330\363\331\323",
|
||||||
"\217\221a\275\254\200\343\233\012",
|
"\217\220a\275\254\200\343\233\012",
|
||||||
"\252\330\272a\253gn\235\306 its\341f \323",
|
"\252\327\272a\253gn\235\306 its\341f \323",
|
||||||
"m\225\200\203i\205\211l\210\207\270\355\212um \361\341d\313",
|
"m\225\200\203i\205\211l\210\207\270\355\212um \361\341d\314",
|
||||||
"l\212g\270 \304\203i\205\211l\264\271ce\274\207\335\200\304\270\200\212um \361\341d\012",
|
"l\212g\270 \304\203i\205\211l\264\271ce\274\207\335\200\304\270\200\212um \361\341d\012",
|
||||||
"\203\233x \373mis\345\275 \323",
|
"\203\233x \373mis\345\275 \323",
|
||||||
"\220 i\364le\234\325\237f\255\315\200\216 \372\366\227\316\220 f\211l-back\012",
|
"\221 i\364le\234\325\237f\255\315\200\216 \372\366\227\316\221 f\211l-back\012",
|
||||||
"\315\200specif\326a\237\332\370w\204\206\233cl\333\237\272ig\220\221d\012",
|
"\315\200specif\332a\237\331\370w\204\206\233cl\333\237\272ig\221\220d\012",
|
||||||
"outpu\202\361\352\272writt\212\316bu\202\362\270 \343\364ac\202\212\343d\357\334s\254\274\012",
|
"outpu\202\361\352\272writt\212\316bu\202\362\270 \343\364ac\202\212\343d\357\334s\254\274\012",
|
||||||
"\315\200\330\216 s\340dow\207\252g\344b\337\301\322",
|
"\315\200\327\216 s\340dow\207\252g\344b\337\301\322",
|
||||||
"\273\272\233pr\326\224\235\317) \213\012",
|
"\273\272\233\311c\224\235\317) \213\012",
|
||||||
"pu\236\326 \273lack\207\370w\204\206\233cl\333\237\323",
|
"pu\236\332 \273lack\207\370w\204\206\233cl\333\237\323",
|
||||||
"\217k\220w\336p\333met\264\372\375bs\205tu\237(\203c\225\221c\202#\327\200p\224\365n\232"
|
"\217k\221w\336p\333met\264\372\375bs\205tu\237(\203c\225\220c\202#\326\200p\224\365n\232"
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
* misrepresented as being the original software.
|
* misrepresented as being the original software.
|
||||||
* 3. This notice may not be removed or altered from any source distribution.
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
*
|
*
|
||||||
* Version: $Id: sc6.c 3579 2006-06-06 13:35:29Z thiadmer $
|
* Version: $Id: sc6.c 3633 2006-08-11 16:20:18Z thiadmer $
|
||||||
*/
|
*/
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -670,7 +670,7 @@ SC_FUNC int assemble(FILE *fout,FILE *fin)
|
|||||||
symbol *sym, **nativelist;
|
symbol *sym, **nativelist;
|
||||||
constvalue *constptr;
|
constvalue *constptr;
|
||||||
cell mainaddr;
|
cell mainaddr;
|
||||||
char nullchar = 0;
|
char nullchar;
|
||||||
|
|
||||||
/* if compression failed, restart the assembly with compaction switched off */
|
/* if compression failed, restart the assembly with compaction switched off */
|
||||||
if (setjmp(compact_err)!=0) {
|
if (setjmp(compact_err)!=0) {
|
||||||
@ -785,6 +785,7 @@ SC_FUNC int assemble(FILE *fout,FILE *fin)
|
|||||||
pc_writebin(fout,&hdr,sizeof hdr);
|
pc_writebin(fout,&hdr,sizeof hdr);
|
||||||
|
|
||||||
/* dump zeros up to the rest of the header, so that we can easily "seek" */
|
/* dump zeros up to the rest of the header, so that we can easily "seek" */
|
||||||
|
nullchar='\0';
|
||||||
for (nameofs=sizeof hdr; nameofs<hdr.cod; nameofs++)
|
for (nameofs=sizeof hdr; nameofs<hdr.cod; nameofs++)
|
||||||
pc_writebin(fout,&nullchar,1);
|
pc_writebin(fout,&nullchar,1);
|
||||||
nameofs=hdr.nametable+sizeof(int16_t);
|
nameofs=hdr.nametable+sizeof(int16_t);
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
* misrepresented as being the original software.
|
* misrepresented as being the original software.
|
||||||
* 3. This notice may not be removed or altered from any source distribution.
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
*
|
*
|
||||||
* Version: $Id: CODEPAGE.C,v 1.0 2004-02-18 12:13:04+01 thiadmer Exp thiadmer $
|
* Version: $Id: sci18n.c 3612 2006-07-22 09:59:46Z thiadmer $
|
||||||
*/
|
*/
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
*
|
*
|
||||||
* o Name list (aliases)
|
* o Name list (aliases)
|
||||||
* o Include path list
|
* o Include path list
|
||||||
* o Macro defintions (text substitutions)
|
* o Macro definitions (text substitutions)
|
||||||
|
* o Documentation tags and automatic listings
|
||||||
|
* o Debug strings
|
||||||
*
|
*
|
||||||
* Copyright (c) ITB CompuPhase, 2001-2006
|
* Copyright (c) ITB CompuPhase, 2001-2006
|
||||||
*
|
*
|
||||||
@ -22,7 +24,7 @@
|
|||||||
* misrepresented as being the original software.
|
* misrepresented as being the original software.
|
||||||
* 3. This notice may not be removed or altered from any source distribution.
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
*
|
*
|
||||||
* Version: $Id: sclist.c 3579 2006-06-06 13:35:29Z thiadmer $
|
* Version: $Id: sclist.c 3633 2006-08-11 16:20:18Z thiadmer $
|
||||||
*/
|
*/
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
@ -31,12 +31,15 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "memfile.h"
|
#include "memfile.h"
|
||||||
|
|
||||||
|
#if defined FORTIFY
|
||||||
|
#include <alloc/fortify.h>
|
||||||
|
#endif
|
||||||
typedef memfile_t MEMFILE;
|
typedef memfile_t MEMFILE;
|
||||||
#define tMEMFILE 1
|
#define tMEMFILE 1
|
||||||
|
|
||||||
#include "sc.h"
|
#include "sc.h"
|
||||||
|
|
||||||
MEMFILE *mfcreate(char *filename)
|
MEMFILE *mfcreate(const char *filename)
|
||||||
{
|
{
|
||||||
return memfile_creat(filename, 4096);
|
return memfile_creat(filename, 4096);
|
||||||
}
|
}
|
||||||
@ -64,7 +67,7 @@ int mfdump(MEMFILE *mf)
|
|||||||
return okay;
|
return okay;
|
||||||
}
|
}
|
||||||
|
|
||||||
long mflength(MEMFILE *mf)
|
long mflength(const MEMFILE *mf)
|
||||||
{
|
{
|
||||||
return mf->usedoffs;
|
return mf->usedoffs;
|
||||||
}
|
}
|
||||||
@ -105,7 +108,7 @@ long mfseek(MEMFILE *mf,long offset,int whence)
|
|||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int mfwrite(MEMFILE *mf,unsigned char *buffer,unsigned int size)
|
unsigned int mfwrite(MEMFILE *mf,const unsigned char *buffer,unsigned int size)
|
||||||
{
|
{
|
||||||
return (memfile_write(mf, buffer, size) ? size : 0);
|
return (memfile_write(mf, buffer, size) ? size : 0);
|
||||||
}
|
}
|
||||||
@ -152,7 +155,7 @@ char *mfgets(MEMFILE *mf,char *string,unsigned int size)
|
|||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
|
||||||
int mfputs(MEMFILE *mf,char *string)
|
int mfputs(MEMFILE *mf,const char *string)
|
||||||
{
|
{
|
||||||
unsigned int written,length;
|
unsigned int written,length;
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
* misrepresented as being the original software.
|
* misrepresented as being the original software.
|
||||||
* 3. This notice may not be removed or altered from any source distribution.
|
* 3. This notice may not be removed or altered from any source distribution.
|
||||||
*
|
*
|
||||||
* Version: $Id: scvars.c 3577 2006-06-02 16:22:52Z thiadmer $
|
* Version: $Id: scvars.c 3633 2006-08-11 16:20:18Z thiadmer $
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h> /* for _MAX_PATH */
|
#include <stdlib.h> /* for _MAX_PATH */
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#define SMC_VERSION 1
|
#define SMC_VERSION 1
|
||||||
#define SMC_REVISION 0
|
#define SMC_REVISION 0
|
||||||
#define SMC_BUILD 1
|
#define SMC_BUILD 1
|
||||||
#define SMC_VERSTRING "1.0.1.3599"
|
#define SMC_VERSTRING "1.0.1.3636"
|
||||||
|
|
||||||
#define SVN_REV 3599
|
#define SVN_REV 3636
|
||||||
#define SVN_REVSTR "3599"
|
#define SVN_REVSTR "3636"
|
||||||
#define SVN_REVDATE "2006-07-05"
|
#define SVN_REVDATE "2006-08-14"
|
||||||
#define SVN_REVSTAMP 20060705L
|
#define SVN_REVSTAMP 20060814L
|
||||||
|
Loading…
Reference in New Issue
Block a user