#include <windows.h>
#include <system_errors.h>
#include <stdlib.h>
char make_prog_look_big[1600000];
main()
{
if (detect_cache())
disable_cache();
if (fast_cpu())
set_wait_states(lots);
set_mouse(speed, very_slow);
set_mouse(action, jumpy);
set_mouse(reaction, sometimes);
printf("Welcome to Windoze 3.999 (we might get it right or just call it Chicargo)\n");
if (system_ok())
crash(to_dos_prompt);
else
system_memory = open("a:\swp0001.swp", O_CREATE);
while(1) {
sleep(5);
get_user_input();
sleep(5);
act_on_user_input();
sleep(5);
if (rand() < 0.9)
crash(complete_system);
}
return(unrecoverable_system);
}
...
[ETC ETC]
...
|> if (rand() < 0.9)
|> crash(complete_system);
|> }
|> return(unrecoverable_system);
|> }
Now that was *funny* ... :)) Thanks !
Paul
Paul Joswig
Department of Computer Science
University of Adelaide
South Australia
Ah...you forgot a few lines!!!
>#include <stdlib.h>
#include <shiplate.h>
>char make_prog_look_big[1600000];
+int resource_block(64);
> if (fast_cpu())
> set_wait_states(lots);
+ usable_memory=memory_available() * .15;
+ if (network_exist())
+ turn_off_network();
--
Dan Newcombe newc...@aa.csc.peachnet.edu
Clayton State College Morrow, Georgia
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
"And the man in the mirror has sad eyes." -Marillion
Yum, Yum!
Tim.
> char make_prog_look_big[1600000];
^^^^^^^^^^
This is clearly a lie. In the real windows code, this is declared as
static. Besides, since its global, this wouldn't link since it conflicts
with the other global variable that's declared as:
static char make_prog_delete_OS2
If you'd read the ANSI standard (say in hushed tones), you'll see that it
can't actually even be in there, since globals are only unique in the
first 8 characters (I think this is to make sure IBM mainframe C is ANSI
compatible, although some people claim its mostly to p*ss off all the
other vendors).
From K&R 2nd ed A2.2, p. 192:
"...Identifiers may have any length, and for internal identifiers, at
least the first 31 characters are significant; some implementations
may make more characters significant. [...] Identifiers with external
linkage are more restricted: implementations may make as few as the
first six characters significant, and may ignore case distinctions."
jim frost
ji...@centerline.com
Jim, notice that you're reading from K&R (said in condescending tone), and
not the more holy, and revered ANSI (said in hushed tone).
When disputes arise between the two, the reader is advised to consider who
wrote Unix before deciding whom is more definitive (i.e. Ritchie wrote Unix,
so he must be viewed with extreme skepticism).
Oops! Sorry, I just read the Unix-Hater's handbook.
Um, Tom, the _ANSI_ standard says the first 31 characters (minimum) must
be significant. Pre-ANSI implementations may have allowed less. I
believe the version of K&R that Jim was quoting (2nd. Edition) covers
ANSI C.
Hope that clears things up... ;)
--
Terry Sikes == tsi...@netcom.com | All I want is a baseline 1/1/1 machine:
Alternate address: tsi...@fatcity.com | 1000 MIPS, 1000 MB RAM, and 1000 GB HD.
Also tls...@bix.com, tsi...@aol.com |
All my opinions reflect my views only!| Is that too much to ask?
^
|
Shouldn't this be .25 ?
: + if (network_exist())
: + turn_off_network();
:)
Felix Eng
SIngapore OS/2 User Group
>Um, Tom, the _ANSI_ standard says the first 31 characters (minimum) must
>be significant. Pre-ANSI implementations may have allowed less. I
>believe the version of K&R that Jim was quoting (2nd. Edition) covers
>ANSI C.
>
>Hope that clears things up... ;)
Just so I have the last word, I was specifically referring to external
variables, which, according to the ANSI standard only have to be significant
in the first 6 characters.
Since in the original source code, it was implicitly declared as external,
I'm entirely certain I'm right <BG>.
Therefore, that wasn't really the source code for Windows.
Tom Krotchko
to...@access.digex.net
TK> In article <lotus.7...@deakin.edu.au>, <lo...@deakin.edu.au>
TK> writes:
>> char make_prog_look_big[1600000];
TK> ^^^^^^^^^^
TK> This is clearly a lie. In the real windows code, this is declared as
TK> static. Besides, since its global, this wouldn't link since it
TK> conflicts with the other global variable that's declared as:
TK> static char make_prog_delete_OS2
Damn you Tom! Now that you have debugged Chicago, they will easily make their
1994 ship schedule! OS/2 is _DOOMED!_
Sincerely,
Chris
: > char make_prog_look_big[1600000];
: ^^^^^^^^^^
: static char make_prog_delete_OS2
Idiot.
Since when has Microsoft bothered to conform to standards, or even bother
with correct code. In my opinion this only makes the author's post look
more authentic. For instance, Microsoft's idea of optimizing code is to
remove any _obvious_ compilation errors.
Justin.
K&R 2nd ed. is ANSI (said rather loud and rudely, causing the entire
room to look at me in shock and disgust...) The 1st edition was
completely wacked, and only applicable to Unix.
---------------------+--------------------------------------------------------
David Charlap | The contents of this message are not the opinions of
da...@visix.com | Visix Software, or of anyone besides myself.
Visix Software, Inc. +--------------------------------------------------------
Member of Team-OS/2 |
---------------------+
Blasphemer! Only ANSI is ANSI. Worship not at the alter of a false god!
Some claim that K&R 2nd ed. and other books *are* ANSI. This is not so.
They all purport to accurately and completely describe the ANSI standard.
None of them are entirely accurate, nor are any of them complete. If you're
going to assert that some construct is or is not blessed by the ANSI standard,
get the actual standard and quote it! Do not rely on descriptions of the
standard, or worse yet, damn your immortal soul by using mere implementations
or interpretations of the holy document.
(Like whining "well the Soooper-Doooper C+++ compiler does it this way, and
*everyone knows* that SDC+++ is the latest word in ANSI conformance, so
therefore this way, by definition, *must be* the ANSI way." Bah! I snort in
disgust and contempt every time I hear this particular 'argument'. :-) :-)
P.S. K&R 2nd ed, is a fine book, and I recommend it -- just don't make the
mistake of thinking that it *is* the ANSI standard.
Regards, | "...Then anyone who leaves behind him a written manual, and
Ian R. Ameline | likewise anyone who receives it, in the belief that such
(speaking for | writing will be clear and certain, must be exceedingly
myself, not IBM) | simple-minded..." Plato, _Phaedrus_
-- This quote goes in spades for the ANSI C standard! :-)
>Um, Tom, the _ANSI_ standard says the first 31 characters (minimum) must
>be significant. Pre-ANSI implementations may have allowed less. I
>believe the version of K&R that Jim was quoting (2nd. Edition) covers
>ANSI C.
>
>Hope that clears things up... ;)
And to follow up my own post (I hate it when I do that).
Sig. characters for external linkage are six ("and don't count on case
signficance"), according to the standard. I hope this will be fixed
in the ANSI C++ spec. Anybody know what the draft spec says?
>Sig. characters for external linkage are six ("and don't count on case
>signficance"), according to the standard. I hope this will be fixed
>in the ANSI C++ spec. Anybody know what the draft spec says?
I have a funny feeling it won't. Too many linkers out that that won't
tolerate funny stuff like "ten character external variables". What are you,
some kind of wise guy????
Tom Krotchko
<to...@access.digex.net>
I too have a funny feeling about this. Why is it linkers are seen as sacred
with C++? With better means of linking the parts together than the standard
linkers, you also get better type checks (templates are a mess, since you
can have different implementations in different files, and no linker would
notice, causing very weird errors, the same goes for in-line functions).
To get at least some OS/2 advocacy in this, Cset++ at least supports this
partially (all the way out?) with the intermediate code linker (optional).
_
/Bjorn.
--
H:c/o Eklund W:Ericsson Telecom etx...@kk.ericsson.se
Kvistbrogatan 15 kk/etx/t/bea <Team-OS/2>
S-124 67 Bandhagen/SWEDEN S-126 25 Stockholm/Sweden Software designers work
Phone: +46 8 647 4374 Phone: +46 8 719 9620 with vapour-ware.
Maybe that's the reason why it took so long to port Windows (NT) to Alpha??
Sorry couldn't resist...
Cheers,
Jochen
------------------------------------------------------------------
This is just my own opinion, not the opinion of SAS