1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-01 13:41:34 +00:00

remove dangling spaces

This commit is contained in:
mrdudz 2022-04-17 16:07:52 +02:00
parent 1be54d13bc
commit 0129622383
89 changed files with 459 additions and 459 deletions

View File

@ -1,7 +1,7 @@
/* bug #1098 Empty enumerator-list */ /* bug #1098 Empty enumerator-list */
/* The C Standard requires that something exists between the braces for /* The C Standard requires that something exists between the braces for
* enum, struct, and union. */ * enum, struct, and union. */
enum { enum {

View File

@ -1,7 +1,7 @@
/* bug #1098 Empty enumerator-list */ /* bug #1098 Empty enumerator-list */
/* The C Standard requires that something exists between the braces for /* The C Standard requires that something exists between the braces for
* enum, struct, and union. */ * enum, struct, and union. */
struct { struct {

View File

@ -1,7 +1,7 @@
/* bug #1098 Empty enumerator-list */ /* bug #1098 Empty enumerator-list */
/* The C Standard requires that something exists between the braces for /* The C Standard requires that something exists between the braces for
* enum, struct, and union. */ * enum, struct, and union. */
union { union {

View File

@ -1,5 +1,5 @@
/* pr #1110 - not only should the current test case for #975 compile and work, /* pr #1110 - not only should the current test case for #975 compile and work,
* but also the code piece below fail to compile and generate errors like commented: */ * but also the code piece below fail to compile and generate errors like commented: */
static const unsigned char array[3]; /* OK */ static const unsigned char array[3]; /* OK */
@ -7,7 +7,7 @@ static const unsigned char array[] = { 0, 1, 2 }; /* OK - complete definition*
static const unsigned char array[3]; /* OK */ static const unsigned char array[3]; /* OK */
static const unsigned char array[]; /* OK */ static const unsigned char array[]; /* OK */
static const unsigned char array[] = { 1, 2, 3 }; /* Error - redefinition */ static const unsigned char array[] = { 1, 2, 3 }; /* Error - redefinition */
static const unsigned char array[4]; /* Error - conflicting size */ static const unsigned char array[4]; /* Error - conflicting size */
int main(void) int main(void)
{ {

View File

@ -17,7 +17,7 @@ int main (void) {
x = 1234; x = 1234;
n = f1 (x); n = f1 (x);
sprintf (str2, "%p\n", &x); sprintf (str2, "%p\n", &x);
if (strcmp(str1, str2)) { if (strcmp(str1, str2)) {
puts("not equal"); puts("not equal");
failures++; failures++;
@ -31,7 +31,7 @@ int main (void) {
x = 2345; x = 2345;
n = f2 (x); n = f2 (x);
sprintf (str2, "%p\n", &x); sprintf (str2, "%p\n", &x);
if (strcmp(str1, str2)) { if (strcmp(str1, str2)) {
puts("not equal"); puts("not equal");
failures++; failures++;

View File

@ -106,7 +106,7 @@ int
main() { main() {
int status = 0; /* exit status to be returned */ int status = 0; /* exit status to be returned */
/* <stdint.h> features: */ /* <stdint.h> features: */
printf("CHAR_BIT=%u\n", (unsigned)CHAR_BIT ); printf("CHAR_BIT=%u\n", (unsigned)CHAR_BIT );
@ -526,12 +526,12 @@ main() {
else /* for trailing semicolon */ else /* for trailing semicolon */
#else #else
#define SCAN(buf,fs,var,exp) #define SCAN(buf,fs,var,exp)
#define PRINT(fs,var,exp) #define PRINT(fs,var,exp)
#endif #endif
#ifdef SCNo32 #ifdef SCNo32
SCAN(in_dn, SCNo32, int32, 9); SCAN(in_dn, SCNo32, int32, 9);
@ -586,7 +586,7 @@ main() {
#endif #endif
#if 0 #if 0
#ifdef INT16_MAX #ifdef INT16_MAX
{ INT16_MAX, INT16_MAX, }, { INT16_MAX, INT16_MAX, },
{ -INT16_MAX, INT16_MAX, }, { -INT16_MAX, INT16_MAX, },
@ -830,7 +830,7 @@ main() {
} }
#endif #endif
} }
{ {
char *endptr; char *endptr;
wchar_t *wendptr; wchar_t *wendptr;

View File

@ -29,7 +29,7 @@ main() {
p[j] = x[i][j]; p[j] = x[i][j];
} }
g(z, y); g(z, y);
return 0; return 0;
} }

View File

@ -27,7 +27,7 @@ int main(int argc, char* argv[])
test.c(20): Error: Incompatible pointer types test.c(20): Error: Incompatible pointer types
for   APtr=&(Bs[7].Data[1]); for   APtr=&(Bs[7].Data[1]);
My experience in C is very limited, but as this works both in MSVC and My experience in C is very limited, but as this works both in MSVC and
the 8 bit Z80 compiler i originally used, i guess its an bug in CC65. the 8 bit Z80 compiler i originally used, i guess its an bug in CC65.
As a workaround, an typecast via  APtr=(TypA*)&(Bs[7].Data[1]); As a workaround, an typecast via  APtr=(TypA*)&(Bs[7].Data[1]);

View File

@ -1,5 +1,5 @@
/* /*
!!DESCRIPTION!! !!DESCRIPTION!!
!!ORIGIN!! testsuite !!ORIGIN!! testsuite
!!LICENCE!! Public Domain !!LICENCE!! Public Domain
!!AUTHOR!! !!AUTHOR!!

View File

@ -1,5 +1,5 @@
/* /*
!!DESCRIPTION!! !!DESCRIPTION!!
!!ORIGIN!! testsuite !!ORIGIN!! testsuite
!!LICENCE!! Public Domain !!LICENCE!! Public Domain
!!AUTHOR!! !!AUTHOR!!

View File

@ -1,5 +1,5 @@
/* /*
!!DESCRIPTION!! !!DESCRIPTION!!
!!ORIGIN!! testsuite !!ORIGIN!! testsuite
!!LICENCE!! Public Domain !!LICENCE!! Public Domain
!!AUTHOR!! !!AUTHOR!!

View File

@ -1,5 +1,5 @@
/* /*
!!DESCRIPTION!! !!DESCRIPTION!!
!!ORIGIN!! testsuite !!ORIGIN!! testsuite
!!LICENCE!! Public Domain !!LICENCE!! Public Domain
!!AUTHOR!! !!AUTHOR!!
@ -8,7 +8,7 @@
#include <stdio.h> #include <stdio.h>
/* /*
there is a bug in the preprocessor (i think) ... the following works there is a bug in the preprocessor (i think) ... the following works
(compiles) correctly: (compiles) correctly:
unsigned long fs,fd,a; unsigned long fs,fd,a;
@ -32,7 +32,7 @@ int main(void)
fs=(func((fd/a),(func(2,0x0082c90f)))); fs=(func((fd/a),(func(2,0x0082c90f))));
} }
i get "Error: ')' expected" on that line. (this is with the snapshot, freshly i get "Error: ')' expected" on that line. (this is with the snapshot, freshly
compiled 5 minutes ago) compiled 5 minutes ago)
*/ */

View File

@ -1,5 +1,5 @@
/* /*
!!DESCRIPTION!! !!DESCRIPTION!!
!!ORIGIN!! testsuite !!ORIGIN!! testsuite
!!LICENCE!! Public Domain !!LICENCE!! Public Domain
!!AUTHOR!! !!AUTHOR!!
@ -36,7 +36,7 @@ void Proc1(RecordPtr PtrParIn)
Proc3((*(PtrParIn->PtrComp)).PtrComp); Proc3((*(PtrParIn->PtrComp)).PtrComp);
Proc3(NextRecord.PtrComp); Proc3(NextRecord.PtrComp);
#endif #endif
#undef NextRecord #undef NextRecord
} }

View File

@ -34,5 +34,5 @@ So testing with 999 gives:
231 mod 999 is 0 231 mod 999 is 0
999 mod 999 is 0 999 mod 999 is 0
This seems to be systematic. This seems to be systematic.
*/ */

View File

@ -67,7 +67,7 @@ char *argv[];
} }
printf("input:\n\n"); printf("input:\n\n");
nc = 0; nc = 0;
while ((c = GETCHAR()) != -1) while ((c = GETCHAR()) != -1)
{ {

View File

@ -1,5 +1,5 @@
/* /*
!!DESCRIPTION!! !!DESCRIPTION!!
!!ORIGIN!! testsuite !!ORIGIN!! testsuite
!!LICENCE!! Public Domain !!LICENCE!! Public Domain
!!AUTHOR!! Groepaz/Hitmen !!AUTHOR!! Groepaz/Hitmen
@ -24,7 +24,7 @@ FILE *outfile=NULL;
#else #else
#endif #endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <fcntl.h> #include <fcntl.h>
@ -65,17 +65,17 @@ static unsigned char ch;
/* basic line-link / file-length */ /* basic line-link / file-length */
memcpy(buffer,b1,4); memcpy(buffer,b1,4);
dir->off=dir->off+4; dir->off=dir->off+4;
entry.d_reclen=254*(buffer[2]+(buffer[3]<<8)); entry.d_reclen=254*(buffer[2]+(buffer[3]<<8));
/* read file entry */ /* read file entry */
memcpy(buffer,b2,0x10); memcpy(buffer,b2,0x10);
dir->off=dir->off+i; dir->off=dir->off+i;
printf("Xreaddir: '%s'\n",buffer); printf("Xreaddir: '%s'\n",buffer);
/* skip until either quote (file) or b (blocks free => end) */ /* skip until either quote (file) or b (blocks free => end) */
i=0;ii=0; i=0;ii=0;
while(i==0){ while(i==0){
@ -113,9 +113,9 @@ int main(void)
char mydirname[XNAME_MAX+1]="."; char mydirname[XNAME_MAX+1]=".";
XDIR mydir; XDIR mydir;
struct Xdirent *mydirent; struct Xdirent *mydirent;
printf("start\n"); printf("start\n");
if((mydirent=Xreaddir(&mydir))==NULL) if((mydirent=Xreaddir(&mydir))==NULL)
{ {
printf("NULL\n"); printf("NULL\n");

View File

@ -246,7 +246,7 @@ rect screen =
); );
test1(); test1();
for (i = 0; i < sizeof pts/sizeof pts[0]; i++) { for (i = 0; i < sizeof pts/sizeof pts[0]; i++) {
printf("(%d,%d) is ", pts[i].x, printf("(%d,%d) is ", pts[i].x,
(x = makepoint(pts[i].x, pts[i].y)).y); (x = makepoint(pts[i].x, pts[i].y)).y);

View File

@ -169,7 +169,7 @@ void testdefault2(unsigned char i) {
case 170: case 170:
break; break;
case 18: case 18:
break; break;
case 19: case 19:
@ -215,12 +215,12 @@ int main(void) {
testlimits(32767); testlimits(32767);
testlimits(-32768); testlimits(-32768);
testlimits(-1); testlimits(-1);
testdefault1(1); testdefault1(1);
testdefault1(2); testdefault1(2);
testdefault1(3); testdefault1(3);
testdefault1(4); testdefault1(4);
testdefault2(1); testdefault2(1);
testdefault2(2); testdefault2(2);
testdefault2(3); testdefault2(3);

View File

@ -70,7 +70,7 @@ int yytchar;
#define yyout outfile #define yyout outfile
extern int yylineno; extern int yylineno;
struct yysvf struct yysvf
{ {
struct yywork *yystoff; struct yywork *yystoff;
struct yysvf *yyother; struct yysvf *yyother;
@ -150,7 +150,7 @@ yyfussy:
} }
} }
#ifdef YYDEBUG #ifdef YYDEBUG
fprintf(yyout,"yylex: return 0\n"); fprintf(yyout,"yylex: return 0\n");
#endif #endif
@ -164,9 +164,9 @@ int yyvstop[] =
}; };
# define YYTYPE char # define YYTYPE char
struct yywork struct yywork
{ {
YYTYPE verify, advance; YYTYPE verify, advance;
} yycrank[] = } yycrank[] =
{ {
{0,0}, {0,0}, {1,3}, {0,0}, {0,0}, {0,0}, {1,3}, {0,0},
@ -178,12 +178,12 @@ struct yywork
{0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0},
{0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0},
{0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0},
{0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0},
{0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0},
{0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0},
{0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0},
{0,0}, {1,5}, {5,7}, {5,7}, {0,0}, {1,5}, {5,7}, {5,7},
{5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7},
{5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7},
@ -193,17 +193,17 @@ struct yywork
{6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8},
{6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8},
{6,8}, {0,0}, {0,0}, {0,0}, {6,8}, {0,0}, {0,0}, {0,0},
{0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0},
{6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8},
{6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8},
{6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8},
{6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8},
{6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8},
{6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8},
{6,8}, {6,8}, {0,0}, {0,0}, {6,8}, {6,8}, {0,0}, {0,0},
{0,0}, {0,0}, {6,8}, {0,0}, {0,0}, {0,0}, {6,8}, {0,0},
{6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8},
{6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8},
@ -240,7 +240,7 @@ struct yywork
}; };
/* /*
struct yysvf struct yysvf
{ {
struct yywork *yystoff; struct yywork *yystoff;
struct yysvf *yyother; struct yysvf *yyother;
@ -281,27 +281,27 @@ char yymatch[] =
#endif #endif
01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 , 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 , 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
011 ,01 ,01 ,01 ,01 ,01 ,01 ,01 , 011 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 , 01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
'0' ,'0' ,'0' ,'0' ,'0' ,'0' ,'0' ,'0' , '0' ,'0' ,'0' ,'0' ,'0' ,'0' ,'0' ,'0' ,
'0' ,'0' ,01 ,01 ,01 ,01 ,01 ,01 , '0' ,'0' ,01 ,01 ,01 ,01 ,01 ,01 ,
/* 0x40 (ascii) @A... (petscii) @a... */ /* 0x40 (ascii) @A... (petscii) @a... */
01 ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' , 01 ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' , 'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' , 'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,01 ,01 ,01 ,01 ,'A' , 'A' ,'A' ,'A' ,01 ,01 ,01 ,01 ,'A' ,
/* 0x60 (ascii) @a... */ /* 0x60 (ascii) @a... */
01 ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' , 01 ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' , 'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' , 'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,01 ,01 ,01 ,01 ,01 , 'A' ,'A' ,'A' ,01 ,01 ,01 ,01 ,01 ,
#ifdef CHARSETHACK #ifdef CHARSETHACK
/* 0x80 */ /* 0x80 */
0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
@ -312,10 +312,10 @@ char yymatch[] =
/* 0xc0 (petcii) @A... */ /* 0xc0 (petcii) @A... */
01 ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' , 01 ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' , 'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' , 'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
'A' ,'A' ,'A' ,01 ,01 ,01 ,01 ,01 , 'A' ,'A' ,'A' ,01 ,01 ,01 ,01 ,01 ,
0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
@ -354,9 +354,9 @@ yylook()
int debug; int debug;
# endif # endif
*/ */
char *yylastch; char *yylastch;
/* start off machines */ /* start off machines */
/* /*
@ -372,11 +372,11 @@ yylook()
# else # else
#define debug 0 #define debug 0
#endif #endif
#ifdef YYDEBUG #ifdef YYDEBUG
fprintf(yyout,"yylook()\n"); fprintf(yyout,"yylook()\n");
# endif # endif
if (!yymorfg) if (!yymorfg)
yylastch = yytext; yylastch = yytext;
else else
@ -388,7 +388,7 @@ yylook()
#ifdef YYDEBUG #ifdef YYDEBUG
fprintf(yyout,"yylook: yymorfg=%d\n",yymorfg); fprintf(yyout,"yylook: yymorfg=%d\n",yymorfg);
# endif # endif
for(;;) for(;;)
{ {
#ifdef YYDEBUG #ifdef YYDEBUG
@ -400,7 +400,7 @@ yylook()
if (yyprevious==YYNEWLINE) yystate++; if (yyprevious==YYNEWLINE) yystate++;
testbreak=0; testbreak=0;
for (;;) for (;;)
{ {
# ifdef LEXDEBUG # ifdef LEXDEBUG
@ -412,12 +412,12 @@ yylook()
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
testbreak++; testbreak++;
yyt = yystate->yystoff; yyt = yystate->yystoff;
/* fprintf(yyout,"yylook: yyt offs: %02x\n",yyt-yycrank); */ /* fprintf(yyout,"yylook: yyt offs: %02x\n",yyt-yycrank); */
if(yyt == yycrank) if(yyt == yycrank)
{ /* may not be any transitions */ { /* may not be any transitions */
yyz = yystate->yyother; yyz = yystate->yyother;
@ -430,7 +430,7 @@ yylook()
fprintf(yyout,"yylook: input "); fprintf(yyout,"yylook: input ");
printchar("yych",yych); printchar("yych",yych);
# endif # endif
tryagain: tryagain:
# ifdef LEXDEBUG # ifdef LEXDEBUG
@ -440,7 +440,7 @@ yylook()
yyr = yyt; yyr = yyt;
/* fprintf(yyout,"yylook: yyr offs: %02x\n",yyr-yycrank); */ /* fprintf(yyout,"yylook: yyr offs: %02x\n",yyr-yycrank); */
if ( yyt > yycrank) if ( yyt > yycrank)
{ {
yyt = yyr + yych; yyt = yyr + yych;
@ -467,7 +467,7 @@ yylook()
} }
# ifdef YYOPTIM # ifdef YYOPTIM
else if(yyt < yycrank) /* r < yycrank */ else if(yyt < yycrank) /* r < yycrank */
{ {
yyt = yyr = yycrank+(yycrank-yyt); yyt = yyr = yycrank+(yycrank-yyt);
# ifdef LEXDEBUG # ifdef LEXDEBUG
fprintf(yyout,"yylook: compressed state\n"); fprintf(yyout,"yylook: compressed state\n");
@ -492,7 +492,7 @@ yylook()
fprintf(yyout,"yylook: continue (2)\n"); fprintf(yyout,"yylook: continue (2)\n");
# endif # endif
goto contin; goto contin;
} }
# ifdef LEXDEBUG # ifdef LEXDEBUG
/* /*
@ -509,12 +509,12 @@ yylook()
*/ */
fprintf(yyout,"yylook: try fall back character\n"); fprintf(yyout,"yylook: try fall back character\n");
# endif # endif
if(yyt <= yytop && yyt->verify+yysvec == yystate) if(yyt <= yytop && yyt->verify+yysvec == yystate)
{ {
# ifdef LEXDEBUG # ifdef LEXDEBUG
fprintf(yyout,"yylook: (2a)\n"); fprintf(yyout,"yylook: (2a)\n");
# endif # endif
if(yyt->advance+yysvec == YYLERR) /* error transition */ if(yyt->advance+yysvec == YYLERR) /* error transition */
{ {
# ifdef LEXDEBUG # ifdef LEXDEBUG
@ -531,7 +531,7 @@ yylook()
fprintf(yyout,"yylook: continue (3)\n"); fprintf(yyout,"yylook: continue (3)\n");
# endif # endif
goto contin; goto contin;
} }
# ifdef LEXDEBUG # ifdef LEXDEBUG
fprintf(yyout,"yylook: (2)\n"); fprintf(yyout,"yylook: (2)\n");
@ -578,7 +578,7 @@ yylook()
{ {
yyolsp = lsp; yyolsp = lsp;
if(yyextra[*yyfnd]) /* must backup */ if(yyextra[*yyfnd]) /* must backup */
{ {
while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate) while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate)
{ {
lsp--; lsp--;
@ -630,7 +630,7 @@ yylook()
# endif # endif
} }
yyback(p, m) yyback(p, m)
int *p; int *p;
{ {
@ -648,25 +648,25 @@ yyback(p, m)
yyinput() yyinput()
{ {
int out=input(); int out=input();
#ifdef YYDEBUG #ifdef YYDEBUG
fprintf(yyout,"yylook: input "); fprintf(yyout,"yylook: input ");
printchar("out",out); printchar("out",out);
#endif #endif
return(out); return(out);
} }
yyoutput(c) yyoutput(c)
int c; int c;
{ {
output(c); output(c);
} }
yyunput(c) yyunput(c)
int c; int c;
{ {
unput(c); unput(c);
} }
main() main()
{ {
printf("main start\n"); printf("main start\n");
infile = fopen("yacc.in","rb"); infile = fopen("yacc.in","rb");
@ -681,8 +681,8 @@ main()
} }
/* yyerror - issue error message */ /* yyerror - issue error message */
yyerror(s) yyerror(s)
char *s; char *s;
{ {
printf("[%s]\n", s); printf("[%s]\n", s);
} }
@ -722,39 +722,39 @@ short yyact[]=
0, 0, 0, 0, 0, 0, 0, 6, 14, 0, 0, 0, 0, 0, 0, 0, 0, 6, 14, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 4, 6 0, 0, 0, 0, 0, 0, 0, 4, 6
}; };
short yypact[]= short yypact[]=
{ {
-1000, -9,-1000, 5, -7, -59,-1000,-1000,-1000, -40, -1000, -9,-1000, 5, -7, -59,-1000,-1000,-1000, -40,
-29, -40, -40,-1000,-1000, -40, -40, -40, -40, -38, -29, -40, -40,-1000,-1000, -40, -40, -40, -40, -38,
-35, -38, -38,-1000,-1000,-1000 -35, -38, -38,-1000,-1000,-1000
}; };
short yypgo[]= short yypgo[]=
{ {
0, 21, 20, 17, 11 0, 21, 20, 17, 11
}; };
short yyr1[]= short yyr1[]=
{ {
0, 1, 1, 1, 1, 2, 4, 4, 4, 4, 0, 1, 1, 1, 1, 2, 4, 4, 4, 4,
4, 4, 4, 4, 3 4, 4, 4, 4, 3
}; };
short yyr2[]= short yyr2[]=
{ {
0, 0, 2, 3, 3, 3, 3, 3, 3, 3, 0, 0, 2, 3, 3, 3, 3, 3, 3, 3,
2, 3, 1, 1, 1 2, 3, 1, 1, 1
}; };
short yychk[]= short yychk[]=
{ {
-1000, -1, 10, -2, 256, -3, 257, 10, 10, 61, -1000, -1, 10, -2, 256, -3, 257, 10, 10, 61,
-4, 45, 40, -3, 258, 43, 45, 42, 47, -4, -4, 45, 40, -3, 258, 43, 45, 42, 47, -4,
-4, -4, -4, -4, -4, 41 -4, -4, -4, -4, -4, 41
}; };
short yydef[]= short yydef[]=
{ {
1, -2, 2, 0, 0, 0, 14, 3, 4, 0, 1, -2, 2, 0, 0, 0, 14, 3, 4, 0,
5, 0, 0, 12, 13, 0, 0, 0, 0, 10, 5, 0, 0, 12, 13, 0, 0, 0, 0, 10,
0, 6, 7, 8, 9, 11 0, 6, 7, 8, 9, 11
}; };
# define YYFLAG -1000 # define YYFLAG -1000
@ -774,7 +774,7 @@ int yychar = -1; /* current input token number */
int yynerrs = 0; /* number of errors */ int yynerrs = 0; /* number of errors */
short yyerrflag = 0; /* error recovery flag */ short yyerrflag = 0; /* error recovery flag */
yyparse() yyparse()
{ {
short yys[YYMAXDEPTH]; short yys[YYMAXDEPTH];
short yyj, yym; short yyj, yym;
@ -820,23 +820,23 @@ yyparse()
#ifdef YYDEBUG #ifdef YYDEBUG
printf("yyparse: yynewstate (1)\n"); printf("yyparse: yynewstate (1)\n");
#endif #endif
if( yychar<0 ) if( (yychar=yylex())<0 ) yychar=0; if( yychar<0 ) if( (yychar=yylex())<0 ) yychar=0;
#ifdef YYDEBUG #ifdef YYDEBUG
printf("yyparse: yynewstate yyn=%d ",yyn); printf("yyparse: yynewstate yyn=%d ",yyn);
printchar("yychar",yychar); printchar("yychar",yychar);
#endif #endif
if( (yyn += yychar)<0 || yyn >= YYLAST ) goto yydefault; if( (yyn += yychar)<0 || yyn >= YYLAST ) goto yydefault;
#ifdef YYDEBUG #ifdef YYDEBUG
printf("yyparse: yynewstate (2)\n"); printf("yyparse: yynewstate (2)\n");
#endif #endif
if( yychk[ yyn=yyact[ yyn ] ] == yychar ) /* valid shift */ if( yychk[ yyn=yyact[ yyn ] ] == yychar ) /* valid shift */
{ {
yychar = -1; yychar = -1;
yyval = yylval; yyval = yylval;
yystate = yyn; yystate = yyn;
@ -872,9 +872,9 @@ yyparse()
#ifdef YYDEBUG #ifdef YYDEBUG
printf("yyparse: yyn=%d yyerrflag=%d\n",yyn,yyerrflag); printf("yyparse: yyn=%d yyerrflag=%d\n",yyn,yyerrflag);
#endif #endif
if( yyn == 0 ) /* error */ if( yyn == 0 ) /* error */
{ {
/* error ... attempt to resume parsing */ /* error ... attempt to resume parsing */
switch( yyerrflag ){ switch( yyerrflag ){
@ -942,65 +942,65 @@ yyparse()
yyn = yyr1[yyn]; yyn = yyr1[yyn];
yyj = yypgo[yyn] + *yyps + 1; yyj = yypgo[yyn] + *yyps + 1;
if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]]; if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]];
switch(yym) switch(yym)
{ {
case 4: case 4:
{ {
yyerrok; yyerrok;
} }
break; break;
case 5: case 5:
{ {
printf("[STORE]\n"); printf("[STORE]\n");
} }
break; break;
case 6: case 6:
{ {
printf("[ADD]\n"); printf("[ADD]\n");
} }
break; break;
case 7: case 7:
{ {
printf("[NEG]\n[ADD]\n"); printf("[NEG]\n[ADD]\n");
} }
break; break;
case 8: case 8:
{ {
printf("[MUL]\n"); printf("[MUL]\n");
} }
break; break;
case 9: case 9:
{ {
printf("[DIV]\n"); printf("[DIV]\n");
} }
break; break;
case 10: case 10:
{ {
printf("[NEG]\n"); printf("[NEG]\n");
} }
break; break;
case 12: case 12:
{ {
printf("[LOAD]\n"); printf("[LOAD]\n");
} }
break; break;
case 13: case 13:
{ {
printf("[PUSH %s]\n", yytext); printf("[PUSH %s]\n", yytext);
} }
break; break;
case 14: case 14:
{ {
printf("[%s]\n", yytext); printf("[%s]\n", yytext);
} }
break; break;
} }
goto yystack; /* stack new state and value */ goto yystack; /* stack new state and value */
} }
int yywrap() int yywrap()
{ {
return 1; return 1;
} }

View File

@ -8,9 +8,9 @@
#include <stdio.h> #include <stdio.h>
# define YYTYPE char # define YYTYPE char
struct yywork struct yywork
{ {
YYTYPE verify, advance; YYTYPE verify, advance;
} yycrank[] = } yycrank[] =
{ {
{0,0}, {0,0}, {1,3}, {0,0}, {0,0}, {0,0}, {1,3}, {0,0},
@ -22,12 +22,12 @@ struct yywork
{0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0},
{0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0},
{0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0},
{0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0},
{0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0},
{0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0},
{0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0},
{0,0}, {1,5}, {5,7}, {5,7}, {0,0}, {1,5}, {5,7}, {5,7},
{5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7},
{5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7}, {5,7},
@ -37,17 +37,17 @@ struct yywork
{6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8},
{6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8},
{6,8}, {0,0}, {0,0}, {0,0}, {6,8}, {0,0}, {0,0}, {0,0},
{0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0},
{6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8},
{6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8},
{6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8},
{6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8},
{6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8},
{6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8},
{6,8}, {6,8}, {0,0}, {0,0}, {6,8}, {6,8}, {0,0}, {0,0},
{0,0}, {0,0}, {6,8}, {0,0}, {0,0}, {0,0}, {6,8}, {0,0},
{6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8},
{6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8}, {6,8},
@ -90,7 +90,7 @@ int yyvstop[] =
0,4,0,3,4,0,2,4,0,1,4,0,2,0,1,0,0 0,4,0,3,4,0,2,4,0,1,4,0,2,0,1,0,0
}; };
struct yysvf struct yysvf
{ {
struct yywork *yystoff; struct yywork *yystoff;
struct yysvf *yyother; struct yysvf *yyother;
@ -157,7 +157,7 @@ void subtest3(void)
yyt=yycrank; yyt=yycrank;
yystate=yysvec; yystate=yysvec;
bogus(); bogus();
if(yyt <= yytop && yyt->verify+yysvec == yystate) if(yyt <= yytop && yyt->verify+yysvec == yystate)
{ {
@ -173,7 +173,7 @@ void subtest3(void)
short yyr2[]= short yyr2[]=
{ {
0, 0, 2, 3, 3, 3, 3, 3, 3, 3, 0, 0, 2, 3, 3, 3, 3, 3, 3, 3,
2, 3, 1, 1, 1 2, 3, 1, 1, 1
}; };
// yyps -= yyr2[yyn]; // yyps -= yyr2[yyn];

View File

@ -8,7 +8,7 @@ long rhs;
int test(void) int test(void)
{ {
/* the whole lhs is errorneously treated as an absolute address (integer /* the whole lhs is errorneously treated as an absolute address (integer
constant) neglecting its dereference */ constant) neglecting its dereference */
return *(char *)0xD77C + rhs; return *(char *)0xD77C + rhs;
} }

View File

@ -41,7 +41,7 @@ void dotest1(void)
StructArray1[0] = test1; StructArray1[0] = test1;
printf ("test1: %d, %d, %d, %d, %d\n", printf ("test1: %d, %d, %d, %d, %d\n",
(int)StructArray1[0].a, (int)StructArray1[0].b, (int)StructArray1[0].c, (int)StructArray1[0].a, (int)StructArray1[0].b, (int)StructArray1[0].c,
(int)StructArray1[0].d, (int)StructArray1[0].e); (int)StructArray1[0].d, (int)StructArray1[0].e);
if ((StructArray1[0].a != 42) || if ((StructArray1[0].a != 42) ||
@ -62,7 +62,7 @@ void dotest2(void)
StructArray2[0] = test2; StructArray2[0] = test2;
printf ("test2: %d, %d, %d, %d, %d\n", printf ("test2: %d, %d, %d, %d, %d\n",
(int)StructArray2[0].a, (int)StructArray2[0].b, (int)StructArray2[0].a, (int)StructArray2[0].b,
(int)StructArray2[0].c, (int)StructArray2[0].d); (int)StructArray2[0].c, (int)StructArray2[0].d);
if ((StructArray2[0].a != 42) || if ((StructArray2[0].a != 42) ||

View File

@ -1,5 +1,5 @@
/* bug #1181 - Testing struct member against NULL is broken */ /* bug #1181 - Testing struct member against NULL is broken */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -52,7 +52,7 @@ MENUITEM optionsitems_menu[] = {
static MENU optionsmenu_menu = { static MENU optionsmenu_menu = {
&optionsitems_menu[0], &optionsitems_menu[0],
}; };
unsigned char __fastcall__ menu_getnumitems(MENU *menu) unsigned char __fastcall__ menu_getnumitems(MENU *menu)
{ {

View File

@ -1,5 +1,5 @@
/* Issue #1438 fix #1439 - crash in cc65, related to delayed post-counting /* Issue #1438 fix #1439 - crash in cc65, related to delayed post-counting
this is an odd issue, the compile would crash *sometimes*, perhaps in one this is an odd issue, the compile would crash *sometimes*, perhaps in one
of ten compilation runs. of ten compilation runs.

View File

@ -23,7 +23,7 @@ int execute(TREPTR argt, int execflg, int *pf1, int *pf2)
{ {
register TREPTR t; register TREPTR t;
int type; int type;
switch (type) switch (type)
{ {
case 6: case 6:
{ {

View File

@ -70,7 +70,7 @@ call5 (unsigned int k)
return (k); return (k);
} }
unsigned char unsigned char
call6a(unsigned char uc) call6a(unsigned char uc)
{ {
if(uc>uchar1) if(uc>uchar1)
@ -85,7 +85,7 @@ call6(unsigned char uc)
return(call6a(uc)); return(call6a(uc));
} }
unsigned int unsigned int
call7a(unsigned int ui) call7a(unsigned int ui)
{ {
if(ui) if(ui)

View File

@ -59,7 +59,7 @@ void c_char_gte_lit1(unsigned char expected_result)
if(char0 >= 0x7e) if(char0 >= 0x7e)
result |= 0x10; result |= 0x10;
if(char0 >= 0x7f) if(char0 >= 0x7f)
result |= 0x20; result |= 0x20;
@ -138,10 +138,10 @@ void c_int_gte_lit1(unsigned char expected_result)
if(int0 >= 0x0101) if(int0 >= 0x0101)
result |= 0x10; result |= 0x10;
if(int0 >= 0x01ff) if(int0 >= 0x01ff)
result |= 0x20; result |= 0x20;
if(int0 >= 0x0200) if(int0 >= 0x0200)
result |= 0x40; result |= 0x40;
@ -226,10 +226,10 @@ void c_int_gte_lit2(unsigned char expected_result)
if(int0 >= -0x0101) if(int0 >= -0x0101)
result |= 0x10; result |= 0x10;
if(int0 >= -0x0100) if(int0 >= -0x0100)
result |= 0x20; result |= 0x20;
if(int0 >= -0xff) if(int0 >= -0xff)
result |= 0x40; result |= 0x40;

View File

@ -284,7 +284,7 @@ void c_ifelse1(void)
void c_minus1(void) void c_minus1(void)
{ {
printf("long0:%ld long1:%ld\n",long0,long1); printf("long0:%ld long1:%ld\n",long0,long1);
printf("(long0 != -1)\n"); printf("(long0 != -1)\n");
if(long0 != -1) if(long0 != -1)
{ {
@ -432,7 +432,7 @@ main (void)
success = failures; success = failures;
done (); done ();
printf("failures: %d\n",failures); printf("failures: %d\n",failures);
return failures; return failures;

View File

@ -60,7 +60,7 @@ void c_char(void)
if(char1 || !char0) if(char1 || !char0)
failures++; failures++;
if((char0 >5 ) && (char0 < 10)) if((char0 >5 ) && (char0 < 10))
failures++; failures++;
char0 +=5; /* char0 = 6 now */ char0 +=5; /* char0 = 6 now */
@ -100,7 +100,7 @@ void c_int(void)
if(int1 || !int0) if(int1 || !int0)
failures++; failures++;
if((int0 >5 ) && (int0 < 10)) if((int0 >5 ) && (int0 < 10))
failures++; failures++;
int0 +=5; /* int0 = 6 now */ int0 +=5; /* int0 = 6 now */
@ -140,7 +140,7 @@ void c_long(void)
if(long1 || !long0) if(long1 || !long0)
failures++; failures++;
if((long0 >5 ) && (long0 < 10)) if((long0 >5 ) && (long0 < 10))
failures++; failures++;
long0 +=5; /* long0 = 6 now */ long0 +=5; /* long0 = 6 now */

View File

@ -129,10 +129,10 @@ void c_int_lt_lit1(unsigned char expected_result)
if(int0 < 0x0101) if(int0 < 0x0101)
result |= 0x10; result |= 0x10;
if(int0 < 0x01ff) if(int0 < 0x01ff)
result |= 0x20; result |= 0x20;
if(int0 < 0x0200) if(int0 < 0x0200)
result |= 0x40; result |= 0x40;
@ -214,10 +214,10 @@ void c_int_lt_lit2(unsigned char expected_result)
if(int0 < -0x0101) if(int0 < -0x0101)
result |= 0x10; result |= 0x10;
if(int0 < -0x0100) if(int0 < -0x0100)
result |= 0x20; result |= 0x20;
if(int0 < -0xff) if(int0 < -0xff)
result |= 0x40; result |= 0x40;

View File

@ -59,10 +59,10 @@ void c_char_gt_lit1(unsigned char expected_result)
if(char0 > 0x7e) if(char0 > 0x7e)
result |= 0x10; result |= 0x10;
if(char0 > 0x7f) if(char0 > 0x7f)
result |= 0x20; result |= 0x20;
if(result != expected_result) if(result != expected_result)
failures++; failures++;
} }
@ -132,10 +132,10 @@ void c_int_gt_lit1(unsigned char expected_result)
if(int0 > 0x0101) if(int0 > 0x0101)
result |= 0x10; result |= 0x10;
if(int0 > 0x01ff) if(int0 > 0x01ff)
result |= 0x20; result |= 0x20;
if(int0 > 0x0200) if(int0 > 0x0200)
result |= 0x40; result |= 0x40;
@ -220,10 +220,10 @@ void c_int_gt_lit2(unsigned char expected_result)
if(int0 > -0x0101) if(int0 > -0x0101)
result |= 0x10; result |= 0x10;
if(int0 > -0x0100) if(int0 > -0x0100)
result |= 0x20; result |= 0x20;
if(int0 > -0xff) if(int0 > -0xff)
result |= 0x40; result |= 0x40;

View File

@ -54,7 +54,7 @@ void c_char_lte_lit1(unsigned char expected_result)
if(char0 <= 0x7f) if(char0 <= 0x7f)
result |= 0x10; result |= 0x10;
if(result != expected_result) if(result != expected_result)
failures++; failures++;
} }
@ -124,10 +124,10 @@ void c_int_lte_lit1(unsigned char expected_result)
if(int0 <= 0x0101) if(int0 <= 0x0101)
result |= 0x10; result |= 0x10;
if(int0 <= 0x01ff) if(int0 <= 0x01ff)
result |= 0x20; result |= 0x20;
if(int0 <= 0x0200) if(int0 <= 0x0200)
result |= 0x40; result |= 0x40;
@ -209,10 +209,10 @@ void c_int_lte_lit2(unsigned char expected_result)
if(int0 <= -0x0101) if(int0 <= -0x0101)
result |= 0x10; result |= 0x10;
if(int0 <= -0x0100) if(int0 <= -0x0100)
result |= 0x20; result |= 0x20;
if(int0 <= -0xff) if(int0 <= -0xff)
result |= 0x40; result |= 0x40;

View File

@ -8,7 +8,7 @@ if they are being compiled/evaluated correctly.
related: related:
pr #1424 - More compile-time constant expressions regarding object addresses pr #1424 - More compile-time constant expressions regarding object addresses
issue #1196 - Constant expressions in general issue #1196 - Constant expressions in general
*/ */

View File

@ -125,7 +125,7 @@ int main(int n,char **args) {
int j; int j;
static struct defs d0, *pd0; static struct defs d0, *pd0;
d0.flgs = 1; /* These flags dictate */ d0.flgs = 1; /* These flags dictate */
d0.flgm = 1; /* the verbosity of */ d0.flgm = 1; /* the verbosity of */
d0.flgd = 1; /* the program. */ d0.flgd = 1; /* the program. */

View File

@ -267,7 +267,7 @@ int main(int n,char **args) {
int j; int j;
static struct defs d0, *pd0; static struct defs d0, *pd0;
d0.flgs = 1; /* These flags dictate */ d0.flgs = 1; /* These flags dictate */
d0.flgm = 1; /* the verbosity of */ d0.flgm = 1; /* the verbosity of */
d0.flgd = 1; /* the program. */ d0.flgd = 1; /* the program. */

View File

@ -245,7 +245,7 @@ int main(int n,char **args) {
int j; int j;
static struct defs d0, *pd0; static struct defs d0, *pd0;
d0.flgs = 1; /* These flags dictate */ d0.flgs = 1; /* These flags dictate */
d0.flgm = 1; /* the verbosity of */ d0.flgm = 1; /* the verbosity of */
d0.flgd = 1; /* the program. */ d0.flgd = 1; /* the program. */

View File

@ -140,7 +140,7 @@ int main(int n,char **args) {
int j; int j;
static struct defs d0, *pd0; static struct defs d0, *pd0;
d0.flgs = 1; /* These flags dictate */ d0.flgs = 1; /* These flags dictate */
d0.flgm = 1; /* the verbosity of */ d0.flgm = 1; /* the verbosity of */
d0.flgd = 1; /* the program. */ d0.flgd = 1; /* the program. */

View File

@ -152,7 +152,7 @@ int main(int n,char **args) {
int j; int j;
static struct defs d0, *pd0; static struct defs d0, *pd0;
d0.flgs = 1; /* These flags dictate */ d0.flgs = 1; /* These flags dictate */
d0.flgm = 1; /* the verbosity of */ d0.flgm = 1; /* the verbosity of */
d0.flgd = 1; /* the program. */ d0.flgd = 1; /* the program. */

View File

@ -197,7 +197,7 @@ int main(int n,char **args) {
int j; int j;
static struct defs d0, *pd0; static struct defs d0, *pd0;
d0.flgs = 1; /* These flags dictate */ d0.flgs = 1; /* These flags dictate */
d0.flgm = 1; /* the verbosity of */ d0.flgm = 1; /* the verbosity of */
d0.flgd = 1; /* the program. */ d0.flgd = 1; /* the program. */

View File

@ -344,7 +344,7 @@ int main(int n,char **args) {
int j; int j;
static struct defs d0, *pd0; static struct defs d0, *pd0;
d0.flgs = 1; /* These flags dictate */ d0.flgs = 1; /* These flags dictate */
d0.flgm = 1; /* the verbosity of */ d0.flgm = 1; /* the verbosity of */
d0.flgd = 1; /* the program. */ d0.flgd = 1; /* the program. */

View File

@ -167,7 +167,7 @@ int main(int n,char **args) {
int j; int j;
static struct defs d0, *pd0; static struct defs d0, *pd0;
d0.flgs = 1; /* These flags dictate */ d0.flgs = 1; /* These flags dictate */
d0.flgm = 1; /* the verbosity of */ d0.flgm = 1; /* the verbosity of */
d0.flgd = 1; /* the program. */ d0.flgd = 1; /* the program. */

View File

@ -318,7 +318,7 @@ int main(int n,char **args) {
int j; int j;
static struct defs d0, *pd0; static struct defs d0, *pd0;
d0.flgs = 1; /* These flags dictate */ d0.flgs = 1; /* These flags dictate */
d0.flgm = 1; /* the verbosity of */ d0.flgm = 1; /* the verbosity of */
d0.flgd = 1; /* the program. */ d0.flgd = 1; /* the program. */

View File

@ -221,7 +221,7 @@ int main(int n,char **args) {
int j; int j;
static struct defs d0, *pd0; static struct defs d0, *pd0;
d0.flgs = 1; /* These flags dictate */ d0.flgs = 1; /* These flags dictate */
d0.flgm = 1; /* the verbosity of */ d0.flgm = 1; /* the verbosity of */
d0.flgd = 1; /* the program. */ d0.flgd = 1; /* the program. */

View File

@ -1776,7 +1776,7 @@ int main(int n,char **args) {
int j; int j;
static struct defs d0, *pd0; static struct defs d0, *pd0;
d0.flgs = 1; /* These flags dictate */ d0.flgs = 1; /* These flags dictate */
d0.flgm = 1; /* the verbosity of */ d0.flgm = 1; /* the verbosity of */
d0.flgd = 1; /* the program. */ d0.flgd = 1; /* the program. */

View File

@ -997,7 +997,7 @@ int main(int n,char **args) {
int j; int j;
static struct defs d0, *pd0; static struct defs d0, *pd0;
d0.flgs = 1; /* These flags dictate */ d0.flgs = 1; /* These flags dictate */
d0.flgm = 1; /* the verbosity of */ d0.flgm = 1; /* the verbosity of */
d0.flgd = 1; /* the program. */ d0.flgd = 1; /* the program. */

View File

@ -132,7 +132,7 @@ int main(int n,char **args) {
int j; int j;
static struct defs d0, *pd0; static struct defs d0, *pd0;
d0.flgs = 1; /* These flags dictate */ d0.flgs = 1; /* These flags dictate */
d0.flgm = 1; /* the verbosity of */ d0.flgm = 1; /* the verbosity of */
d0.flgd = 1; /* the program. */ d0.flgd = 1; /* the program. */

View File

@ -326,7 +326,7 @@ int main(int n,char **args) {
int j; int j;
static struct defs d0, *pd0; static struct defs d0, *pd0;
d0.flgs = 1; /* These flags dictate */ d0.flgs = 1; /* These flags dictate */
d0.flgm = 1; /* the verbosity of */ d0.flgm = 1; /* the verbosity of */
d0.flgd = 1; /* the program. */ d0.flgd = 1; /* the program. */

View File

@ -362,7 +362,7 @@ int main(int n,char **args) {
int j; int j;
static struct defs d0, *pd0; static struct defs d0, *pd0;
d0.flgs = 1; /* These flags dictate */ d0.flgs = 1; /* These flags dictate */
d0.flgm = 1; /* the verbosity of */ d0.flgm = 1; /* the verbosity of */
d0.flgd = 1; /* the program. */ d0.flgd = 1; /* the program. */

View File

@ -708,7 +708,7 @@ int main(int n,char **args) {
int j; int j;
static struct defs d0, *pd0; static struct defs d0, *pd0;
d0.flgs = 1; /* These flags dictate */ d0.flgs = 1; /* These flags dictate */
d0.flgm = 1; /* the verbosity of */ d0.flgm = 1; /* the verbosity of */
d0.flgd = 1; /* the program. */ d0.flgd = 1; /* the program. */

View File

@ -249,7 +249,7 @@ int main(int n,char **args) {
int j; int j;
static struct defs d0, *pd0; static struct defs d0, *pd0;
d0.flgs = 1; /* These flags dictate */ d0.flgs = 1; /* These flags dictate */
d0.flgm = 1; /* the verbosity of */ d0.flgm = 1; /* the verbosity of */
d0.flgd = 1; /* the program. */ d0.flgd = 1; /* the program. */

View File

@ -294,7 +294,7 @@ int main(int n,char **args) {
int j; int j;
static struct defs d0, *pd0; static struct defs d0, *pd0;
d0.flgs = 1; /* These flags dictate */ d0.flgs = 1; /* These flags dictate */
d0.flgm = 1; /* the verbosity of */ d0.flgm = 1; /* the verbosity of */
d0.flgd = 1; /* the program. */ d0.flgd = 1; /* the program. */

View File

@ -209,7 +209,7 @@ int main(int n,char **args) {
int j; int j;
static struct defs d0, *pd0; static struct defs d0, *pd0;
d0.flgs = 1; /* These flags dictate */ d0.flgs = 1; /* These flags dictate */
d0.flgm = 1; /* the verbosity of */ d0.flgm = 1; /* the verbosity of */
d0.flgd = 1; /* the program. */ d0.flgd = 1; /* the program. */

View File

@ -165,7 +165,7 @@ int main(int n,char **args) {
int j; int j;
static struct defs d0, *pd0; static struct defs d0, *pd0;
d0.flgs = 1; /* These flags dictate */ d0.flgs = 1; /* These flags dictate */
d0.flgm = 1; /* the verbosity of */ d0.flgm = 1; /* the verbosity of */
d0.flgd = 1; /* the program. */ d0.flgd = 1; /* the program. */

View File

@ -1,6 +1,6 @@
/* /*
!!DESCRIPTION!! Implementation of Duff's device (loop unrolling). !!DESCRIPTION!! Implementation of Duff's device (loop unrolling).
!!ORIGIN!! !!ORIGIN!!
!!LICENCE!! GPL, read COPYING.GPL !!LICENCE!! GPL, read COPYING.GPL
*/ */
@ -34,7 +34,7 @@ int acmp(char* a, char* b, int count)
return 0; return 0;
} }
void duffit (char* to, char* from, int count) void duffit (char* to, char* from, int count)
{ {
int n = (count + 7) / 8; int n = (count + 7) / 8;
@ -55,14 +55,14 @@ int main(void)
{ {
char a[ASIZE] = {1}; char a[ASIZE] = {1};
char b[ASIZE] = {2}; char b[ASIZE] = {2};
/* a and b should be different */ /* a and b should be different */
if(!acmp(a, b, ASIZE)) { if(!acmp(a, b, ASIZE)) {
failures++; failures++;
} }
duffit(a, b, ASIZE); duffit(a, b, ASIZE);
/* a and b should be the same */ /* a and b should be the same */
if(acmp(a, b, ASIZE)) { if(acmp(a, b, ASIZE)) {
failures++; failures++;

View File

@ -16,7 +16,7 @@
#define NUMTESTS 257 #define NUMTESTS 257
typedef struct typedef struct
{ {
bool isalnum; bool isalnum;
bool isalpha; bool isalpha;
@ -30,7 +30,7 @@ typedef struct
bool isspace; bool isspace;
bool isupper; bool isupper;
bool isxdigit; bool isxdigit;
bool isblank; bool isblank;
} CTypeClassifications; } CTypeClassifications;
@ -89,7 +89,7 @@ CTypeClassifications testSet[NUMTESTS] =
{false, false, true, false, false, true, false, true, true, false, false, false, false}, // 2D {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 2D
{false, false, true, false, false, true, false, true, true, false, false, false, false}, // 2E {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 2E
{false, false, true, false, false, true, false, true, true, false, false, false, false}, // 2F {false, false, true, false, false, true, false, true, true, false, false, false, false}, // 2F
{true, false, true, false, true, true, false, true, false, false, false, true, false}, // 30 {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 30
{true, false, true, false, true, true, false, true, false, false, false, true, false}, // 31 {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 31
{true, false, true, false, true, true, false, true, false, false, false, true, false}, // 32 {true, false, true, false, true, true, false, true, false, false, false, true, false}, // 32
@ -123,7 +123,7 @@ CTypeClassifications testSet[NUMTESTS] =
{true, true, true, false, false, true, false, true, false, false, true, false, false}, // 4D {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 4D
{true, true, true, false, false, true, false, true, false, false, true, false, false}, // 4E {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 4E
{true, true, true, false, false, true, false, true, false, false, true, false, false}, // 4F {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 4F
{true, true, true, false, false, true, false, true, false, false, true, false, false}, // 50 {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 50
{true, true, true, false, false, true, false, true, false, false, true, false, false}, // 51 {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 51
{true, true, true, false, false, true, false, true, false, false, true, false, false}, // 52 {true, true, true, false, false, true, false, true, false, false, true, false, false}, // 52

View File

@ -10,7 +10,7 @@ TEST
{ {
unsigned i, v; unsigned i, v;
char* p; char* p;
for (i=0; i < BufferSize; ++i) for (i=0; i < BufferSize; ++i)
Buffer[i+1] = (i%128); Buffer[i+1] = (i%128);
@ -35,7 +35,7 @@ TEST
ASSERT_AreEqual(i%128, (unsigned)Buffer[i+2], "%u", "Unexpected value in buffer at position %u!" COMMA i+2); ASSERT_AreEqual(i%128, (unsigned)Buffer[i+2], "%u", "Unexpected value in buffer at position %u!" COMMA i+2);
} }
v = Buffer[BufferSize+1]; // rember value of first untouched end-byte v = Buffer[BufferSize+1]; // rember value of first untouched end-byte
// copy downwards // copy downwards
p = memmove(Buffer+1, Buffer+2, BufferSize); p = memmove(Buffer+1, Buffer+2, BufferSize);

View File

@ -4,7 +4,7 @@
TEST TEST
{ {
unsigned i; unsigned i;
for (i=0; i < 256; ++i) for (i=0; i < 256; ++i)
{ {
ASSERT_AreEqual(i*20, mul20(i), "%u", "Invalid 'mul20(%u)' calculation!" COMMA i); ASSERT_AreEqual(i*20, mul20(i), "%u", "Invalid 'mul20(%u)' calculation!" COMMA i);

View File

@ -11,7 +11,7 @@ TEST
{ {
unsigned i,j; unsigned i,j;
char* p; char* p;
for (i=0; i < SourceStringSize; ++i) for (i=0; i < SourceStringSize; ++i)
SourceString[i] = (i%128)+1; SourceString[i] = (i%128)+1;
@ -23,13 +23,13 @@ TEST
DestinationString[0] = 0; DestinationString[0] = 0;
ASSERT_AreEqual(0, strlen(DestinationString), "%u", "Destination string initialization or 'strlen()' problem!"); ASSERT_AreEqual(0, strlen(DestinationString), "%u", "Destination string initialization or 'strlen()' problem!");
/* Test concatenation to empty buffer */ /* Test concatenation to empty buffer */
strcat(DestinationString, SourceString); strcat(DestinationString, SourceString);
ASSERT_AreEqual(SourceStringSize, strlen(DestinationString), "%u", "Unexpected string length while string concatenation to empty buffer!"); ASSERT_AreEqual(SourceStringSize, strlen(DestinationString), "%u", "Unexpected string length while string concatenation to empty buffer!");
/* Test concatenation to non empty buffer */ /* Test concatenation to non empty buffer */
p = strcat(DestinationString, SourceString); p = strcat(DestinationString, SourceString);

View File

@ -1,7 +1,7 @@
#include <string.h> #include <string.h>
#include "unittest.h" #include "unittest.h"
/* Test string. Must NOT have duplicate characters! */ /* Test string. Must NOT have duplicate characters! */
static char S[] = "Helo wrd!\n"; static char S[] = "Helo wrd!\n";

View File

@ -11,7 +11,7 @@ static char* TestChars="1234567890"; // we like to find numbe
TEST TEST
{ {
unsigned i; unsigned i;
for (i=0; i < EstimatedStringSize; ++i) for (i=0; i < EstimatedStringSize; ++i)
EstimatedString[i] = (i%26)+'A'; // put ABCD... into the string to be estimated EstimatedString[i] = (i%26)+'A'; // put ABCD... into the string to be estimated

View File

@ -11,7 +11,7 @@ TEST
{ {
unsigned i; unsigned i;
char* p; char* p;
for (i=0; i < SourceStringSize; ++i) for (i=0; i < SourceStringSize; ++i)
SourceString[i] = (i%128)+1; SourceString[i] = (i%128)+1;
@ -23,13 +23,13 @@ TEST
DestinationString[0] = 0; DestinationString[0] = 0;
ASSERT_AreEqual(0, strlen(DestinationString), "%u", "Destination string initialization or 'strlen()' problem!"); ASSERT_AreEqual(0, strlen(DestinationString), "%u", "Destination string initialization or 'strlen()' problem!");
/* Test "unlimted" concatenation to empty buffer */ /* Test "unlimted" concatenation to empty buffer */
strncat(DestinationString, SourceString, 1024); strncat(DestinationString, SourceString, 1024);
ASSERT_AreEqual(SourceStringSize, strlen(DestinationString), "%u", "Unexpected string length while string concatenation to empty buffer!"); ASSERT_AreEqual(SourceStringSize, strlen(DestinationString), "%u", "Unexpected string length while string concatenation to empty buffer!");
/* Test limited concatenation to non empty buffer */ /* Test limited concatenation to non empty buffer */
p = strncat(DestinationString, SourceString, 128); p = strncat(DestinationString, SourceString, 128);

View File

@ -1,6 +1,6 @@
#include <string.h> #include <string.h>
#include "unittest.h" #include "unittest.h"
static char TestString[] = "01234567890123456789"; // two times the same string static char TestString[] = "01234567890123456789"; // two times the same string
static char Found[256]; static char Found[256];

View File

@ -10,7 +10,7 @@ static char* TestChars="1234567890"; // we like to find numbe
TEST TEST
{ {
unsigned i; unsigned i;
for (i=0; i < EstimatedStringSize; ++i) for (i=0; i < EstimatedStringSize; ++i)
EstimatedString[i] = (i%10)+'0'; // put 0123... into the string to be estimated EstimatedString[i] = (i%10)+'0'; // put 0123... into the string to be estimated

View File

@ -48,23 +48,23 @@ void m2(unsigned char uc)
void m3(unsigned char uc) void m3(unsigned char uc)
{ {
volatile unsigned char vuc; volatile unsigned char vuc;
/* uchar = uchar * lit */ /* uchar = uchar * lit */
/* testing literal multiply with same source and destination */ /* testing literal multiply with same source and destination */
vuc = uc; vuc = uc;
uc2 = 0; uc2 = 0;
uc1 = vuc; uc1 = uc1*1; if( uc1 != (uc2+=TESTLIT) ) failures++; uc1 = vuc; uc1 = uc1*1; if( uc1 != (uc2+=TESTLIT) ) failures++;
uc1 = vuc; uc1 = uc1*2; if( uc1 != (uc2+=TESTLIT) ) failures++; uc1 = vuc; uc1 = uc1*2; if( uc1 != (uc2+=TESTLIT) ) failures++;
uc1 = vuc; uc1 = uc1*3; if( uc1 != (uc2+=TESTLIT) ) failures++; uc1 = vuc; uc1 = uc1*3; if( uc1 != (uc2+=TESTLIT) ) failures++;
uc1 = vuc; uc1 = uc1*4; if( uc1 != (uc2+=TESTLIT) ) failures++; uc1 = vuc; uc1 = uc1*4; if( uc1 != (uc2+=TESTLIT) ) failures++;
uc1 = vuc; uc1 = uc1*5; if( uc1 != (uc2+=TESTLIT) ) failures++; uc1 = vuc; uc1 = uc1*5; if( uc1 != (uc2+=TESTLIT) ) failures++;
uc1 = vuc; uc1 = uc1*6; if( uc1 != (uc2+=TESTLIT) ) failures++; uc1 = vuc; uc1 = uc1*6; if( uc1 != (uc2+=TESTLIT) ) failures++;
uc1 = vuc; uc1 = uc1*7; if( uc1 != (uc2+=TESTLIT) ) failures++; uc1 = vuc; uc1 = uc1*7; if( uc1 != (uc2+=TESTLIT) ) failures++;
uc1 = vuc; uc1 = uc1*8; if( uc1 != (uc2+=TESTLIT) ) failures++; uc1 = vuc; uc1 = uc1*8; if( uc1 != (uc2+=TESTLIT) ) failures++;
uc1 = vuc; uc1 = uc1*9; if( uc1 != (uc2+=TESTLIT) ) failures++; uc1 = vuc; uc1 = uc1*9; if( uc1 != (uc2+=TESTLIT) ) failures++;
uc1 = vuc; uc1 = uc1*10; if( uc1 != (uc2+=TESTLIT) ) failures++; uc1 = vuc; uc1 = uc1*10; if( uc1 != (uc2+=TESTLIT) ) failures++;
uc1 = vuc; uc1 = uc1*11; if( uc1 != (uc2+=TESTLIT) ) failures++; uc1 = vuc; uc1 = uc1*11; if( uc1 != (uc2+=TESTLIT) ) failures++;
uc1 = vuc; uc1 = uc1*12; if( uc1 != (uc2+=TESTLIT) ) failures++; uc1 = vuc; uc1 = uc1*12; if( uc1 != (uc2+=TESTLIT) ) failures++;
uc1 = vuc; uc1 = uc1*13; if( uc1 != (uc2+=TESTLIT) ) failures++; uc1 = vuc; uc1 = uc1*13; if( uc1 != (uc2+=TESTLIT) ) failures++;
uc1 = vuc; uc1 = uc1*14; if( uc1 != (uc2+=TESTLIT) ) failures++; uc1 = vuc; uc1 = uc1*14; if( uc1 != (uc2+=TESTLIT) ) failures++;
uc1 = vuc; uc1 = uc1*15; if( uc1 != (uc2+=TESTLIT) ) failures++; uc1 = vuc; uc1 = uc1*15; if( uc1 != (uc2+=TESTLIT) ) failures++;
@ -75,17 +75,17 @@ void m3(unsigned char uc)
uc1 = vuc; uc1 = uc1*20; if( uc1 != (uc2+=TESTLIT) ) failures++; uc1 = vuc; uc1 = uc1*20; if( uc1 != (uc2+=TESTLIT) ) failures++;
uc1 = vuc; uc1 = uc1*21; if( uc1 != (uc2+=TESTLIT) ) failures++; uc1 = vuc; uc1 = uc1*21; if( uc1 != (uc2+=TESTLIT) ) failures++;
uc1 = vuc; uc1 = uc1*22; if( uc1 != (uc2+=TESTLIT) ) failures++; uc1 = vuc; uc1 = uc1*22; if( uc1 != (uc2+=TESTLIT) ) failures++;
uc1 = vuc; uc1 = uc1*23; if( uc1 != (uc2+=TESTLIT) ) failures++; uc1 = vuc; uc1 = uc1*23; if( uc1 != (uc2+=TESTLIT) ) failures++;
uc1 = vuc; uc1 = uc1*24; if( uc1 != (uc2+=TESTLIT) ) failures++; uc1 = vuc; uc1 = uc1*24; if( uc1 != (uc2+=TESTLIT) ) failures++;
uc1 = vuc; uc1 = uc1*31; if( uc1 != ((31*TESTLIT) & 0xff) ) failures++; uc1 = vuc; uc1 = uc1*31; if( uc1 != ((31*TESTLIT) & 0xff) ) failures++;
uc1 = vuc; uc1 = uc1*32; if( uc1 != ((32*TESTLIT) & 0xff) ) failures++; uc1 = vuc; uc1 = uc1*32; if( uc1 != ((32*TESTLIT) & 0xff) ) failures++;
uc1 = vuc; uc1 = uc1*64; if( uc1 != ((64*TESTLIT) & 0xff) ) failures++; uc1 = vuc; uc1 = uc1*64; if( uc1 != ((64*TESTLIT) & 0xff) ) failures++;
uc1 = vuc; uc1 = uc1*128;if( uc1 != ((128*TESTLIT)& 0xff) ) failures++; uc1 = vuc; uc1 = uc1*128;if( uc1 != ((128*TESTLIT)& 0xff) ) failures++;
/* testing literal multiply with different source and destination */ /* testing literal multiply with different source and destination */
uc1 = vuc*1; if( uc1 != ((1*TESTLIT) & 0xff) ) failures++; uc1 = vuc*1; if( uc1 != ((1*TESTLIT) & 0xff) ) failures++;
uc1 = vuc*2; if( uc1 != ((2*TESTLIT) & 0xff) ) failures++; uc1 = vuc*2; if( uc1 != ((2*TESTLIT) & 0xff) ) failures++;
uc1 = vuc*4; if( uc1 != ((4*TESTLIT) & 0xff) ) failures++; uc1 = vuc*4; if( uc1 != ((4*TESTLIT) & 0xff) ) failures++;
} }

View File

@ -57,23 +57,23 @@ void or_lit2uint(void)
failures++; failures++;
uint0 |= 1; uint0 |= 1;
if(uint0 != 1) if(uint0 != 1)
failures++; failures++;
uint0 |= 2; uint0 |= 2;
if(uint0 != 3) if(uint0 != 3)
failures++; failures++;
uint0 |= 0x100; uint0 |= 0x100;
if(uint0 != 0x103) if(uint0 != 0x103)
failures++; failures++;
uint0 |= 0x102; uint0 |= 0x102;
if(uint0 != 0x103) if(uint0 != 0x103)
failures++; failures++;
uint0 |= 0x303; uint0 |= 0x303;
if(uint0 != 0x303) if(uint0 != 0x303)
failures++; failures++;
} }
@ -83,27 +83,27 @@ void or_lit2ulong(void)
failures++; failures++;
ulong0 |= 1; ulong0 |= 1;
if(ulong0 != 1) if(ulong0 != 1)
failures++; failures++;
ulong0 |= 2; ulong0 |= 2;
if(ulong0 != 3) if(ulong0 != 3)
failures++; failures++;
ulong0 |= 0x100; ulong0 |= 0x100;
if(ulong0 != 0x103) if(ulong0 != 0x103)
failures++; failures++;
ulong0 |= 0x102; ulong0 |= 0x102;
if(ulong0 != 0x103) if(ulong0 != 0x103)
failures++; failures++;
ulong0 |= 0x303; ulong0 |= 0x303;
if(ulong0 != 0x303) if(ulong0 != 0x303)
failures++; failures++;
ulong0 |= 0x80000000; ulong0 |= 0x80000000;
if(ulong0 != 0x80000303) if(ulong0 != 0x80000303)
failures++; failures++;
} }

View File

@ -2,12 +2,12 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifdef __C64__ #ifdef __C64__
#include <conio.h> #include <conio.h>
#endif #endif
/* apparently we dont trigger the bug when not using absolute addresses? */ /* apparently we dont trigger the bug when not using absolute addresses? */
#ifdef __C64__ #ifdef __C64__
#define TARGETMEM 0x4c8 #define TARGETMEM 0x4c8
#define SOURCEMEM 0x702 #define SOURCEMEM 0x702
#elif __SIM6502__ #elif __SIM6502__
@ -27,9 +27,9 @@ static unsigned char mem[0x10];
static unsigned short u16w = 3; static unsigned short u16w = 3;
static unsigned short u16r = 5; static unsigned short u16r = 5;
static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 }; static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 };
static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf }; static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf };
static unsigned char expect[8] = { 0x0, 0x1, 0xc, 0xd, 0x4, 0x5, 0x6, 0x7 }; static unsigned char expect[8] = { 0x0, 0x1, 0xc, 0xd, 0x4, 0x5, 0x6, 0x7 };
static unsigned char i; static unsigned char i;
static unsigned char err = EXIT_SUCCESS; static unsigned char err = EXIT_SUCCESS;
@ -41,17 +41,17 @@ void test1(void)
void dotest(void) void dotest(void)
{ {
memcpy(TARGETMEM, target, 8); memcpy(TARGETMEM, target, 8);
memcpy(SOURCEMEM, source, 8); memcpy(SOURCEMEM, source, 8);
test1(); test1();
memcpy(target, TARGETMEM, 8); memcpy(target, TARGETMEM, 8);
memcpy(source, SOURCEMEM, 8); memcpy(source, SOURCEMEM, 8);
#ifdef __C64__ #ifdef __C64__
clrscr(); clrscr();
#endif #endif
printf("source:"); printf("source:");
for(i = 0; i < 8; ++i) { for(i = 0; i < 8; ++i) {
printf("%0x ", source[i]); printf("%0x ", source[i]);
@ -61,13 +61,13 @@ void dotest(void)
printf("%0x ", target[i]); printf("%0x ", target[i]);
} }
printf("\n\r"); printf("\n\r");
printf("u16w: %d\n\r", u16w); printf("u16w: %d\n\r", u16w);
printf("u16r: %d\n\r", u16r); printf("u16r: %d\n\r", u16r);
} }
int main(void) int main(void)
{ {
dotest(); dotest();
dotest(); dotest();

View File

@ -2,12 +2,12 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifdef __C64__ #ifdef __C64__
#include <conio.h> #include <conio.h>
#endif #endif
/* apparently we dont trigger the bug when not using absolute addresses? */ /* apparently we dont trigger the bug when not using absolute addresses? */
#ifdef __C64__ #ifdef __C64__
#define TARGETMEM 0x4c8 #define TARGETMEM 0x4c8
#define SOURCEMEM 0x702 #define SOURCEMEM 0x702
#elif __SIM6502__ #elif __SIM6502__
@ -27,9 +27,9 @@ static unsigned char mem[0x10];
static unsigned short u16w = 3; static unsigned short u16w = 3;
static unsigned char u8r = 5; static unsigned char u8r = 5;
static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 }; static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 };
static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf }; static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf };
static unsigned char expect[8] = { 0x0, 0x1, 0xc, 0xd, 0x4, 0x5, 0x6, 0x7 }; static unsigned char expect[8] = { 0x0, 0x1, 0xc, 0xd, 0x4, 0x5, 0x6, 0x7 };
static unsigned char i; static unsigned char i;
static unsigned char err = EXIT_SUCCESS; static unsigned char err = EXIT_SUCCESS;
@ -41,17 +41,17 @@ void test1(void)
void dotest(void) void dotest(void)
{ {
memcpy(TARGETMEM, target, 8); memcpy(TARGETMEM, target, 8);
memcpy(SOURCEMEM, source, 8); memcpy(SOURCEMEM, source, 8);
test1(); test1();
memcpy(target, TARGETMEM, 8); memcpy(target, TARGETMEM, 8);
memcpy(source, SOURCEMEM, 8); memcpy(source, SOURCEMEM, 8);
#ifdef __C64__ #ifdef __C64__
clrscr(); clrscr();
#endif #endif
printf("source:"); printf("source:");
for(i = 0; i < 8; ++i) { for(i = 0; i < 8; ++i) {
printf("%0x ", source[i]); printf("%0x ", source[i]);
@ -61,13 +61,13 @@ void dotest(void)
printf("%0x ", target[i]); printf("%0x ", target[i]);
} }
printf("\n\r"); printf("\n\r");
printf("u16w: %d\n\r", u16w); printf("u16w: %d\n\r", u16w);
printf("u8r: %d\n\r", u8r); printf("u8r: %d\n\r", u8r);
} }
int main(void) int main(void)
{ {
dotest(); dotest();
dotest(); dotest();

View File

@ -2,12 +2,12 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifdef __C64__ #ifdef __C64__
#include <conio.h> #include <conio.h>
#endif #endif
/* apparently we dont trigger the bug when not using absolute addresses? */ /* apparently we dont trigger the bug when not using absolute addresses? */
#ifdef __C64__ #ifdef __C64__
#define TARGETMEM 0x4c8 #define TARGETMEM 0x4c8
#define SOURCEMEM 0x702 #define SOURCEMEM 0x702
#elif __SIM6502__ #elif __SIM6502__
@ -27,9 +27,9 @@ static unsigned char mem[0x10];
static unsigned char u8w = 3; static unsigned char u8w = 3;
static unsigned short u16r = 5; static unsigned short u16r = 5;
static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 }; static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 };
static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf }; static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf };
static unsigned char expect[8] = { 0x0, 0x1, 0xc, 0xd, 0x4, 0x5, 0x6, 0x7 }; static unsigned char expect[8] = { 0x0, 0x1, 0xc, 0xd, 0x4, 0x5, 0x6, 0x7 };
static unsigned char i; static unsigned char i;
static unsigned char err = EXIT_SUCCESS; static unsigned char err = EXIT_SUCCESS;
@ -41,17 +41,17 @@ void test1(void)
void dotest(void) void dotest(void)
{ {
memcpy(TARGETMEM, target, 8); memcpy(TARGETMEM, target, 8);
memcpy(SOURCEMEM, source, 8); memcpy(SOURCEMEM, source, 8);
test1(); test1();
memcpy(target, TARGETMEM, 8); memcpy(target, TARGETMEM, 8);
memcpy(source, SOURCEMEM, 8); memcpy(source, SOURCEMEM, 8);
#ifdef __C64__ #ifdef __C64__
clrscr(); clrscr();
#endif #endif
printf("source:"); printf("source:");
for(i = 0; i < 8; ++i) { for(i = 0; i < 8; ++i) {
printf("%0x ", source[i]); printf("%0x ", source[i]);
@ -61,13 +61,13 @@ void dotest(void)
printf("%0x ", target[i]); printf("%0x ", target[i]);
} }
printf("\n\r"); printf("\n\r");
printf("u8w: %d\n\r", u8w); printf("u8w: %d\n\r", u8w);
printf("u16r: %d\n\r", u16r); printf("u16r: %d\n\r", u16r);
} }
int main(void) int main(void)
{ {
dotest(); dotest();
dotest(); dotest();

View File

@ -2,12 +2,12 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifdef __C64__ #ifdef __C64__
#include <conio.h> #include <conio.h>
#endif #endif
/* apparently we dont trigger the bug when not using absolute addresses? */ /* apparently we dont trigger the bug when not using absolute addresses? */
#ifdef __C64__ #ifdef __C64__
#define TARGETMEM 0x4c8 #define TARGETMEM 0x4c8
#define SOURCEMEM 0x702 #define SOURCEMEM 0x702
#elif __SIM6502__ #elif __SIM6502__
@ -27,9 +27,9 @@ static unsigned char mem[0x10];
static unsigned char u8w = 3; static unsigned char u8w = 3;
static unsigned char u8r = 5; static unsigned char u8r = 5;
static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 }; static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 };
static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf }; static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf };
static unsigned char expect[8] = { 0x0, 0x1, 0xc, 0xd, 0x4, 0x5, 0x6, 0x7 }; static unsigned char expect[8] = { 0x0, 0x1, 0xc, 0xd, 0x4, 0x5, 0x6, 0x7 };
static unsigned char i; static unsigned char i;
static unsigned char err = EXIT_SUCCESS; static unsigned char err = EXIT_SUCCESS;
@ -41,17 +41,17 @@ void test1(void)
void dotest(void) void dotest(void)
{ {
memcpy(TARGETMEM, target, 8); memcpy(TARGETMEM, target, 8);
memcpy(SOURCEMEM, source, 8); memcpy(SOURCEMEM, source, 8);
test1(); test1();
memcpy(target, TARGETMEM, 8); memcpy(target, TARGETMEM, 8);
memcpy(source, SOURCEMEM, 8); memcpy(source, SOURCEMEM, 8);
#ifdef __C64__ #ifdef __C64__
clrscr(); clrscr();
#endif #endif
printf("source:"); printf("source:");
for(i = 0; i < 8; ++i) { for(i = 0; i < 8; ++i) {
printf("%0x ", source[i]); printf("%0x ", source[i]);
@ -61,13 +61,13 @@ void dotest(void)
printf("%0x ", target[i]); printf("%0x ", target[i]);
} }
printf("\n\r"); printf("\n\r");
printf("u8w: %d\n\r", u8w); printf("u8w: %d\n\r", u8w);
printf("u8r: %d\n\r", u8r); printf("u8r: %d\n\r", u8r);
} }
int main(void) int main(void)
{ {
dotest(); dotest();
dotest(); dotest();

View File

@ -2,12 +2,12 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifdef __C64__ #ifdef __C64__
#include <conio.h> #include <conio.h>
#endif #endif
/* apparently we dont trigger the bug when not using absolute addresses? */ /* apparently we dont trigger the bug when not using absolute addresses? */
#ifdef __C64__ #ifdef __C64__
#define TARGETMEM 0x4c8 #define TARGETMEM 0x4c8
#define SOURCEMEM 0x702 #define SOURCEMEM 0x702
#elif __SIM6502__ #elif __SIM6502__
@ -27,9 +27,9 @@ static unsigned char mem[0x10];
static unsigned short u16w = 1; static unsigned short u16w = 1;
static unsigned short u16r = 3; static unsigned short u16r = 3;
static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 }; static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 };
static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf }; static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf };
static unsigned char expect[8] = { 0x0, 0xb, 0xc, 0x3, 0x4, 0x5, 0x6, 0x7 }; static unsigned char expect[8] = { 0x0, 0xb, 0xc, 0x3, 0x4, 0x5, 0x6, 0x7 };
static unsigned char i; static unsigned char i;
static unsigned char err = EXIT_SUCCESS; static unsigned char err = EXIT_SUCCESS;
@ -41,17 +41,17 @@ void test1(void)
void dotest(void) void dotest(void)
{ {
memcpy(TARGETMEM, target, 8); memcpy(TARGETMEM, target, 8);
memcpy(SOURCEMEM, source, 8); memcpy(SOURCEMEM, source, 8);
test1(); test1();
memcpy(target, TARGETMEM, 8); memcpy(target, TARGETMEM, 8);
memcpy(source, SOURCEMEM, 8); memcpy(source, SOURCEMEM, 8);
#ifdef __C64__ #ifdef __C64__
clrscr(); clrscr();
#endif #endif
printf("source:"); printf("source:");
for(i = 0; i < 8; ++i) { for(i = 0; i < 8; ++i) {
printf("%0x ", source[i]); printf("%0x ", source[i]);
@ -61,13 +61,13 @@ void dotest(void)
printf("%0x ", target[i]); printf("%0x ", target[i]);
} }
printf("\n\r"); printf("\n\r");
printf("u16w: %d\n\r", u16w); printf("u16w: %d\n\r", u16w);
printf("u16r: %d\n\r", u16r); printf("u16r: %d\n\r", u16r);
} }
int main(void) int main(void)
{ {
dotest(); dotest();
dotest(); dotest();

View File

@ -1,12 +1,12 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifdef __C64__ #ifdef __C64__
#include <conio.h> #include <conio.h>
#endif #endif
/* apparently we dont trigger the bug when not using absolute addresses? */ /* apparently we dont trigger the bug when not using absolute addresses? */
#ifdef __C64__ #ifdef __C64__
#define TARGETMEM 0x4c8 #define TARGETMEM 0x4c8
#define SOURCEMEM 0x702 #define SOURCEMEM 0x702
#elif __SIM6502__ #elif __SIM6502__
@ -26,9 +26,9 @@ static unsigned char mem[0x10];
static unsigned short u16w = 1; static unsigned short u16w = 1;
static unsigned char u8r = 3; static unsigned char u8r = 3;
static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 }; static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 };
static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf }; static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf };
static unsigned char expect[8] = { 0x0, 0xb, 0xc, 0x3, 0x4, 0x5, 0x6, 0x7 }; static unsigned char expect[8] = { 0x0, 0xb, 0xc, 0x3, 0x4, 0x5, 0x6, 0x7 };
static unsigned char i; static unsigned char i;
static unsigned char err = 0; static unsigned char err = 0;
@ -40,17 +40,17 @@ void test1(void)
void dotest(void) void dotest(void)
{ {
memcpy(TARGETMEM, target, 8); memcpy(TARGETMEM, target, 8);
memcpy(SOURCEMEM, source, 8); memcpy(SOURCEMEM, source, 8);
test1(); test1();
memcpy(target, TARGETMEM, 8); memcpy(target, TARGETMEM, 8);
memcpy(source, SOURCEMEM, 8); memcpy(source, SOURCEMEM, 8);
#ifdef __C64__ #ifdef __C64__
clrscr(); clrscr();
#endif #endif
printf("source:"); printf("source:");
for(i = 0; i < 8; ++i) { for(i = 0; i < 8; ++i) {
printf("%0x ", source[i]); printf("%0x ", source[i]);
@ -60,13 +60,13 @@ void dotest(void)
printf("%0x ", target[i]); printf("%0x ", target[i]);
} }
printf("\n\r"); printf("\n\r");
printf("u16w: %d\n\r", u16w); printf("u16w: %d\n\r", u16w);
printf("u8r: %d\n\r", u8r); printf("u8r: %d\n\r", u8r);
} }
int main(void) int main(void)
{ {
dotest(); dotest();
dotest(); dotest();

View File

@ -2,12 +2,12 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifdef __C64__ #ifdef __C64__
#include <conio.h> #include <conio.h>
#endif #endif
/* apparently we dont trigger the bug when not using absolute addresses? */ /* apparently we dont trigger the bug when not using absolute addresses? */
#ifdef __C64__ #ifdef __C64__
#define TARGETMEM 0x4c8 #define TARGETMEM 0x4c8
#define SOURCEMEM 0x702 #define SOURCEMEM 0x702
#elif __SIM6502__ #elif __SIM6502__
@ -27,9 +27,9 @@ static unsigned char mem[0x10];
static unsigned char u8w = 1; static unsigned char u8w = 1;
static unsigned short u16r = 3; static unsigned short u16r = 3;
static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 }; static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 };
static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf }; static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf };
static unsigned char expect[8] = { 0x0, 0xb, 0xc, 0x3, 0x4, 0x5, 0x6, 0x7 }; static unsigned char expect[8] = { 0x0, 0xb, 0xc, 0x3, 0x4, 0x5, 0x6, 0x7 };
static unsigned char i; static unsigned char i;
static unsigned char err = EXIT_SUCCESS; static unsigned char err = EXIT_SUCCESS;
@ -41,17 +41,17 @@ void test1(void)
void dotest(void) void dotest(void)
{ {
memcpy(TARGETMEM, target, 8); memcpy(TARGETMEM, target, 8);
memcpy(SOURCEMEM, source, 8); memcpy(SOURCEMEM, source, 8);
test1(); test1();
memcpy(target, TARGETMEM, 8); memcpy(target, TARGETMEM, 8);
memcpy(source, SOURCEMEM, 8); memcpy(source, SOURCEMEM, 8);
#ifdef __C64__ #ifdef __C64__
clrscr(); clrscr();
#endif #endif
printf("source:"); printf("source:");
for(i = 0; i < 8; ++i) { for(i = 0; i < 8; ++i) {
printf("%0x ", source[i]); printf("%0x ", source[i]);
@ -61,13 +61,13 @@ void dotest(void)
printf("%0x ", target[i]); printf("%0x ", target[i]);
} }
printf("\n\r"); printf("\n\r");
printf("u8w: %d\n\r", u8w); printf("u8w: %d\n\r", u8w);
printf("u16r: %d\n\r", u16r); printf("u16r: %d\n\r", u16r);
} }
int main(void) int main(void)
{ {
dotest(); dotest();
dotest(); dotest();

View File

@ -2,12 +2,12 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifdef __C64__ #ifdef __C64__
#include <conio.h> #include <conio.h>
#endif #endif
/* apparently we dont trigger the bug when not using absolute addresses? */ /* apparently we dont trigger the bug when not using absolute addresses? */
#ifdef __C64__ #ifdef __C64__
#define TARGETMEM 0x4c8 #define TARGETMEM 0x4c8
#define SOURCEMEM 0x702 #define SOURCEMEM 0x702
#elif __SIM6502__ #elif __SIM6502__
@ -27,9 +27,9 @@ static unsigned char mem[0x10];
static unsigned char u8w = 1; static unsigned char u8w = 1;
static unsigned char u8r = 3; static unsigned char u8r = 3;
static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 }; static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 };
static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf }; static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf };
static unsigned char expect[8] = { 0x0, 0xb, 0xc, 0x3, 0x4, 0x5, 0x6, 0x7 }; static unsigned char expect[8] = { 0x0, 0xb, 0xc, 0x3, 0x4, 0x5, 0x6, 0x7 };
static unsigned char i; static unsigned char i;
static unsigned char err = EXIT_SUCCESS; static unsigned char err = EXIT_SUCCESS;
@ -41,17 +41,17 @@ void test1(void)
void dotest(void) void dotest(void)
{ {
memcpy(TARGETMEM, target, 8); memcpy(TARGETMEM, target, 8);
memcpy(SOURCEMEM, source, 8); memcpy(SOURCEMEM, source, 8);
test1(); test1();
memcpy(target, TARGETMEM, 8); memcpy(target, TARGETMEM, 8);
memcpy(source, SOURCEMEM, 8); memcpy(source, SOURCEMEM, 8);
#ifdef __C64__ #ifdef __C64__
clrscr(); clrscr();
#endif #endif
printf("source:"); printf("source:");
for(i = 0; i < 8; ++i) { for(i = 0; i < 8; ++i) {
printf("%0x ", source[i]); printf("%0x ", source[i]);
@ -61,13 +61,13 @@ void dotest(void)
printf("%0x ", target[i]); printf("%0x ", target[i]);
} }
printf("\n\r"); printf("\n\r");
printf("u8w: %d\n\r", u8w); printf("u8w: %d\n\r", u8w);
printf("u8r: %d\n\r", u8r); printf("u8r: %d\n\r", u8r);
} }
int main(void) int main(void)
{ {
dotest(); dotest();
dotest(); dotest();

View File

@ -2,7 +2,7 @@
/* preprocessor test #4 */ /* preprocessor test #4 */
#define t(x,y,z) x ## y ## z #define t(x,y,z) x ## y ## z
int j[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,), int j[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,),
t(10,,), t(,11,), t(,,12), t(,,) }; t(10,,), t(,11,), t(,,12), t(,,) };
int e[] = { 123, 45, 67, 89, 10, 11, 12, }; int e[] = { 123, 45, 67, 89, 10, 11, 12, };

View File

@ -1,7 +1,7 @@
/* preprocessor test #5 */ /* preprocessor test #5 */
#define t(x,y,z) x ## y ## z #define t(x,y,z) x ## y ## z
int j[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,), int j[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,),
t(10,,), t(,11,), t(,,12), t(,,) }; t(10,,), t(,11,), t(,,12), t(,,) };

View File

@ -10,7 +10,7 @@ void test1(void)
} }
fails++; fails++;
return; return;
} }
void test2(void) void test2(void)
{ {

View File

@ -2,12 +2,12 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifdef __C64__ #ifdef __C64__
#include <conio.h> #include <conio.h>
#endif #endif
/* apparently we dont trigger the bug when not using absolute addresses? */ /* apparently we dont trigger the bug when not using absolute addresses? */
#ifdef __C64__ #ifdef __C64__
#define TARGETMEM 0x4c8 #define TARGETMEM 0x4c8
#define SOURCEMEM 0x702 #define SOURCEMEM 0x702
#elif __SIM6502__ #elif __SIM6502__
@ -27,9 +27,9 @@ static unsigned char mem[0x10];
static unsigned short u16w = 3; static unsigned short u16w = 3;
static unsigned short u16r = 5; static unsigned short u16r = 5;
static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 }; static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 };
static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf }; static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf };
static unsigned char expect[8] = { 0x0, 0xb, 0xc, 0x3, 0x4, 0x5, 0x6, 0x7 }; static unsigned char expect[8] = { 0x0, 0xb, 0xc, 0x3, 0x4, 0x5, 0x6, 0x7 };
static unsigned char i; static unsigned char i;
static unsigned char err = EXIT_SUCCESS; static unsigned char err = EXIT_SUCCESS;
@ -41,17 +41,17 @@ void test1(void)
void dotest(void) void dotest(void)
{ {
memcpy(TARGETMEM, target, 8); memcpy(TARGETMEM, target, 8);
memcpy(SOURCEMEM, source, 8); memcpy(SOURCEMEM, source, 8);
test1(); test1();
memcpy(target, TARGETMEM, 8); memcpy(target, TARGETMEM, 8);
memcpy(source, SOURCEMEM, 8); memcpy(source, SOURCEMEM, 8);
#ifdef __C64__ #ifdef __C64__
clrscr(); clrscr();
#endif #endif
printf("source:"); printf("source:");
for(i = 0; i < 8; ++i) { for(i = 0; i < 8; ++i) {
printf("%0x ", source[i]); printf("%0x ", source[i]);
@ -61,13 +61,13 @@ void dotest(void)
printf("%0x ", target[i]); printf("%0x ", target[i]);
} }
printf("\n\r"); printf("\n\r");
printf("u16w: %d\n\r", u16w); printf("u16w: %d\n\r", u16w);
printf("u16r: %d\n\r", u16r); printf("u16r: %d\n\r", u16r);
} }
int main(void) int main(void)
{ {
dotest(); dotest();
dotest(); dotest();

View File

@ -2,12 +2,12 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifdef __C64__ #ifdef __C64__
#include <conio.h> #include <conio.h>
#endif #endif
/* apparently we dont trigger the bug when not using absolute addresses? */ /* apparently we dont trigger the bug when not using absolute addresses? */
#ifdef __C64__ #ifdef __C64__
#define TARGETMEM 0x4c8 #define TARGETMEM 0x4c8
#define SOURCEMEM 0x702 #define SOURCEMEM 0x702
#elif __SIM6502__ #elif __SIM6502__
@ -27,9 +27,9 @@ static unsigned char mem[0x10];
static unsigned short u16w = 3; static unsigned short u16w = 3;
static unsigned char u8r = 5; static unsigned char u8r = 5;
static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 }; static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 };
static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf }; static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf };
static unsigned char expect[8] = { 0x0, 0xb, 0xc, 0x3, 0x4, 0x5, 0x6, 0x7 }; static unsigned char expect[8] = { 0x0, 0xb, 0xc, 0x3, 0x4, 0x5, 0x6, 0x7 };
static unsigned char i; static unsigned char i;
static unsigned char err = EXIT_SUCCESS; static unsigned char err = EXIT_SUCCESS;
@ -41,17 +41,17 @@ void test1(void)
void dotest(void) void dotest(void)
{ {
memcpy(TARGETMEM, target, 8); memcpy(TARGETMEM, target, 8);
memcpy(SOURCEMEM, source, 8); memcpy(SOURCEMEM, source, 8);
test1(); test1();
memcpy(target, TARGETMEM, 8); memcpy(target, TARGETMEM, 8);
memcpy(source, SOURCEMEM, 8); memcpy(source, SOURCEMEM, 8);
#ifdef __C64__ #ifdef __C64__
clrscr(); clrscr();
#endif #endif
printf("source:"); printf("source:");
for(i = 0; i < 8; ++i) { for(i = 0; i < 8; ++i) {
printf("%0x ", source[i]); printf("%0x ", source[i]);
@ -61,13 +61,13 @@ void dotest(void)
printf("%0x ", target[i]); printf("%0x ", target[i]);
} }
printf("\n\r"); printf("\n\r");
printf("u16w: %d\n\r", u16w); printf("u16w: %d\n\r", u16w);
printf("u8r: %d\n\r", u8r); printf("u8r: %d\n\r", u8r);
} }
int main(void) int main(void)
{ {
dotest(); dotest();
dotest(); dotest();

View File

@ -2,12 +2,12 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifdef __C64__ #ifdef __C64__
#include <conio.h> #include <conio.h>
#endif #endif
/* apparently we dont trigger the bug when not using absolute addresses? */ /* apparently we dont trigger the bug when not using absolute addresses? */
#ifdef __C64__ #ifdef __C64__
#define TARGETMEM 0x4c8 #define TARGETMEM 0x4c8
#define SOURCEMEM 0x702 #define SOURCEMEM 0x702
#elif __SIM6502__ #elif __SIM6502__
@ -27,9 +27,9 @@ static unsigned char mem[0x10];
static unsigned char u8w = 3; static unsigned char u8w = 3;
static unsigned short u16r = 5; static unsigned short u16r = 5;
static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 }; static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 };
static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf }; static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf };
static unsigned char expect[8] = { 0x0, 0xb, 0xc, 0x3, 0x4, 0x5, 0x6, 0x7 }; static unsigned char expect[8] = { 0x0, 0xb, 0xc, 0x3, 0x4, 0x5, 0x6, 0x7 };
static unsigned char i; static unsigned char i;
static unsigned char err = EXIT_SUCCESS; static unsigned char err = EXIT_SUCCESS;
@ -41,17 +41,17 @@ void test1(void)
void dotest(void) void dotest(void)
{ {
memcpy(TARGETMEM, target, 8); memcpy(TARGETMEM, target, 8);
memcpy(SOURCEMEM, source, 8); memcpy(SOURCEMEM, source, 8);
test1(); test1();
memcpy(target, TARGETMEM, 8); memcpy(target, TARGETMEM, 8);
memcpy(source, SOURCEMEM, 8); memcpy(source, SOURCEMEM, 8);
#ifdef __C64__ #ifdef __C64__
clrscr(); clrscr();
#endif #endif
printf("source:"); printf("source:");
for(i = 0; i < 8; ++i) { for(i = 0; i < 8; ++i) {
printf("%0x ", source[i]); printf("%0x ", source[i]);
@ -61,13 +61,13 @@ void dotest(void)
printf("%0x ", target[i]); printf("%0x ", target[i]);
} }
printf("\n\r"); printf("\n\r");
printf("u8w: %d\n\r", u8w); printf("u8w: %d\n\r", u8w);
printf("u16r: %d\n\r", u16r); printf("u16r: %d\n\r", u16r);
} }
int main(void) int main(void)
{ {
dotest(); dotest();
dotest(); dotest();

View File

@ -2,12 +2,12 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifdef __C64__ #ifdef __C64__
#include <conio.h> #include <conio.h>
#endif #endif
/* apparently we dont trigger the bug when not using absolute addresses? */ /* apparently we dont trigger the bug when not using absolute addresses? */
#ifdef __C64__ #ifdef __C64__
#define TARGETMEM 0x4c8 #define TARGETMEM 0x4c8
#define SOURCEMEM 0x702 #define SOURCEMEM 0x702
#elif __SIM6502__ #elif __SIM6502__
@ -27,9 +27,9 @@ static unsigned char mem[0x10];
static unsigned char u8w = 3; static unsigned char u8w = 3;
static unsigned char u8r = 5; static unsigned char u8r = 5;
static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 }; static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 };
static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf }; static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf };
static unsigned char expect[8] = { 0x0, 0xb, 0xc, 0x3, 0x4, 0x5, 0x6, 0x7 }; static unsigned char expect[8] = { 0x0, 0xb, 0xc, 0x3, 0x4, 0x5, 0x6, 0x7 };
static unsigned char i; static unsigned char i;
static unsigned char err = EXIT_SUCCESS; static unsigned char err = EXIT_SUCCESS;
@ -41,17 +41,17 @@ void test1(void)
void dotest(void) void dotest(void)
{ {
memcpy(TARGETMEM, target, 8); memcpy(TARGETMEM, target, 8);
memcpy(SOURCEMEM, source, 8); memcpy(SOURCEMEM, source, 8);
test1(); test1();
memcpy(target, TARGETMEM, 8); memcpy(target, TARGETMEM, 8);
memcpy(source, SOURCEMEM, 8); memcpy(source, SOURCEMEM, 8);
#ifdef __C64__ #ifdef __C64__
clrscr(); clrscr();
#endif #endif
printf("source:"); printf("source:");
for(i = 0; i < 8; ++i) { for(i = 0; i < 8; ++i) {
printf("%0x ", source[i]); printf("%0x ", source[i]);
@ -61,13 +61,13 @@ void dotest(void)
printf("%0x ", target[i]); printf("%0x ", target[i]);
} }
printf("\n\r"); printf("\n\r");
printf("u8w: %d\n\r", u8w); printf("u8w: %d\n\r", u8w);
printf("u8r: %d\n\r", u8r); printf("u8r: %d\n\r", u8r);
} }
int main(void) int main(void)
{ {
dotest(); dotest();
dotest(); dotest();

View File

@ -2,12 +2,12 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifdef __C64__ #ifdef __C64__
#include <conio.h> #include <conio.h>
#endif #endif
/* apparently we dont trigger the bug when not using absolute addresses? */ /* apparently we dont trigger the bug when not using absolute addresses? */
#ifdef __C64__ #ifdef __C64__
#define TARGETMEM 0x4c8 #define TARGETMEM 0x4c8
#define SOURCEMEM 0x702 #define SOURCEMEM 0x702
#elif __SIM6502__ #elif __SIM6502__
@ -27,9 +27,9 @@ static unsigned char mem[0x10];
static unsigned short u16w = 3; static unsigned short u16w = 3;
static unsigned short u16r = 5; static unsigned short u16r = 5;
static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 }; static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 };
static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf }; static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf };
static unsigned char expect[8] = { 0x0, 0x1, 0x2, 0x3, 0xe, 0xf, 0x6, 0x7 }; static unsigned char expect[8] = { 0x0, 0x1, 0x2, 0x3, 0xe, 0xf, 0x6, 0x7 };
static unsigned char i; static unsigned char i;
static unsigned char err = EXIT_SUCCESS; static unsigned char err = EXIT_SUCCESS;
@ -41,17 +41,17 @@ void test1(void)
void dotest(void) void dotest(void)
{ {
memcpy(TARGETMEM, target, 8); memcpy(TARGETMEM, target, 8);
memcpy(SOURCEMEM, source, 8); memcpy(SOURCEMEM, source, 8);
test1(); test1();
memcpy(target, TARGETMEM, 8); memcpy(target, TARGETMEM, 8);
memcpy(source, SOURCEMEM, 8); memcpy(source, SOURCEMEM, 8);
#ifdef __C64__ #ifdef __C64__
clrscr(); clrscr();
#endif #endif
printf("source:"); printf("source:");
for(i = 0; i < 8; ++i) { for(i = 0; i < 8; ++i) {
printf("%0x ", source[i]); printf("%0x ", source[i]);
@ -61,13 +61,13 @@ void dotest(void)
printf("%0x ", target[i]); printf("%0x ", target[i]);
} }
printf("\n\r"); printf("\n\r");
printf("u16w: %d\n\r", u16w); printf("u16w: %d\n\r", u16w);
printf("u16r: %d\n\r", u16r); printf("u16r: %d\n\r", u16r);
} }
int main(void) int main(void)
{ {
dotest(); dotest();
dotest(); dotest();

View File

@ -2,12 +2,12 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifdef __C64__ #ifdef __C64__
#include <conio.h> #include <conio.h>
#endif #endif
/* apparently we dont trigger the bug when not using absolute addresses? */ /* apparently we dont trigger the bug when not using absolute addresses? */
#ifdef __C64__ #ifdef __C64__
#define TARGETMEM 0x4c8 #define TARGETMEM 0x4c8
#define SOURCEMEM 0x702 #define SOURCEMEM 0x702
#elif __SIM6502__ #elif __SIM6502__
@ -27,9 +27,9 @@ static unsigned char mem[0x10];
static unsigned short u16w = 3; static unsigned short u16w = 3;
static unsigned char u8r = 5; static unsigned char u8r = 5;
static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 }; static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 };
static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf }; static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf };
static unsigned char expect[8] = { 0x0, 0x1, 0x2, 0x3, 0xe, 0xf, 0x6, 0x7 }; static unsigned char expect[8] = { 0x0, 0x1, 0x2, 0x3, 0xe, 0xf, 0x6, 0x7 };
static unsigned char i; static unsigned char i;
static unsigned char err = EXIT_SUCCESS; static unsigned char err = EXIT_SUCCESS;
@ -41,17 +41,17 @@ void test1(void)
void dotest(void) void dotest(void)
{ {
memcpy(TARGETMEM, target, 8); memcpy(TARGETMEM, target, 8);
memcpy(SOURCEMEM, source, 8); memcpy(SOURCEMEM, source, 8);
test1(); test1();
memcpy(target, TARGETMEM, 8); memcpy(target, TARGETMEM, 8);
memcpy(source, SOURCEMEM, 8); memcpy(source, SOURCEMEM, 8);
#ifdef __C64__ #ifdef __C64__
clrscr(); clrscr();
#endif #endif
printf("source:"); printf("source:");
for(i = 0; i < 8; ++i) { for(i = 0; i < 8; ++i) {
printf("%0x ", source[i]); printf("%0x ", source[i]);
@ -61,13 +61,13 @@ void dotest(void)
printf("%0x ", target[i]); printf("%0x ", target[i]);
} }
printf("\n\r"); printf("\n\r");
printf("u16w: %d\n\r", u16w); printf("u16w: %d\n\r", u16w);
printf("u8r: %d\n\r", u8r); printf("u8r: %d\n\r", u8r);
} }
int main(void) int main(void)
{ {
dotest(); dotest();
dotest(); dotest();

View File

@ -2,12 +2,12 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifdef __C64__ #ifdef __C64__
#include <conio.h> #include <conio.h>
#endif #endif
/* apparently we dont trigger the bug when not using absolute addresses? */ /* apparently we dont trigger the bug when not using absolute addresses? */
#ifdef __C64__ #ifdef __C64__
#define TARGETMEM 0x4c8 #define TARGETMEM 0x4c8
#define SOURCEMEM 0x702 #define SOURCEMEM 0x702
#elif __SIM6502__ #elif __SIM6502__
@ -27,9 +27,9 @@ static unsigned char mem[0x10];
static unsigned char u8w = 3; static unsigned char u8w = 3;
static unsigned short u16r = 5; static unsigned short u16r = 5;
static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 }; static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 };
static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf }; static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf };
static unsigned char expect[8] = { 0x0, 0x1, 0x2, 0x3, 0xe, 0xf, 0x6, 0x7 }; static unsigned char expect[8] = { 0x0, 0x1, 0x2, 0x3, 0xe, 0xf, 0x6, 0x7 };
static unsigned char i; static unsigned char i;
static unsigned char err = EXIT_SUCCESS; static unsigned char err = EXIT_SUCCESS;
@ -41,17 +41,17 @@ void test1(void)
void dotest(void) void dotest(void)
{ {
memcpy(TARGETMEM, target, 8); memcpy(TARGETMEM, target, 8);
memcpy(SOURCEMEM, source, 8); memcpy(SOURCEMEM, source, 8);
test1(); test1();
memcpy(target, TARGETMEM, 8); memcpy(target, TARGETMEM, 8);
memcpy(source, SOURCEMEM, 8); memcpy(source, SOURCEMEM, 8);
#ifdef __C64__ #ifdef __C64__
clrscr(); clrscr();
#endif #endif
printf("source:"); printf("source:");
for(i = 0; i < 8; ++i) { for(i = 0; i < 8; ++i) {
printf("%0x ", source[i]); printf("%0x ", source[i]);
@ -61,13 +61,13 @@ void dotest(void)
printf("%0x ", target[i]); printf("%0x ", target[i]);
} }
printf("\n\r"); printf("\n\r");
printf("u8w: %d\n\r", u8w); printf("u8w: %d\n\r", u8w);
printf("u16r: %d\n\r", u16r); printf("u16r: %d\n\r", u16r);
} }
int main(void) int main(void)
{ {
dotest(); dotest();
dotest(); dotest();

View File

@ -2,12 +2,12 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifdef __C64__ #ifdef __C64__
#include <conio.h> #include <conio.h>
#endif #endif
/* apparently we dont trigger the bug when not using absolute addresses? */ /* apparently we dont trigger the bug when not using absolute addresses? */
#ifdef __C64__ #ifdef __C64__
#define TARGETMEM 0x4c8 #define TARGETMEM 0x4c8
#define SOURCEMEM 0x702 #define SOURCEMEM 0x702
#elif __SIM6502__ #elif __SIM6502__
@ -27,9 +27,9 @@ static unsigned char mem[0x10];
static unsigned char u8w = 3; static unsigned char u8w = 3;
static unsigned char u8r = 5; static unsigned char u8r = 5;
static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 }; static unsigned char target[8] = { 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7 };
static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf }; static unsigned char source[8] = { 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf };
static unsigned char expect[8] = { 0x0, 0x1, 0x2, 0x3, 0xe, 0xf, 0x6, 0x7 }; static unsigned char expect[8] = { 0x0, 0x1, 0x2, 0x3, 0xe, 0xf, 0x6, 0x7 };
static unsigned char i; static unsigned char i;
static unsigned char err = EXIT_SUCCESS; static unsigned char err = EXIT_SUCCESS;
@ -41,17 +41,17 @@ void test1(void)
void dotest(void) void dotest(void)
{ {
memcpy(TARGETMEM, target, 8); memcpy(TARGETMEM, target, 8);
memcpy(SOURCEMEM, source, 8); memcpy(SOURCEMEM, source, 8);
test1(); test1();
memcpy(target, TARGETMEM, 8); memcpy(target, TARGETMEM, 8);
memcpy(source, SOURCEMEM, 8); memcpy(source, SOURCEMEM, 8);
#ifdef __C64__ #ifdef __C64__
clrscr(); clrscr();
#endif #endif
printf("source:"); printf("source:");
for(i = 0; i < 8; ++i) { for(i = 0; i < 8; ++i) {
printf("%0x ", source[i]); printf("%0x ", source[i]);
@ -61,13 +61,13 @@ void dotest(void)
printf("%0x ", target[i]); printf("%0x ", target[i]);
} }
printf("\n\r"); printf("\n\r");
printf("u8w: %d\n\r", u8w); printf("u8w: %d\n\r", u8w);
printf("u8r: %d\n\r", u8r); printf("u8r: %d\n\r", u8r);
} }
int main(void) int main(void)
{ {
dotest(); dotest();
dotest(); dotest();

View File

@ -15,7 +15,7 @@ typedef struct _DIRMENU
{ {
const char *name; const char *name;
struct _DIRMENU *dest; struct _DIRMENU *dest;
} DIRMENU; } DIRMENU;
static DIRMENU rmenu; static DIRMENU rmenu;

View File

@ -71,9 +71,9 @@ int main(void)
ret = do_test("", "", 5); ret = do_test("", "", 5);
printresult(ret); printresult(ret);
printf("fails: %d\n", fails); printf("fails: %d\n", fails);
#if defined(__CC65__) && !defined(__SIM6502__) && !defined(__SIM65C02__) #if defined(__CC65__) && !defined(__SIM6502__) && !defined(__SIM65C02__)
cgetc(); cgetc();
#endif #endif

View File

@ -1,6 +1,6 @@
/* /*
!!DESCRIPTION!! Testing empty bodied switch statements. !!DESCRIPTION!! Testing empty bodied switch statements.
!!ORIGIN!! !!ORIGIN!!
!!LICENCE!! GPL, read COPYING.GPL !!LICENCE!! GPL, read COPYING.GPL
*/ */

View File

@ -46,7 +46,7 @@ int main (void)
sprintf (result, "%08lX - %s\n", t, buf); sprintf (result, "%08lX - %s\n", t, buf);
printf (result); printf (result);
if (strcmp(result, EXPECTSTR) != 0) { fails++; } if (strcmp(result, EXPECTSTR) != 0) { fails++; }
printf("fails: %d\n", fails); printf("fails: %d\n", fails);
return fails; return fails;

View File

@ -31,12 +31,12 @@ void xor_chars_0_1(void)
void xor_if(void) void xor_if(void)
{ {
if(achar0 ^ achar1) if(achar0 ^ achar1)
failures++; failures++;
achar0 ^= 0xff; achar0 ^= 0xff;
if( !(achar0 ^ achar1) ) if( !(achar0 ^ achar1) )
failures++; failures++;
} }