[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Add --quiet option to allow an app to own stdout and stderr (#395)

Ben Coman notifications at github.com
Wed May 15 13:39:27 UTC 2019


An expansive scattering of changes, but pretty much all of them are...
simply refactoring `fprintf(stderr,`  ==>  `fprintf(VM_ERR(),`
excepting the following which looks fine...
```
static FILE *VM_ERR_FILE = NULL;

FILE *VM_ERR(void)
{
	if (!VM_ERR_FILE) {
		VM_ERR_FILE = stderr;
	}
	return VM_ERR_FILE;
}

void sqSetVmErrFile(FILE *file)
{
	VM_ERR_FILE = file;
}



static int vm_parseArgument(int argc, char **argv)
{
   ...
   else if (!strcmp(argv[0], VMOPTION("quiet"))) {
       sqSetVmErrFile(fopen("/dev/null", "w"));
       return 1;
    }
    return 0; /* option not recognised */
}

(void) printUsage {
        ...
	printf("  "VMOPTION("quiet")"                don't print debugging messages from the VM\n");
        ...
}

        
```

And the following seems correct to align with sq.h...
```
- extern void addIdleUsecs(long idleUsecs);
+ extern void addIdleUsecs(sqInt idleUsecs);
```
https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/83aebb122ca2fd32a86ef8b7d478ed32b12dc6b1/platforms/Cross/vm/sq.h#L180


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/395#issuecomment-492658638
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20190515/14317495/attachment.html>


More information about the Vm-dev mailing list