|
From: <cli...@li...> - 2010-10-09 12:04:37
|
Send clisp-cvs mailing list submissions to cli...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/clisp-cvs or, via email, send a message with subject or body 'help' to cli...@li... You can reach the person managing the list at cli...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of clisp-cvs digest..." CLISP CVS commits for today Today's Topics: 1. clisp/src ChangeLog,1.7549,1.7550 genclisph.d,1.215,1.216 (Sam Steingold) 2. clisp/src genclisph.d,1.216,1.217 (Sam Steingold) ---------------------------------------------------------------------- Message: 1 Date: Fri, 08 Oct 2010 19:33:30 +0000 From: Sam Steingold <sd...@us...> Subject: clisp/src ChangeLog,1.7549,1.7550 genclisph.d,1.215,1.216 To: cli...@li... Message-ID: <E1P...@sf...> Update of /cvsroot/clisp/clisp/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11461/src Modified Files: ChangeLog genclisph.d Log Message: * src/genclisph.d (check_typecodes): run in the generated clisp-test-lispbibl instead of genclisph so that the check is always enabled Index: genclisph.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/genclisph.d,v retrieving revision 1.215 retrieving revision 1.216 diff -u -d -r1.215 -r1.216 --- genclisph.d 5 Aug 2010 19:17:28 -0000 1.215 +++ genclisph.d 8 Oct 2010 19:33:28 -0000 1.216 @@ -224,7 +224,7 @@ printf("%s %s%s;\n",prefix,o,suffix); } -#if defined(TYPECODES) && 0 /* cannot always enable: redefines typecode macro */ +#if defined(TYPECODES) struct typecode_entry { char* name; int code; @@ -239,15 +239,12 @@ int mdarrayP; int closureP; }; -#undef typecode -#define typecode(te) ((te)->code) -#define CHECK_FIELD(test) if (test##p(te) != te->test##P) { \ - fprintf(stderr,#test "p(%s=%d)=%d, should be %d\n", \ - te->name,te->code,test##p(te),te->test##P); \ - ret = false; \ - } -static bool check_typecode_entry (struct typecode_entry *te) { - bool ret = true; +#define CHECK_FIELD(test) \ + fprintf(test_f," #ifdef " #test "p\n if (" #test "p(%d) != %d) {\n" \ + " fprintf(stderr,\"" #test "p(%s=%d)=%%d, should be %d\\n\","\ + #test "p(%d));\n failure_count++;\n }\n #endif\n", \ + te->code,te->test##P,te->name,te->code,te->test##P,te->code) +static void check_typecode_entry (struct typecode_entry *te) { CHECK_FIELD(vector); CHECK_FIELD(simple); CHECK_FIELD(array_simple); @@ -258,7 +255,6 @@ CHECK_FIELD(array); CHECK_FIELD(mdarray); CHECK_FIELD(closure); - return ret; } struct typecode_entry all_typecodes[] = { { "machine_type", machine_type, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 }, @@ -301,15 +297,14 @@ }; int typecode_count = sizeof(all_typecodes)/sizeof(struct typecode_entry); static void check_typecodes (void) { - int i, failure_count = 0; + int i; + if (test_f == NULL) return; + fprintf(test_f,"#if !USE_CLISP_H\n #undef typecode\n " + "#define typecode(c) (c)\n {int failure_count = 0;\n"); for (i=0; i<typecode_count; i++) - if (!check_typecode_entry(&(all_typecodes[i]))) - failure_count++; - if (failure_count>0) { - fprintf(stderr,"failed %d typecodes out of %d\n", - failure_count,typecode_count); - exit(1); - } + check_typecode_entry(&(all_typecodes[i])); + fprintf(test_f," if (failure_count>0) { fprintf(stderr,\"%%d typecode" + " error(s)\\n\",failure_count); abort(); }}\n#endif\n"); } #else #define check_typecodes() @@ -319,7 +314,6 @@ { char buf[BUFSIZ]; - check_typecodes(); header_f = stdout; if (argc >= 2) { /* open the test file and start it */ test_f = fopen(argv[1],"w"); @@ -415,6 +409,7 @@ /* done - check for errors, close test files &c */ if (ferror(stdout)) exit(1); if (ferror(header_f)) exit(1); + check_typecodes(); if (test_f) { fprintf(test_f," return 0;\n}\n"); if (ferror(test_f)) exit(1); Index: ChangeLog =================================================================== RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v retrieving revision 1.7549 retrieving revision 1.7550 diff -u -d -r1.7549 -r1.7550 --- ChangeLog 7 Oct 2010 17:32:48 -0000 1.7549 +++ ChangeLog 8 Oct 2010 19:33:28 -0000 1.7550 @@ -1,3 +1,9 @@ +2010-10-08 Sam Steingold <sd...@gn...> + + * genclisph.d (check_typecodes): run in the generated + clisp-test-lispbibl instead of genclisph so that the check is + always enabled + 2010-10-05 Sam Steingold <sd...@gn...> * makemake.in (full): print gnulib replacements only when -verbose ------------------------------ Message: 2 Date: Fri, 08 Oct 2010 19:34:48 +0000 From: Sam Steingold <sd...@us...> Subject: clisp/src genclisph.d,1.216,1.217 To: cli...@li... Message-ID: <E1P...@sf...> Update of /cvsroot/clisp/clisp/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11742 Modified Files: genclisph.d Log Message: comment Index: genclisph.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/genclisph.d,v retrieving revision 1.216 retrieving revision 1.217 diff -u -d -r1.216 -r1.217 --- genclisph.d 8 Oct 2010 19:33:28 -0000 1.216 +++ genclisph.d 8 Oct 2010 19:34:46 -0000 1.217 @@ -299,6 +299,8 @@ static void check_typecodes (void) { int i; if (test_f == NULL) return; + /* cannot run the check when including clisp.h because there typecode(obj) + has already been expanded to something horrible */ fprintf(test_f,"#if !USE_CLISP_H\n #undef typecode\n " "#define typecode(c) (c)\n {int failure_count = 0;\n"); for (i=0; i<typecode_count; i++) ------------------------------ ------------------------------------------------------------------------------ Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ------------------------------ _______________________________________________ clisp-cvs mailing list cli...@li... https://lists.sourceforge.net/lists/listinfo/clisp-cvs End of clisp-cvs Digest, Vol 54, Issue 6 **************************************** |