![]() |
Re: 2.08 and Incompatible Battle Reports
alexti --
If memory serves, there's no standard way to specify to a compiler that a given C function has no side-effects. Function calls should not be automatically collated unless the code is inlined, in which case it may be possible. There might be a way to search the transitive closure of a function, so long as the closure resides within a given source file, for unsafe operations (assignments to non-local variables, assorted pieces of assembler, function calls outside file, I/O...) but that would seem like an awful headache for a compiler designer to consider in light of the fact that the original programmer could easily handle the job himself by calling the function once and assigning the result to a variable, then assigning a second variable the same value as the first. |
Re: 2.08 and Incompatible Battle Reports
Quote:
</font><blockquote><font size="1" face="sans-serif, arial, verdana">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">p = f(); q = f(); r = p + q; </pre><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">so your example could be deemed irrelevant. However, JK subsequently revealed the actual structure of the code, and thus demonstrated that your example was actually more analogous to it than the previously suggested Version. So my pedantic objection to your example is at least as irrelevant, if not more so... http://forum.shrapnelgames.com/image...s/rolleyes.gif |
Re: 2.08 and Incompatible Battle Reports
Quote:
[Edit: re-read what I'd misread. Deleted half of my post.] [ February 26, 2004, 18:58: Message edited by: E. Albright ] |
Re: 2.08 and Incompatible Battle Reports
Quote:
Quote:
|
Re: 2.08 and Incompatible Battle Reports
Quote:
|
Re: 2.08 and Incompatible Battle Reports
DISCLAIMER Im just kidding.
There are no mismatched battle reports. You all just have cowardly messengers. "Ummm you won. Yeah thats it, YOU WON oh Mighty and Frightening Deity." I dont have that problem. But then I usually take wimply little mages. I dont take big scarey two-headed snakes, or giant floating heads. [ February 26, 2004, 20:47: Message edited by: Gandalf Parker ] |
Re: 2.08 and Incompatible Battle Reports
Quote:
In the following example you can't rely on whether left call or right call will be evaluated first, but you can rely that both of them will be evaluated. </font><blockquote><font size="1" face="sans-serif, arial, verdana">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> int print_empty_line() { printf("\n"); return 1; } void foo(int x) { if (x + print_empty_line() < 2 + print_empty_line()) ... }</pre><hr /></blockquote><font size="2" face="sans-serif, arial, verdana"> Quote:
</font><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">Which case you considering? Concerning evaluation order it's standard-compliant, but if it replaces 2 calls with one, it's not. |
Re: 2.08 and Incompatible Battle Reports
Quote:
</font><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">Here's where those examples came from: Quote:
</font><blockquote><font size="1" face="sans-serif, arial, verdana">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> f(); f(); f(), f(); f()+f()</pre><hr /></blockquote><font size="2" face="sans-serif, arial, verdana">Edit: Fixed quotations. Again. P.S. I want real forum/client http://forum.shrapnelgames.com/images/icons/icon12.gif [ February 27, 2004, 00:23: Message edited by: alexti ] |
Re: 2.08 and Incompatible Battle Reports
OK master password is in now, but has anyone tried using it? I take it that it is only to override the player passwords? No AI access? I was hoping it would let me jump in midgame to check on what an AI was doing.
|
Re: 2.08 and Incompatible Battle Reports
Quote:
Of course, it helps that I never lose a battle, and that there are never bad news to report. And it helps that I have a first-class majordomo. (Tacticus Sanguinus, God of Mictlan) |
All times are GMT -4. The time now is 08:36 AM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.