I've been poking a bit at OpenGLUT code lately and noted some minor
things which I've amended in OpenGLUT. One is exit() status. OpenGLUT
calls exit() in exactly two places. One place is an error exit, the
other is an "okay" exit.
The "okay" exit returned 0, and the error returned 1.
Nigel (I think) had converted some of the demos to return EXIT_SUCCESS
from main(). My initial reaction was that this was needless verbosity
for a well-understood zero/non-zero thing. Then I remembered that the
Amiga (e.g.) used program exit codes from 1 through 5 (or 1 through 10?)
for "warnings", and another block for "errors" and another for "failure".
A -1 return value was used to let program-like things indicate that
they were not intended to be run as executables (the AmigaDOS error
message was "not executable" or some such, even though the code
came from actually loading and executing the file).
I've not used these generally, but using them in the library seems like
a good ANSIfication to deal with differing environments.
Mulling that over, I changed OpenGLUT's exit()s appropriately. The
EXIT_* symbols are defined in K&R2, so apparently have been with us for
15 years at least.
(Freeglut has more like a half-dozen locations where it calls exit(),
still. But the values are always hard-coded 0s or 1s.)
"I probably don't know what I'm talking about." http://www.olib.org/~rkr/