[M3commit] CVS Update: cm3
Jay Krell
jkrell at elego.de
Fri Jan 2 01:21:20 CET 2009
CVSROOT: /usr/cvs
Changes by: jkrell at birch. 09/01/02 01:21:20
Modified files:
cm3/m3-libs/m3core/src/unix/Common/: UtimeC.c
cm3/m3-libs/m3core/src/unix/cygwin/: Unix.i3 Usignal.i3
Usocket.i3 Ustat.i3
Utime.i3 Utypes.i3
Uutsname.i3 m3makefile
Added files:
cm3/m3-libs/m3core/src/unix/cygwin/: Usysdep.i3
Removed files:
cm3/m3-libs/m3core/src/unix/cygwin/: Utime.m3
Log message:
tighten up UtimeC.c a little, perhaps unnecessarily
in particular, function that takes [0..1] assert its parameter,
and in the unlikely case that doesn't suffice (compile with -DNDEBUG?),
truncate it as well.
If the extern function is declared as taking [0..1], presumably
the range checks are on the caller side and not the callee side???
That is more bloated, but seems better, maybe.
Remove some unused prototypes. Dubious to put them here. Might have
quashed compiler warnings(as errors) in some contexts, will put them back
as needed, probably in m3unix.h. The code is definitely standard-correct,
but might not pass all command lines, like gcc -Wmissing-prototypes or such.
(Er, at least Metrowerks was the worst here, making you prototype functions that
were implemented prior to use, or not even used.., gcc hopefully only complains
about used stuff..?)
First round of moving Unix constants and types into new Usysdep.i3,
and then exporting those from files that contain some portable content.
plan:
do this one platform at a time (cygwin, linux, openbsd)
do each platform twice
it is very tedious, copy/paste intensive, error-prone
first round not commited, just saved away and then compared to second round
once each platform done, go back and extract the common parts
the intention is that every file but Usysdep.i3 is identical, but this is
best verified and acted upon only once they are all three there and seeming to work
Here just Cygwin.
This should significantly reduce the system dependent content, even though
it may lead to more lines over all, since sysdep content must be declared
AND forwarded.
Note that this discovered duplicate declarations of timezone or such, one
in Utime.i3, the other in Utypes.i3.
Investigate this more later.
As well, Usysdep probably contains some portable content, to be whittled down later.
As well, the resulting portable files -- Unix.i3 and such -- are likely to be in
varying order after the first round, and Cygwin's suffers (arguably) from a lack
of comments and unreadable order (flags/types/functions not near relatives).
At some point this was to reduce the size of the cloned headers, but once their
duplication is reduced, the trade off starts shifting.
Merge Utime.m3 into UtimeC.c.
Perhaps not ideal. Cygwin is the only Posix platform that needs this C wrapper.
Perhaps the calling Modula-3 should be modified to either ignore errors, or ignore
errors on Cygwin (you can do runtime checks of what platform you are on, after all,
some code does).
More information about the M3commit
mailing list