Commit 477c02bb authored by andy's avatar andy
Browse files

[project @ 1999-11-01 04:17:37 by andy]

wibble in derive.c

Changing stdout's buffering. fflush in the program does not flush
the dll's private buffer space on Win32.
parent 1161c750
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
* included in the distribution. * included in the distribution.
* *
* $RCSfile: derive.c,v $ * $RCSfile: derive.c,v $
* $Revision: 1.7 $ * $Revision: 1.8 $
* $Date: 1999/10/15 21:41:04 $ * $Date: 1999/11/01 04:17:37 $
* ------------------------------------------------------------------------*/ * ------------------------------------------------------------------------*/
#include "prelude.h" #include "prelude.h"
...@@ -340,19 +340,22 @@ Int n; { ...@@ -340,19 +340,22 @@ Int n; {
Cell ls = h; Cell ls = h;
Cell us = h; Cell us = h;
Cell is = h; Cell is = h;
Cell js = h;
Cell pr = NIL; Cell pr = NIL;
Cell pats = NIL; Cell pats = NIL;
Int i; Int i;
for (i=0; i<n; ++i, vs=tl(vs)) { /* build three patterns for values */ for (i=0; i<n; ++i, vs=tl(vs)) { /* build three patterns for values */
ls = ap(ls,hd(vs)); /* of the datatype concerned */ ls = ap(ls,hd(vs)); /* of the datatype concerned */
us = ap(us,hd(vs=tl(vs))); us = ap(us,hd(vs=tl(vs)));
is = ap(is,hd(vs=tl(vs))); is = ap(is,hd(vs=tl(vs)));
js = ap(js,hd(vs)); /* ... and one expression */
} }
pr = ap2(mkTuple(2),ls,us); /* Build (ls,us) */ pr = ap2(mkTuple(2),ls,us); /* Build (ls,us) */
pats = cons(pr,cons(is,NIL)); /* Build [(ls,us),is] */ pats = cons(pr,cons(is,NIL)); /* Build [(ls,us),is] */
return cons(prodRange(line,singleton(pr),ls,us,is), return cons(prodRange(line,singleton(pr),ls,us,js),
cons(prodIndex(line,pats,ls,us,is), cons(prodIndex(line,pats,ls,us,is),
cons(prodInRange(line,pats,ls,us,is), cons(prodInRange(line,pats,ls,us,is),
NIL))); NIL)));
...@@ -544,10 +547,11 @@ Int a; { ...@@ -544,10 +547,11 @@ Int a; {
if (defaultSyntax(name(h).text)==APPLIC) { if (defaultSyntax(name(h).text)==APPLIC) {
rhs = ap(showsBQ, rhs = ap(showsBQ,
ap2(nameComp, ap2(nameComp,
ap(nameApp,mkStr(name(h).text)), ap(nameApp,mkStr(fixLitText(name(h).text))),
ap(showsBQ,rhs))); ap(showsBQ,rhs)));
} else { } else {
rhs = ap2(nameComp,ap(nameApp,mkStr(name(h).text)),rhs); rhs = ap2(nameComp,
ap(nameApp,mkStr(fixLitText(name(h).text))),rhs);
} }
rhs = ap2(nameComp, rhs = ap2(nameComp,
......
...@@ -54,8 +54,7 @@ void nh_write ( FILE* f, int c ) ...@@ -54,8 +54,7 @@ void nh_write ( FILE* f, int c )
errno = 0; errno = 0;
fputc(c,f); fputc(c,f);
if (f==stderr) { fflush(f); } if (f==stderr) { fflush(f); }
else if (f==stdin && isspace(c)) { fflush(f); }; if (f==stdout) { fflush(f); }
} }
int nh_read ( FILE* f ) int nh_read ( FILE* f )
...@@ -95,4 +94,23 @@ int nh_getenv ( int p ) ...@@ -95,4 +94,23 @@ int nh_getenv ( int p )
return (int)getenv ( (const char *)p ); return (int)getenv ( (const char *)p );
} }
#if 0
int prog_argc;
char** prog_argv;
int nh_init_args ( int argc, char *argv[] )
{
prog_argc = argc;
prog_argv = argv;
}
int nh_argc ( void )
{
return prog_argc;
}
int nh_argvb ( int argno, int offset )
{
return prog_argv[argno][offset];
}
#endif
...@@ -13,6 +13,6 @@ ...@@ -13,6 +13,6 @@
#if MAJOR_RELEASE #if MAJOR_RELEASE
#define HUGS_VERSION "October 1999 " #define HUGS_VERSION "October 1999 "
#else #else
#define HUGS_VERSION "991015 (STG) " #define HUGS_VERSION "STGHugs-991029"
#endif #endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment